|
|
|
@ -62,9 +62,10 @@ public class SentinelConnectionManager extends MasterSlaveConnectionManager {
|
|
|
|
|
private final Set<RedisURI> disconnectedSlaves = new HashSet<>();
|
|
|
|
|
private ScheduledFuture<?> monitorFuture;
|
|
|
|
|
private AddressResolver<InetSocketAddress> sentinelResolver;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final NatMapper natMapper;
|
|
|
|
|
|
|
|
|
|
private final String sentinelPassword;
|
|
|
|
|
private boolean usePassword = false;
|
|
|
|
|
private String scheme;
|
|
|
|
|
|
|
|
|
@ -79,6 +80,7 @@ public class SentinelConnectionManager extends MasterSlaveConnectionManager {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.config = create(cfg);
|
|
|
|
|
this.sentinelPassword = cfg.getSentinelPassword();
|
|
|
|
|
initTimer(this.config);
|
|
|
|
|
|
|
|
|
|
this.natMapper = cfg.getNatMapper();
|
|
|
|
@ -252,7 +254,13 @@ public class SentinelConnectionManager extends MasterSlaveConnectionManager {
|
|
|
|
|
String sslHostname) {
|
|
|
|
|
RedisClientConfig result = super.createRedisConfig(type, address, timeout, commandTimeout, sslHostname);
|
|
|
|
|
if (type == NodeType.SENTINEL && !usePassword) {
|
|
|
|
|
result.setUsername(null);
|
|
|
|
|
result.setPassword(null);
|
|
|
|
|
} else if (type == NodeType.SENTINEL && usePassword) {
|
|
|
|
|
result.setUsername(null);
|
|
|
|
|
if (sentinelPassword != null) {
|
|
|
|
|
result.setPassword(sentinelPassword);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|