本文介绍了如何解决Redis群集&等待群集加入的问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3台机器,为redis集群创建了6个节点,几个月前创建成功了,但是现在掉了,我想尽办法修复它,但是它不起作用,所以我清理了所有的数据,从零开始重新创建,当我使用下面的命令创建集群的时候,它在这里挡路,等待节点加入集群,我为它做了一些研究,我清理了我的数据,记录了一遍又一遍,做了一遍又一遍,仍然不起作用。

redis-trib.rb create --replicas 1 10.2.1.208:6379 10.2.1.208:6380 10.2.1.209:6379 10.2.1.209:6380 10.2.1.15:6379 10.2.1.15:6380

show the result

redis-trib.rb create --replicas 1 10.2.1.208:6379 10.2.1.208:6380 10.2.1.209:6379 10.2.1.209:6380 10.2.1.15:6379 10.2.1.15:6380
>>> Creating cluster
>>> Performing hash slots allocation on 6 nodes...
Using 3 masters:
10.2.1.208:6379
10.2.1.209:6379
10.2.1.15:6379
Adding replica 10.2.1.209:6380 to 10.2.1.208:6379
Adding replica 10.2.1.208:6380 to 10.2.1.209:6379
Adding replica 10.2.1.15:6380 to 10.2.1.15:6379
M: 73b3b99bb17de63aa99eaf592376f0a06feb3d66 10.2.1.208:6379
   slots:0-5460 (5461 slots) master
S: 05b33ed6691797faaf7ccec1541396472b9d2866 10.2.1.208:6380
   replicates f14702ebb1462b313dd7eb4809ec50e30e4eef36
M: f14702ebb1462b313dd7eb4809ec50e30e4eef36 10.2.1.209:6379
   slots:5461-10922 (5462 slots) master
S: 3a9f433a8503281b0ddfc6ec69016908735053b8 10.2.1.209:6380
   replicates 73b3b99bb17de63aa99eaf592376f0a06feb3d66
M: 2fd97e8842828dba6b425b6a30e764fb06915737 10.2.1.15:6379
   slots:10923-16383 (5461 slots) master
S: c46db592d49bc1e9d8b5efb27b9799929c5186a4 10.2.1.15:6380
   replicates 2fd97e8842828dba6b425b6a30e764fb06915737
Can I set the above configuration? (type 'yes' to accept): yes
>>> Nodes configuration updated
>>> Assign a different config epoch to each node
>>> Sending CLUSTER MEET messages to join the cluster
Waiting for the cluster to join...........................................................................^C/usr/local/bin/redis-trib.rb:652:in `sleep': Interrupt
        from /usr/local/bin/redis-trib.rb:652:in `wait_cluster_join'
        from /usr/local/bin/redis-trib.rb:1305:in `create_cluster_cmd'
        from /usr/local/bin/redis-trib.rb:1695:in `<main>'

推荐答案

发件人the cluster tutorial on the official Redis website

我使用的是aws,但没有打开端口16379和16380,这两个端口是导致此问题的原因。

这篇关于如何解决Redis群集&等待群集加入的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 03:13