2016-09-19 47 views
0

我有3台机器,创造的Redis集群6个节点,我已经创造了它成功个月前,但现在下降了,我尽我所能来解决它​​,但它没有工作,所以我清除所有数据,并从零重新创建它,当我使用下面的命令来创建集群,它阻止在这里,等待节点加入集群,我做一些研究它,清洁我的数据,日志一次又一次,一次又一次地做,但它仍然不起作用。如何解决的Redis集群“等待集群加盟”的问题

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>' 

回答

1

裁判官网 每个Redis的群集节点需要两个TCP连接开放。用于为客户端提供服务的正常Redis TCP端口(例如6379)以及通过将10000添加到数据端口获得的端口,因此示例中为16379。 第二个高端口用于群集总线,即使用二进制协议的节点到节点通信通道。节点使用群集总线进行故障检测,配置更新,故障转移授权等。客户端不应尝试与群集总线端口通信,但始终使用正常的Redis命令端口,但请确保在防火墙中打开两个端口,否则Redis群集节点将无法通信。 命令端口和群集总线端口偏移是固定的,并且始终是10000 注意,对于一个Redis的群集正常工作需要,对每个节点: 用于与客户端通信是正常的客户端通信端口(通常6379)对所有需要到达群集的客户端以及所有其他群集节点(使用客户端端口进行密钥迁移)都是开放的。 集群总线端口(客户端端口+ 10000)必须可从所有其他集群节点访问。 如果您未打开两个TCP端口,则您的群集将无法按预期工作。 群集总线使用不同的,二进制协议,用于节点到节点的数据交换,其更适合于交换使用少量的带宽和处理时间节点之间的信息。 我使用AWS,由于不打开16379 16380口,导致此问题