Redis3重建Cluster

时间:2025-03-05 13:03:39

1、关闭cluster全部节点
2、删除所有nodes.conf文件
3、开启全部节点
4、依次flushall
5、重建集群即可

Share the post "Redis3重建Cluster"

例子:

redis集群启动失败案例

部署Redis分布式集群时,出现了如下错误:

moguang@ubsvr13:/opt/redis-unstable/src$ ./redis-trib.rb create
>>> Creating cluster
Connecting to node : OK
Connecting to node : OK
Connecting to node : OK
>>> Performing hash slots allocation on  nodes...
Using  masters:

M: 225b7f54c67483f71955db78312a90c67941fff0
   slots:- ( slots) master
M: bca62c53e7f50d7c83dd418ed23e08fb8a4e9bb5
   slots:- ( slots) master
M: 47483c65a705025aab28ee74da210a2dce41bc41
   slots:- ( slots) master
Can I set the above configuration? (type 'yes' to accept): yes
/usr/lib/ruby/gems//lib/redis/client.rb::in `call': ERR Slot 16011 is already busy (Redis::CommandError)
/lib/redis.rb::in `method_missing'
/lib/redis.rb::in `synchronize'
:in `mon_synchronize'
/lib/redis.rb::in `synchronize'
/lib/redis.rb::in `method_missing'
:in `flush_node_config'
:in `flush_nodes_config'
:in `each'
:in `flush_nodes_config'
:in `create_cluster_cmd'
:in `send'

经检查,这是由于上一次配置集群失败时留下的配置信息导致的。 只要把redis.conf中定义的 cluster-config-file 所在的文件删除,重新启动redis-server及运行redis-trib即可。