SentinelConnectionManager should use AUTH with Sentinel servers

pull/903/head
Nikita 8 years ago
parent 8f4ab052a7
commit e2c9d17848

@ -17,6 +17,6 @@ package org.redisson.api;
public enum NodeType {
MASTER, SLAVE
MASTER, SLAVE, SENTINEL
}

@ -373,9 +373,13 @@ public class MasterSlaveConnectionManager implements ConnectionManager {
.setSslTruststorePassword(config.getSslTruststorePassword())
.setSslKeystore(config.getSslKeystore())
.setSslKeystorePassword(config.getSslKeystorePassword())
.setPassword(config.getPassword())
.setDatabase(config.getDatabase())
.setClientName(config.getClientName());
if (type != NodeType.SENTINEL) {
redisConfig.setPassword(config.getPassword());
}
return redisConfig;
}

@ -71,7 +71,7 @@ public class SentinelConnectionManager extends MasterSlaveConnectionManager {
initTimer(this.config);
for (URI addr : cfg.getSentinelAddresses()) {
RedisClient client = createClient(NodeType.MASTER, addr, this.config.getConnectTimeout(), this.config.getRetryInterval() * this.config.getRetryAttempts());
RedisClient client = createClient(NodeType.SENTINEL, addr, this.config.getConnectTimeout(), this.config.getRetryInterval() * this.config.getRetryAttempts());
try {
RedisConnection connection = client.connect();
if (!connection.isActive()) {
@ -154,7 +154,7 @@ public class SentinelConnectionManager extends MasterSlaveConnectionManager {
}
private RFuture<RedisPubSubConnection> registerSentinel(final SentinelServersConfig cfg, final URI addr, final MasterSlaveServersConfig c) {
RedisClient client = createClient(NodeType.MASTER, addr, c.getConnectTimeout(), c.getRetryInterval() * c.getRetryAttempts());
RedisClient client = createClient(NodeType.SENTINEL, addr, c.getConnectTimeout(), c.getRetryInterval() * c.getRetryAttempts());
RedisClient oldClient = sentinels.putIfAbsent(addr.getHost() + ":" + addr.getPort(), client);
if (oldClient != null) {
return newSucceededFuture(null);

Loading…
Cancel
Save