Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2211

NOAUTH Authentication required spring-boot-data-redis+Realease Lettuce+Redis sentinel

$
0
0

when I restart redis cause
java.util.concurrent.ExecutionException: io.lettuce.core.RedisCommandExecutionException: NOAUTH Authentication required.Why is this a problemuse version like this

@Configurationpublic class RedisConfig {    @Autowired    private RedisProperties redisProperties;    @Bean(destroyMethod = "close")    public StatefulRedisConnection<String, Object> StatefulRedisConnection() {        RedisURI redisUri = RedisURI.builder().withPassword(redisProperties.getPassword())                .withSentinel(redisProperties.getSentinel().getNodes().get(0).split(":")[0],                        Integer.valueOf(redisProperties.getSentinel().getNodes().get(0).split(":")[1]))                .withSentinelMasterId(redisProperties.getSentinel().getMaster())                .withDatabase(redisProperties.getDatabase()).build();        RedisClient redisClient = RedisClient.create(redisUri);        return redisClient.connect(new SerializedObjectCodec());    }}
public class CacheImpl implements Cache {    @Autowired    private StatefulRedisConnection connect;    public Boolean addCourseInfosCache() {        RedisAsyncCommands<String, Object> commands = connect.async();        // disable auto-flushing        commands.setAutoFlushCommands(false);        List<RedisFuture<?>> futures = Lists.newArrayList();        commands.flushCommands();    }}

Viewing all articles
Browse latest Browse all 2211

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>