SHeart7 2019-07-30 12:39 采纳率: 0%
浏览 2546

连接redis报错Can't connect to master: redis://172.17.111.181:7033 with slot ranges: [[10923-16383]]

1.环境:

springboot2 + redisson3.8.2 + redis4.0.2集群模式
2.redisson采用yml配置 如下:

clusterServersConfig:
  idleConnectionTimeout: 10000
  pingTimeout: 1000
  connectTimeout: 10000
  timeout: 3000
  retryAttempts: 3
  retryInterval: 1500
  failedSlaveReconnectionInterval: 3000
  failedSlaveCheckInterval: 3000
  password: null
  subscriptionsPerConnection: 5
  clientName: null
  loadBalancer: !<org.redisson.connection.balancer.RoundRobinLoadBalancer> {}
  slaveSubscriptionConnectionMinimumIdleSize: 1
  slaveSubscriptionConnectionPoolSize: 10
  slaveConnectionMinimumIdleSize: 3
  slaveConnectionPoolSize: 7
  masterConnectionMinimumIdleSize: 3
  masterConnectionPoolSize: 7
  readMode: "MASTER_SLAVE"
  nodeAddresses:
  - "redis://39.106.*.*:7033"
  - "redis://39.106.*.*:7032"
  - "redis://39.106.*.*:7031"
  - "redis://39.106.*.*:7034"
  - "redis://39.106.*.*:7035"
  - "redis://39.106.*.*:7036"
  scanInterval: 1000
threads: 0
nettyThreads: 0
codec: !<org.redisson.codec.JsonJacksonCodec> {}
transportMode: "NIO"

3. 链接时报错信息

2019-07-30 12:26:31.142  INFO 8592 --- [isson-netty-1-5] o.r.cluster.ClusterConnectionManager     : slaves: [redis://39.106.*.*:7034] added for slot ranges: [[0-5460]]
2019-07-30 12:26:31.142  INFO 8592 --- [isson-netty-1-4] o.r.cluster.ClusterConnectionManager     : slaves: [redis://172.17.111.181:7035] added for slot ranges: [[5461-10922]]
2019-07-30 12:26:31.179  INFO 8592 --- [isson-netty-1-3] o.r.c.pool.MasterPubSubConnectionPool    : 1 connections initialized for 39.106.*.*/39.106.*.*:7032
2019-07-30 12:26:31.179  INFO 8592 --- [isson-netty-1-1] o.r.c.pool.MasterPubSubConnectionPool    : 1 connections initialized for 39.106.*.*/39.106.*.*:7031
2019-07-30 12:26:31.186  INFO 8592 --- [isson-netty-1-5] o.r.cluster.ClusterConnectionManager     : master: redis://39.106.*.*:7032 added for slot ranges: [[5461-10922]]
2019-07-30 12:26:31.186  INFO 8592 --- [isson-netty-1-5] o.r.c.pool.MasterConnectionPool          : 3 connections initialized for 39.106.*.*/39.106.*.*:7032
2019-07-30 12:26:31.187  INFO 8592 --- [isson-netty-1-8] o.r.cluster.ClusterConnectionManager     : master: redis://39.106.*.*:7031 added for slot ranges: [[0-5460]]
2019-07-30 12:26:31.187  INFO 8592 --- [isson-netty-1-8] o.r.c.pool.MasterConnectionPool          : 3 connections initialized for 39.106.*.*/39.106.*.*:7031
2019-07-30 12:26:31.208  INFO 8592 --- [isson-netty-1-2] o.r.c.pool.PubSubConnectionPool          : 1 connections initialized for 39.106.*.*/39.106.*.*:7034
2019-07-30 12:26:31.209  INFO 8592 --- [isson-netty-1-3] o.r.connection.pool.SlaveConnectionPool  : 3 connections initialized for 39.106.*.*/39.106.*.*:7034
2019-07-30 12:26:41.063 ERROR 8592 --- [isson-netty-1-7] o.r.cluster.ClusterConnectionManager     : Can't connect to master: redis://172.17.111.181:7033 with slot ranges: [[10923-16383]]
2019-07-30 12:26:43.264  WARN 8592 --- [           main] o.s.w.c.s.GenericWebApplicationContext   : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'redisClusterService': Unsatisfied dependency expressed through field 'redissonClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisson' defined in class path resource [com/qiriver/tools/monkey/distributed/redis/RedisConfiguration.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: Not all slots are covered! Only 10923 slots are avaliable
2019-07-30 12:26:43.264  INFO 8592 --- [           main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'

7031 7032 7033 是主节点
连接不上的节点是yml配置中第一个节点。如果将7031放在配置第一行,报错将会是连不上第一个节点

.是我服务器的ip

有谁遇到过这个问题吗

  • 写回答

4条回答 默认 最新

  • SHeart7 2019-07-30 16:36
    关注

    可能是创建集群的时候用的内网id,改成下面本机回环地址,集群数据删掉,重建集群就就好了:
    ruby redis-trib.rb create --replicas 1 127.0.0.1:7031 127.0.0.1:7032 127.0.0.1:7033 127.0.0.1:7034 127.0.0.1:7035 127.0.0.1:7036

    评论

报告相同问题?

悬赏问题

  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题