连接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

有谁遇到过这个问题吗

可能是创建集群的时候用的内网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

朋友,你解决了吗,我也遇到了同样的问题,在第一行的时候出现。

不是创建集群时候的问题,就是第一行的会自动使用内网ip

https://blog.csdn.net/boyheroes/article/details/85004031