redis 跨機器叢集啟動出錯
部署Redis分散式叢集時,出現瞭如下錯誤:
[email protected]:/opt/redis-unstable/src$ ./redis-trib.rb create 192.168.1.13:6379 192.168.1.15:6380 192.168.1.40:6381
Creating cluster
Connecting to node 192.168.1.13:6379: OK
Connecting to node 192.168.1.15:6380: OK
Connecting to node 192.168.1.40:6381: OK
Performing hash slots allocation on 3 nodes…
Using 3 masters:
192.168.1.40:6381
192.168.1.15:6380
192.168.1.13:6379
M: 225b7f54c67483f71955db78312a90c67941fff0 192.168.1.13:6379
slots:10922-16383 (5462 slots) master
M: bca62c53e7f50d7c83dd418ed23e08fb8a4e9bb5 192.168.1.15:6380
slots:5461-10921 (5461 slots) master
M: 47483c65a705025aab28ee74da210a2dce41bc41 192.168.1.40:6381
slots:0-5460 (5461 slots) master
Can I set the above configuration? (type ‘yes’ to accept): yes
/usr/lib/ruby/gems/1.8/gems/redis-3.0.7/lib/redis/client.rb:97:incall': ERR Slot 16011 is already busy (Redis::CommandError)
from /usr/lib/ruby/gems/1.8/gems/redis-3.0.7/lib/redis.rb:2432:inmethod_missing’
from /usr/lib/ruby/gems/1.8/gems/redis-3.0.7/lib/redis.rb:37:insynchronize'
mon_synchronize’
from /usr/lib/ruby/1.8/monitor.rb:242:in
from /usr/lib/ruby/gems/1.8/gems/redis-3.0.7/lib/redis.rb:37:insynchronize'
method_missing’
from /usr/lib/ruby/gems/1.8/gems/redis-3.0.7/lib/redis.rb:2431:in
from ./redis-trib.rb:203:inflush_node_config'
from ./redis-trib.rb:571:inflush_nodes_config’
from ./redis-trib.rb:570:ineach'
flush_nodes_config’
from ./redis-trib.rb:570:in
from ./redis-trib.rb:820:increate_cluster_cmd'
send’
from ./redis-trib.rb:1026:in
from ./redis-trib.rb:1026
經檢查,這是由於上一次配置叢集失敗時留下的配置資訊導致的。 只要把redis.conf中定義的 cluster-config-file 所在的檔案刪除,重新啟動redis-server及執行redis-trib即可。