如何解决Redis群集&等待群集加入的问题? [英] How to solve redis cluster "Waiting for the cluster to join" issue?

查看:114
本文介绍了如何解决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

每个Redis群集节点都需要打开两个TCP连接。正常的 用于服务客户端的Redis TCP端口,例如6379,外加端口 数据端口加10000,本例中为16379。

第二个端口用于群集总线,即 使用二进制协议的节点到节点通信信道。这个 节点使用群集总线进行故障检测、配置 更新、故障转移授权等。客户端不应尝试 与群集总线端口通信,但始终使用正常 Redis命令端口,但是请确保在中打开了这两个端口 防火墙,否则Redis群集节点将无法 通信。

命令端口和群集总线端口偏移量是固定的,并且始终是 10000。

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

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆