Hi Team,
We are using Redis 6.2.6 version with ACL enabled. My client application is trying to connect to sentinel but getting below exception. Please advise.
I have created a sentinel user for the client to connect following this doc - Redis Sentinel Documentation β Redis
Similar like this -
127.0.0.1:5000> ACL SETUSER sentinel-user ON >user-password -@all +auth +client|getname +client|id +client|setname +command +hello +ping +role +sentinel|get-master-addr-by-name +sentinel|master +sentinel|myid +sentinel|replicas +sentinel|sentinels
Even with the sentinel superuser which has all the permission, itβs throwing the same error.
The client library being used is - Jedis 3.7.0
Exception -
12:33:09.552 [Source: raw-events -> Sink: redis-sink (1/2)#0] WARN JedisSentinelPool - Cannot get master address from sentinel running @ HOST:PORT. Reason: {}. Trying next one.
redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication required.
at redis.clients.jedis.Protocol.processError(Protocol.java:96)
at redis.clients.jedis.Protocol.process(Protocol.java:137)
at redis.clients.jedis.Protocol.read(Protocol.java:192)
at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:316)
at redis.clients.jedis.Connection.getBinaryMultiBulkReply(Connection.java:277)
at redis.clients.jedis.Connection.getMultiBulkReply(Connection.java:271)
at redis.clients.jedis.Jedis.sentinelGetMasterAddrByName(Jedis.java:7785)
at redis.clients.jedis.JedisSentinelPool.initSentinels(JedisSentinelPool.java:231)
at redis.clients.jedis.JedisSentinelPool.<init>(JedisSentinelPool.java:183)
at redis.clients.jedis.JedisSentinelPool.<init>(JedisSentinelPool.java:172)
at redis.clients.jedis.JedisSentinelPool.<init>(JedisSentinelPool.java:148)
at redis.clients.jedis.JedisSentinelPool.<init>(JedisSentinelPool.java:138)
at redis.clients.jedis.JedisSentinelPool.<init>(JedisSentinelPool.java:113)
at redis.clients.jedis.JedisSentinelPool.<init>(JedisSentinelPool.java:101)
at redis.clients.jedis.JedisSentinelPool.<init>(JedisSentinelPool.java:77)
Caused by: redis.clients.jedis.exceptions.JedisConnectionException: All sentinels down, cannot determine where is X master is running...
at redis.clients.jedis.JedisSentinelPool.initSentinels(JedisSentinelPool.java:258)
at redis.clients.jedis.JedisSentinelPool.<init>(JedisSentinelPool.java:183)
at redis.clients.jedis.JedisSentinelPool.<init>(JedisSentinelPool.java:172)
at redis.clients.jedis.JedisSentinelPool.<init>(JedisSentinelPool.java:148)
at redis.clients.jedis.JedisSentinelPool.<init>(JedisSentinelPool.java:138)
at redis.clients.jedis.JedisSentinelPool.<init>(JedisSentinelPool.java:113)
at redis.clients.jedis.JedisSentinelPool.<init>(JedisSentinelPool.java:101)
at redis.clients.jedis.JedisSentinelPool.<init>(JedisSentinelPool.java:77)
Code snippet of connection to sentinel.
final Set<String> hosts = Set.of(
"HOST_1:26379",
"HOST_2:26379",
"HOST_3:26379");
final var jedisPoolConfig = new JedisPoolConfig();
jedisPoolConfig....
return new JedisSentinelPool("group", hosts, jedisPoolConfig, 10_000,"user","password",0);
But interestingly with the same sentinel credentials, I am able to connect to the sentinel cluster from redis-cli and get the Redis master details.