SpringBoot integrated Redis appears: Unable to connect to Redis

1. Check whether the Redis server is started.

2. The spring.redis.timeout connection timeout (milliseconds) in the redis configuration application.yml (or application.properties) cannot be set to 0, and the general modification is as follows: spring.redis.timeout=5000.

3. Find the redis configuration file redis.conf: Execute vim redis.conf
3.1 protected-mode yes to protected-mode no (that is, this configuration item indicates whether to enable the protected mode, which is enabled by default, and Redis will only access locally after it is enabled , deny external access).
3.2 Comment out bin127.0.0.1 ie #bin 127.0.0.1 (ps: If you do not comment out, it means that the specified redis only accepts requests from this IP address; after commenting out, it means that all requests will be processed).

4. If requirepass is not configured in Redis, then do not write spring.redis.password in application.properties (or application.yaml).

5. Check whether redis has set a password

Guess you like

Origin blog.csdn.net/Aoutlaw/article/details/131980210