怎么重建redis集群
答案:1 悬赏:30 手机版
解决时间 2021-02-05 01:23
- 提问者网友:你给我的爱
- 2021-02-04 05:05
怎么重建redis集群
最佳答案
- 五星知识达人网友:深街酒徒
- 2021-02-04 05:38
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 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:6381192.168.1.15:6380192.168.1.13:6379M: 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:in `call': ERR Slot 16011 is already busy (Redis::CommandError)from /usr/lib/ruby/gems/1.8/gems/redis-3.0.7/lib/redis.rb:2432:in `method_missing'from /usr/lib/ruby/gems/1.8/gems/redis-3.0.7/lib/redis.rb:37:in `synchronize'from /usr/lib/ruby/1.8/monitor.rb:242:in `mon_synchronize'from /usr/lib/ruby/gems/1.8/gems/redis-3.0.7/lib/redis.rb:37:in `synchronize'from /usr/lib/ruby/gems/1.8/gems/redis-3.0.7/lib/redis.rb:2431:in `method_missing'from ./redis-trib.rb:203:in `flush_node_config'from ./redis-trib.rb:571:in `flush_nodes_config'from ./redis-trib.rb:570:in `each'from ./redis-trib.rb:570:in `flush_nodes_config'from ./redis-trib.rb:820:in `create_cluster_cmd'from ./redis-trib.rb:1026:in `send'from ./redis-trib.rb:1026经检查,这是由于上一次配置集群失败时留下的配置信息导致的。 只要把redis.conf中定义的 cluster-config-file 所在的文件删除,重新启动redis-server及运行redis-trib即可。
2、删除所有nodes.conf文件
3、开启全部节点
4、依次flushall
5、重建集群即可
Share the post "Redis3重建Cluster"
例子:
redis集群启动失败案例
部署Redis分布式集群时,出现了如下错误:
moguang@ubsvr13:/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:6381192.168.1.15:6380192.168.1.13:6379M: 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:in `call': ERR Slot 16011 is already busy (Redis::CommandError)from /usr/lib/ruby/gems/1.8/gems/redis-3.0.7/lib/redis.rb:2432:in `method_missing'from /usr/lib/ruby/gems/1.8/gems/redis-3.0.7/lib/redis.rb:37:in `synchronize'from /usr/lib/ruby/1.8/monitor.rb:242:in `mon_synchronize'from /usr/lib/ruby/gems/1.8/gems/redis-3.0.7/lib/redis.rb:37:in `synchronize'from /usr/lib/ruby/gems/1.8/gems/redis-3.0.7/lib/redis.rb:2431:in `method_missing'from ./redis-trib.rb:203:in `flush_node_config'from ./redis-trib.rb:571:in `flush_nodes_config'from ./redis-trib.rb:570:in `each'from ./redis-trib.rb:570:in `flush_nodes_config'from ./redis-trib.rb:820:in `create_cluster_cmd'from ./redis-trib.rb:1026:in `send'from ./redis-trib.rb:1026经检查,这是由于上一次配置集群失败时留下的配置信息导致的。 只要把redis.conf中定义的 cluster-config-file 所在的文件删除,重新启动redis-server及运行redis-trib即可。
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯