First, scene description
1. Test environment installation redis6, cluster deployment, three master and three slave. That is to achieve high concurrency, high availability, high security.
2. Redis creates clusters through bind intranet IP.
3. The local and test environment are not in the same LAN, and there is no VPN, so it is impossible to access redis through the test intranet IP.
4. Note: through the redis client, using the public IP + port, you can access redis.
Problem: spring program can’t access redis correctly through IP + port of public network.
Reason: when spring accesses the redis cluster, it first obtains the intranet IP and ports of all nodes in the redis cluster through the configured public IP and ports, and then the program finally accesses redis through the intranet IP and ports.
Second, the solution
1. Install the redis singleton on the test server.
2. Configuration file redis.conf Set daemonize to yes, that is to realize the background startup of redis.
3. In the test environment network security group, add the white list of local environment public IP, open port 6379.
4. Modify the local configuration file in spring program to access redis configuration mode. In this way, all technicians can connect to the test environment redis locally, and each technology does not need to open the redis service locally.
spring:
redis:
host: 47.112.108.1
port: 6379
timeout: 5000ms
pool:
max-active: 8
min-idle: 0
max-idle: 8
max-wait: -1
Read More:
- Redis cli create creates an error when creating a cluster
- Solve the problem that the local flow of the nifi node is inconsistent with the cluster flow, resulting in the failure to join the cluster
- Solve the problem of testing redis cluster“ java.lang.NumberFormatException : For input string: “ [email protected]@17002 “And so on
- Redis cluster error: (error) moved solution
- (20200916 Solved)Docker||redis-cli Could not connect to Redis at 127.0.0.1:6379: Connection refused
- Invalid cluster ID. ignore in building Doris database environment
- Centos7 offline installation of redis and PHP extension redis
- Apache allows specified IP access
- When setting up etcd cluster, an error is reported. Etcd: request cluster ID mismatch error resolution is only applicable to new etcd cluster or no data cluster
- Solution of server connection reused (test environment)
- Error in react build packaging test environment
- Mr local operation error: nativeio $windows.access0
- Redis: How to Configurate Redis.conf File
- Running program encountered Error:Access violation at 0x**(tried to write to 0x**) program terminated
- NPM ERR! Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules’
- [Java] Java program error: exception_ ACCESS_ VIOLATION (0xc0000005)
- Securityerror: error ᦇ 2148: SWF file (SWF file cannot access local resources)
- Quickly create a local typescript running environment.
- [Solved] Redis Error: org.springframework.data.redis.RedisConnectionFailureExceptionjava.net.SocketTimeoutException