本质原因
客户端设置了auth认证,但没设置密码。参考:https://blog.youkuaiyun.com/quanaianzj/article/details/84621743
解决方案
-
redis配置文件去掉密码校验。
requirePass: 你的密码
-
客户端配置文件中去掉password所在行。
-
客户端覆写配置类,单独处理password。
如:
@Bean(destroyMethod = "shutdown") public RedissonClient redissonClient() { Config config = new Config(); ClusterServersConfig clusterServersConfig = config.useClusterServers(); clusterServersConfig.addNodeAddress(this.redisProperties.getCluster().getNodes().stream() .map(node -> "redis://" + node).toArray(x$0 -> new String[x$0])); if (StringUtils.isNotBlank(this.redisProperties.getPassword())) { clusterServersConfig.setPassword(this.redisProperties.getPassword()); } return Redisson.create(config); }