-1

尝试在通过 LAN 连接的 3 台不同服务器上的 3 个节点之间创建 Redis 集群。

都试过了

- src/redis-trib.rb create 192.168.148.20:6379 192.168.131.213:6379 192.168.142.199:6379

- src/redis-trib.rb create 192.168.148.20:7000 192.168.131.213:7000 192.168.142.199:7000
Each server has its config file

/etc/redis/redis.conf
nodes.conf

端口 6379 和 16379 是开放列表。

结果是一样的:

root@localhost:~/build/redis-3.2.9# sudo src/redis-trib.rb create 192.168.148.20:6379 192.168.131.213:6379 192.168.142.199:6379

Creating cluster

Performing hash slots allocation on 3 nodes...

Using 3 masters:<br>
192.168.148.20:6379<br>
192.168.131.213:6379<br>
192.168.142.199:6379<br>
M: 2ef7f215c073d0e088ccf19a7b9038e26ba8e235 192.168.148.20:6379
slots:0-5460 (5461 slots) master<br>
M: 15016bba6c48f2e3957be95fb28b2e9c4f08d5b3 192.168.131.213:6379
slots:5461-10922 (5462 slots) master<br>
M: 069db7c66ef3bc38955786422c6697c3b30163e2 192.168.142.199:6379
slots:10923-16383 (5461 slots) master<br>
Can I set the above configuration? (type 'yes' to accept): yes<br>
Nodes configuration updated<br>
Assign a different config epoch to each node<br>
Sending CLUSTER MEET messages to join the cluster<br>
Waiting for the cluster to join..................................................................................... .................................................................................................................... .................................................................................................................... .................................................................................................................... .................................................................................................................... .................................................................................................................... .................................................................................................................... .................................................................................................................... .................................................................................................................... .................................................................................................................... .................................................................................................................... .................................................................................................................... .................................................................................................................... .................................................................................................................... ..................................................................^C<br>
src/redis-trib.rb:653:in sleep': Interrupt from src/redis-trib.rb:653:inwait_cluster_join'<br>
from src/redis-trib.rb:1306:in create_cluster_cmd' from src/redis-trib.rb:1701:in<br>
4

1 回答 1

0

确保每个节点的通信端口(10000+客户端端口)都可以被其他节点访问。

$ sudo ufw 允许从 [其他节点 ip] 到任何端口 [节点通信端口]

于 2018-01-03T08:30:09.117 回答