Redis:Can‘t connect to master: redis://127.0.0.1:7002 with slot ranges: [[10923-16383]]

介绍

在使用redis做集群的时候,启动SpringBoot遇到的问题。

2020-12-21 16:22:03.294 ERROR 2192 --- [isson-netty-2-8] o.r.cluster.ClusterConnectionManager     : Can't connect to master: redis://127.0.0.1:7003 with slot ranges: [[5461-10922]]
2020-12-21 16:22:03.294 ERROR 2192 --- [isson-netty-2-7] o.r.cluster.ClusterConnectionManager     : Can't connect to master: redis://127.0.0.1:7002 with slot ranges: [[10923-16383]]
2020-12-21 16:22:03.294 ERROR 2192 --- [isson-netty-2-9] o.r.cluster.ClusterConnectionManager     : Can't connect to master: redis://127.0.0.1:7005 with slot ranges: [[0-5460]]
2020-12-21 16:22:05.391  WARN 2192 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'redissonController' defined in file [D:\Space\Projects\JavaWeb\Java-Practice\spring-redisson\target\classes\com\example\demo\config\RedissonController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisson' defined in class path resource [org/redisson/spring/starter/RedissonAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.redisson.api.RedissonClient]: Factory method 'redisson' threw exception; nested exception is org.redisson.client.RedisConnectionException: Can't connect to servers!
2020-12-21 16:22:05.401  INFO 2192 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2020-12-21 16:22:05.443  INFO 2192 --- [           main] ConditionEvaluationReportLoggingListener : 

解决办法

检查redis.conf是否配置了bind 127.0.0.1,如果有注释掉,另外把protected-mode设置为no

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值