spring-projects / spring-data-redis

Provides support to increase developer productivity in Java when using Redis, a key-value store. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
https://spring.io/projects/spring-data-redis/
Apache License 2.0
1.77k stars 1.17k forks source link

spring-data-redis1.8.23 cannot use jedis connect to redis 5.0.3 sentinel caused by NOAUTH Authentication required. #2157

Closed ZhangJing1994 closed 3 years ago

ZhangJing1994 commented 3 years ago

redis: password: "97dyL77Cu7" database: 5 sentinel: master: mymaster nodes: 192.168.183.111:26380,192.168.183.111:26381,192.168.183.111:26382 session: store-type: redis timeout: 1800000 #半小时过期

error.log

2021-09-08 15:48:22.960 [localhost-startStop-1] INFO [redis.clients.jedis.JedisSentinelPool:141] - Trying to find master from available Sentinels... 2021-09-08 15:52:52.244 [localhost-startStop-1] WARN [redis.clients.jedis.JedisSentinelPool:169] - Cannot get master address from sentinel running @ 192.168.183.111:26380. Reason: redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication required.. Trying next one. 2021-09-08 15:52:52.246 [localhost-startStop-1] WARN [redis.clients.jedis.JedisSentinelPool:169] - Cannot get master address from sentinel running @ 192.168.183.111:26381. Reason: redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication required.. Trying next one. 2021-09-08 15:52:52.248 [localhost-startStop-1] WARN [redis.clients.jedis.JedisSentinelPool:169] - Cannot get master address from sentinel running @ 192.168.183.111:26382. Reason: redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication required.. Trying next one.

redis.version redis-5.0.3 springboot.version 1.5.22.RELEASE spring-data-redis-1.8.23.RELEASE

mp911de commented 3 years ago

Please configure the Sentinel password. It is supported with Spring Data Redis 2.2 and newer, there's no support for the 1.x development line anymore.

ZhangJing1994 commented 3 years ago

thank you , I configure the Sentinel password in sentinel.conf ,it is no problem with Redis 6.2.3 ,but it has this problem with Redis 5.0.3 the configuration like this

requirepass 97dyL77Cu7

sentinel auth-pass mymaster 97dyL77Cu7