创建redis集群的时候报错如下:
[root@node112 /usr/local/redis/bin]#./redis-trib.rb create --replicas 1 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005 127.0.0.1:7006
>>> Creating cluster
>>> Performing hash slots allocation on 6 nodes...
Using 3 masters:
127.0.0.1:7001
127.0.0.1:7002
127.0.0.1:7003
Adding replica 127.0.0.1:7004 to 127.0.0.1:7001
Adding replica 127.0.0.1:7005 to 127.0.0.1:7002
Adding replica 127.0.0.1:7006 to 127.0.0.1:7003
M: 954cdaf26ca02a6119a1a602553815ed692545a7 127.0.0.1:7001
slots:0-5460,12706 (5462 slots) master
M: dcc7676a96c5606eff8bf1a92b0a7265811cc131 127.0.0.1:7002
slots:5461-10922,12706 (5463 slots) master
M: 5e06637fadb673783d1a0ed9bd27eb30ae25f253 127.0.0.1:7003
slots:10923-16383 (5461 slots) master
S: 67365a376f2378e9a2e7692317dadddd6bd027db 127.0.0.1:7004
replicates 954cdaf26ca02a6119a1a602553815ed692545a7
S: eee52ed5235924fd7afbad6e73f9251418af766f 127.0.0.1:7005
replicates dcc7676a96c5606eff8bf1a92b0a7265811cc131
S: 2bc42e8ddbe906b2f3da41966a022eaea0e8858c 127.0.0.1:7006
replicates 5e06637fadb673783d1a0ed9bd27eb30ae25f253
Can I set the above configuration? (type 'yes' to accept): yes
/usr/local/rvm/gems/ruby-2.3.3/gems/redis-4.0.1/lib/redis/client.rb:119:in `call': ERR Slot 12706 is already busy
(Redis::CommandError)
from /usr/local/rvm/gems/ruby-2.3.3/gems/redis-4.0.1/lib/redis.rb:2764:in `block in method_missing'
from /usr/local/rvm/gems/ruby-2.3.3/gems/redis-4.0.1/lib/redis.rb:45:in `block in synchronize'
from /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
from /usr/local/rvm/gems/ruby-2.3.3/gems/redis-4.0.1/lib/redis.rb:45:in `synchronize'
from /usr/local/rvm/gems/ruby-2.3.3/gems/redis-4.0.1/lib/redis.rb:2763:in `method_missing'
from ./redis-trib.rb:212:in `flush_node_config'
from ./redis-trib.rb:776:in `block in flush_nodes_config'
from ./redis-trib.rb:775:in `each'
from ./redis-trib.rb:775:in `flush_nodes_config'
from ./redis-trib.rb:1296:in `create_cluster_cmd'
from ./redis-trib.rb:1701:in `<main>'
报了这个错误“call': ERR Slot 12706 is already busy (Redis::CommandError)”,这是因为之前创建集群没有成功,但是却生成了每一个节点的nodes_xxx.conf和pid文件,分别找到每一个节点的这两个文件,并删除,再重启redis各个节点,然后执行创建集群的命令“./redis-trib.rb create --replicas 1 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005 127.0.0.1:7006”即可。