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
有谁遇到过这个问题吗