【问题标题】:Redis Clustering Waiting for the cluster to join Private VPCRedis Clustering 等待集群加入私有 VPC
【发布时间】:2021-02-15 12:06:26
【问题描述】:

我有 3 个运行 Redis 的 EC2 实例,如下所示:

  • 服务器 001:10.0.1.203,端口:6379
  • 服务器 002:10.0.1.202,端口:6380
  • 服务器 003:10.0.1.190,端口:6381

每一个的配置文件:

# bind 127.0.0.1
protected-mode no
port PORT
pidfile /var/run/redis_PORT.pid
cluster-enabled yes
cluster-config-file nodes-PORT.conf
cluster-node-timeout 15000

我可以通过 redis 连接到每台服务器上的每一个。

但是当我运行集群创建时,脚本永远不会在服务器 001 上结束。

root@ip-10-0-1-203:~/redis-stable# redis-cli --cluster create 10.0.1.203:6379 10.0.1.202:6380 10.0.1.190:6381
>>> Performing hash slots allocation on 3 nodes...
Master[0] -> Slots 0 - 5460
Master[1] -> Slots 5461 - 10922
Master[2] -> Slots 10923 - 16383
M: 4c0b7609e5d906ff58d67ab446bbd9e20833e0db 10.0.1.203:6379
   slots:[0-5460] (5461 slots) master
M: a5dbd72815a1875b58a0cc0fd6a52dc0b76735b7 10.0.1.202:6380
   slots:[5461-10922] (5462 slots) master
M: 14d39c0876a982cadd50f301a3d35715171279c0 10.0.1.190:6381
   slots:[10923-16383] (5461 slots) master
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
....................................................................................................................................................................................................................................................................................................................................

服务器 002 日志:

44119:M 02 Nov 2020 13:30:03.477 * Ready to accept connections
44119:M 02 Nov 2020 13:30:45.362 # configEpoch set to 0 via CLUSTER RESET HARD
44119:M 02 Nov 2020 13:30:45.362 * Node hard reset, now I'm a5dbd72815a1875b58a0cc0fd6a52dc0b76735b7
44119:M 02 Nov 2020 13:30:59.352 # configEpoch set to 2 via CLUSTER SET-CONFIG-EPOCH 

服务器 003 日志:

44033:M 02 Nov 2020 13:30:50.695 # configEpoch set to 0 via CLUSTER RESET HARD
44033:M 02 Nov 2020 13:30:50.695 * Node hard reset, now I'm 14d39c0876a982cadd50f301a3d35715171279c0
44033:M 02 Nov 2020 13:30:59.346 # configEpoch set to 3 via CLUSTER SET-CONFIG-EPOCH

配置中有什么遗漏吗?

【问题讨论】:

    标签: redis redis-cluster redis-cli


    【解决方案1】:

    可能在 EC2 实例上无法访问 Redis 集群端口。

    来自Redis Cluster Specification

    每个 Redis 集群节点都有一个额外的 TCP 端口,用于接收来自其他 Redis 集群节点的传入连接。此端口与用于接收来自客户端的传入连接的普通 TCP 端口有一个固定的偏移量。要获取 Redis Cluster 端口,应在普通命令端口中添加 10000。例如,如果 Redis 节点正在侦听 6379 端口上的客户端连接,则集群总线端口 16379 也将被打开。

    【讨论】:

    • 这是真的!我们忘记打开 16379 所以集群没有因此而添加
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-10-03
    • 1970-01-01
    • 2015-11-21
    • 1970-01-01
    • 2020-05-06
    • 2020-05-24
    • 2020-09-24
    相关资源
    最近更新 更多