-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
DATAREDIS-524 - Use password to connect Redis nodes using Sentinel. #204
Conversation
…is Sentinel with LettuceConnectionFactory. Prepare issue branch.
LettuceConnectionFactory and DefaultLettucePool now use the configured password to authenticate with Redis. Authentication is applied when connecting to nodes that were obtained from Redis Sentinel.
LettuceConnectionFactory and DefaultLettucePool now use the configured password to authenticate with Redis. Authentication is applied when connecting to nodes that were obtained from Redis Sentinel. Original Pull Request: #204
Some formatting changes. Original Pull Request: #204
LettuceConnectionFactory and DefaultLettucePool now use the configured password to authenticate with Redis. Authentication is applied when connecting to nodes that were obtained from Redis Sentinel. Original Pull Request: #204
Some formatting changes. Original Pull Request: #204
I've been all over the web and nowhere is there a working example of how to connect to a password secured sentinel cluster. I've tried both Jedis and Lettuce connection factories - seems both of them do not support password auth on Sentinel nodes. This ticket seems to address that, but running with Spring Boot 2.1.7 I am still faced with this issues. Am I missing something? 🤔 |
Authenticating against Sentinel is a newer Redis feature that is supported by upgrading to Lettuce 5.2 (see redis/lettuce#1002). Lettuce 5.2 will be released in late September. |
Hi,
Nope I settled for using the redison connection factory instead (
https://github.com/redisson/redisson). Works well with secured sentinel
endpoints.
…On Thu, Oct 3, 2019 at 12:05 PM Chris Dekker ***@***.***> wrote:
@silentFred <https://github.com/silentFred> did you ever get this
working? I am running into the same issues. See my last comment on
redis/lettuce#1002
<redis/lettuce#1002>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#204?email_source=notifications&email_token=AAL2O73PFAFW2BZ4DPBS3S3QMW7V7A5CNFSM4CHN7AFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAHWCTI#issuecomment-537878861>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAL2O772XI2I4Z3C6TWHQ2DQMW7V7ANCNFSM4CHN7AFA>
.
|
@silentFred thanks! Got a sample project somewhere to see that working with Spring Boot? I guess you'd need to configure that setup programmatically instead of using the default starters? |
Hi Chris,
This is really all you need. Hope its pretty self explanatory?
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<version>${spring-boot-starter-data-redis.version}</version>
<exclusions>
<exclusion>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-boot-starter</artifactId>
<version>${redisson-spring-boot-starter.version}</version>
</dependency>
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
@bean
RedissonClient redissonClient(@value("${spring.redis.sentinel.nodes}")
List<String> sentinelNodes,
@value("${spring.redis.sentinel.master}") String sentinelMaster,
@value("${spring.redis.sentinel.password}") String password) {
Config config = new Config();
config.useSentinelServers().setMasterName(sentinelMaster).setPassword(password);
sentinelNodes.forEach(sentinelNode ->
config.useSentinelServers().addSentinelAddress("redis://" +
sentinelNode));
return Redisson.create(config);
}
…On Thu, Oct 3, 2019 at 5:08 PM Chris Dekker ***@***.***> wrote:
@silentFred <https://github.com/silentFred> thanks! Got a sample project
somewhere to see that working with Spring Boot? I guess you'd need to
configure that setup programmatically instead of using the default starters?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#204?email_source=notifications&email_token=AAL2O73E2IYSPI7ICFCH4ZLQMYDIDA5CNFSM4CHN7AFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAIQTYQ#issuecomment-537987554>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAL2O73Q2YQDW4MROZIRABLQMYDIDANCNFSM4CHN7AFA>
.
|
LettuceConnectionFactory and DefaultLettucePool now use the configured password to authenticate with Redis. Authentication is applied when connecting to nodes that were obtained from Redis Sentinel.
Related ticket: DATAREDIS-524