-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Description
Expected behavior
I am expecting the establish the connection with AWS ElasticCache Redis cluster successfully and JedisConnectionFactory object initialized successfully
Actual behavior
On application startup, I am seeing below error on throw when initializing JedisConnectionFactory:
Failed to instantiate [org.springframework.data.redis.connection.jedis.JedisConnectionFactory]: Factory method 'clusterModeJedisConnectionFactory' threw exception; nested exception is redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication required.\n\tat org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658)\n\tat org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:486)\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)\n\tat
Steps to reproduce:
Redis / Jedis Configuration
@Bean
@Conditional(RedisClusterModeCondition.class)
public JedisConnectionFactory clusterModeJedisConnectionFactory() {
RedisClusterConfiguration configuration = new RedisClusterConfiguration()
.clusterNode(redisHostName, redisPort);
configuration.setMaxRedirects(5);
JedisClientConfiguration clientConfiguration = sslEnabled?
JedisClientConfiguration.builder().useSsl().and().usePooling().build() :
JedisClientConfiguration.builder().build();
JedisConnectionFactory factory = new JedisConnectionFactory(configuration, clientConfiguration);
factory.afterPropertiesSet();
logger.info(String.format("Configuring Redis ClusterMode with host: %s and port: %d", redisHostName, redisPort));
return factory;
}
The Redis cluster have a default user with no password configured:
Jedis version:
3.6.3
Redis version:
5.0.6
Java version:
openjdk1.8.0.342_8.64.0.16_x64

