Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support auth/requirepass on sentinels #1636

Closed
marianowadel opened this issue Oct 18, 2017 · 5 comments
Closed

Support auth/requirepass on sentinels #1636

marianowadel opened this issue Oct 18, 2017 · 5 comments

Comments

@marianowadel
Copy link

marianowadel commented Oct 18, 2017

Hello, and first of all, sorry if I am wrong posting here.
I cannot seem to connect to sentinels configured with requirepass, as explained here.
I am talking about requirepass set for the sentinel in sentinel.conf, not for the redis server itself (which has requirepass set already). My configuration is as follows:

RedisSentinelConfiguration sentinelConfiguration = new RedisSentinelConfiguration();
sentinelConfiguration.setSentinels(this.redisNodes);
sentinelConfiguration.setMaster(this.masterName);
sentinelConfiguration.setPassword(RedisPassword.of(password));
JedisClientConfiguration clientConfiguration = JedisClientConfiguration.builder().connectTimeout(Duration.ofSeconds(this.timeout)).readTimeout(Duration.ofSeconds(this.timeout)).usePooling().build();
JedisConnectionFactory factory = new JedisConnectionFactory(sentinelConfiguration, clientConfiguration);

Whenever I try to connect, I get redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication required.
I tried debugging the connection, and saw that no password is used in the initSentinels method.
Am I doing something wrong? Is this setup supported? If not, will it ever be?
I am using the latest stable version 2.9.0.
Many thanks in advance.

@manucr619
Copy link

is there any update on this thread?

Is there any alternate for this to use?

@manucr619
Copy link

@marianowadel we extracted the jar and passed the sentinel password through every method. Will it be ok? @xetorthio

@ssouris
Copy link

ssouris commented Mar 16, 2019

Apparently, after Redis 5.0.1 they now support authentication at the Sentinel, Release notes.
Are there any plans to fix this?

@silentFred
Copy link

Yeah this is quite a problem - the connection pool takes all the credentials it needs to might as well supply them to the jedis client used to fetch the master node information? The underlying implementation is also private so it's impossible to extend and tweak it. 😭

sazzad16 pushed a commit that referenced this issue Nov 26, 2019
…1943)

This commit attempts to solve #1487 and #1636.

This PR adds a constructor to JedisSentinelPool to configure a Sentinel connection with respective timeout settings and a password. Supporting constructors have also been added to BinaryJedis and Jedis classes.
@sazzad16
Copy link
Collaborator

Resolved by #1943

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants