部署Redis集群时出现如下错误:
>>> Creating cluster
>>> Performing hash slots allocation on 9 nodes...
Using 4 masters:
192.168.247.40:7000
192.168.247.40:7001
192.168.247.40:7002
192.168.247.40:7003
Adding replica 192.168.247.40:7004 to 192.168.247.40:7000
Adding replica 192.168.247.40:7005 to 192.168.247.40:7001
Adding replica 192.168.247.40:7006 to 192.168.247.40:7002
Adding replica 192.168.247.40:7007 to 192.168.247.40:7003
Adding replica 192.168.247.40:7008 to 192.168.247.40:7000
M: 4b42d2b879d288cea816c976accd3fcb3d63d67b 192.168.247.40:7000
slots:0-4095,5798,5839,9900 (4099 slots) master
M: b08b49df489cd9107e57067d5547552c4907c1bc 192.168.247.40:7001
slots:4096-8191,9900 (4097 slots) master
M: fa3140e49ba4e8f71e6132e2ae352a2e5af2e335 192.168.247.40:7002
slots:5798,5839,8192-12287 (4098 slots) master
M: ed7d3a2c9e2d7029725392ae5b62b3ab0da1f661 192.168.247.40:7003
slots:5798,5839,9900,12288-16383 (4099 slots) master
S: e03fbcc8d16e57bdae6c7ff95d9ef4570c074077 192.168.247.40:7004
replicates 4b42d2b879d288cea816c976accd3fcb3d63d67b
S: 12e13f0275c4a17898751ef5aab45ddf80cdec41 192.168.247.40:7005
replicates b08b49df489cd9107e57067d5547552c4907c1bc
S: abdd72da18427bb78381d2265ce13022f9526063 192.168.247.40:7006
replicates fa3140e49ba4e8f71e6132e2ae352a2e5af2e335
S: e5172d9b2219e3134a632a706e295ba049de5382 192.168.247.40:7007
replicates ed7d3a2c9e2d7029725392ae5b62b3ab0da1f661
S: 9d6cfbfeaf6b8c19f34c699e39fbb3456d6bc8f3 192.168.247.40:7008
replicates 4b42d2b879d288cea816c976accd3fcb3d63d67b
Can I set the above configuration? (type 'yes' to accept): yes
/usr/lib/ruby/gems/1.8/gems/redis-3.3.2/lib/redis/client.rb:121:in `call': ERR Slot 9900 is already busy (Redis::CommandError)
from /usr/lib/ruby/gems/1.8/gems/redis-3.3.2/lib/redis.rb:2705:in `method_missing'
from /usr/lib/ruby/gems/1.8/gems/redis-3.3.2/lib/redis.rb:58:in `synchronize'
from /usr/lib/ruby/1.8/monitor.rb:242:in `mon_synchronize'
from /usr/lib/ruby/gems/1.8/gems/redis-3.3.2/lib/redis.rb:58:in `synchronize'
from /usr/lib/ruby/gems/1.8/gems/redis-3.3.2/lib/redis.rb:2704:in `method_missing'
from ./src/redis-trib.rb:212:in `flush_node_config'
from ./src/redis-trib.rb:776:in `flush_nodes_config'
from ./src/redis-trib.rb:775:in `each'
from ./src/redis-trib.rb:775:in `flush_nodes_config'
from ./src/redis-trib.rb:1296:in `create_cluster_cmd'
from ./src/redis-trib.rb:1701:in `send'
from ./src/redis-trib.rb:1701
经检查,这是由于上一次配置集群失败时留下的配置信息导致的。 只要把redis.conf中定义的 cluster-config-file 所在的文件删除,重新启动redis-server及运行redis-trib即可。