[ERR] Node 192.168.4.57:6357 is not empty. Either the node already knows other nodes (check with CLU

原因主要是原有的添加在redis配置中,没有进行重置之前的配置

[root@host57 ~]# redis-cli -h 192.168.4.57 -p 6357 
192.168.4.57:6357> CLUSTER RESET
OK
192.168.4.57:6357> cluster info
cluster_state:fail
cluster_slots_assigned:0
cluster_slots_ok:0
cluster_slots_pfail:0
cluster_slots_fail:0
cluster_known_nodes:1
cluster_size:0
cluster_current_epoch:9
cluster_my_epoch:8
cluster_stats_messages_ping_sent:32
cluster_stats_messages_pong_sent:7
cluster_stats_messages_sent:39
cluster_stats_messages_ping_received:7
cluster_stats_messages_pong_received:32
cluster_stats_messages_received:39


管理服务器
[root@51 ~]# redis-trib.rb add-node   192.168.4.57:6357  192.168.4.51:6351
>>> Adding node 192.168.4.57:6357 to cluster 192.168.4.51:6351
>>> Performing Cluster Check (using node 192.168.4.51:6351)
M: b00bfb1d93247f56719582e8b9865ae374e17c33 192.168.4.51:6351
   slots:1365-5460 (4096 slots) master
   1 additional replica(s)
S: 2f002d4ec870d72d2f966c6051a586c57cff1afa 192.168.4.52:6352
   slots: (0 slots) slave
   replicates 20b20d6ddf38a67e8f81bb7badec220bf2be7b3a
M: 20b20d6ddf38a67e8f81bb7badec220bf2be7b3a 192.168.4.56:6356
   slots:6827-10922 (4096 slots) master
   1 additional replica(s)
S: 0ba5e235aa72f9ea10ed8f7da1a60caefc9b9b6c 192.168.4.55:6355
   slots: (0 slots) slave
   replicates b00bfb1d93247f56719582e8b9865ae374e17c33
M: 45f61b35eaf179a4b161008b79c54122617048ee 192.168.4.53:6353
   slots:0-1364,5461-6826,10923-16383 (8192 slots) master
   1 additional replica(s)
S: 9672778d5a8c6685daa7339df325d93f6c73b6bd 192.168.4.54:6354
   slots: (0 slots) slave
   replicates 45f61b35eaf179a4b161008b79c54122617048ee
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.
>>> Send CLUSTER MEET to node 192.168.4.57:6357 to make it join the cluster.
[OK] New node added correctly.


[root@51 ~]# redis-trib.rb check 192.168.4.51:6351
>>> Performing Cluster Check (using node 192.168.4.51:6351)
M: b00bfb1d93247f56719582e8b9865ae374e17c33 192.168.4.51:6351
   slots:1365-5460 (4096 slots) master
   1 additional replica(s)
M: 6df9172d2b03bf298dc7342acdcf1b385f367aba 192.168.4.57:6357
   slots: (0 slots) master
   0 additional replica(s)
S: 2f002d4ec870d72d2f966c6051a586c57cff1afa 192.168.4.52:6352
   slots: (0 slots) slave
   replicates 20b20d6ddf38a67e8f81bb7badec220bf2be7b3a
M: 20b20d6ddf38a67e8f81bb7badec220bf2be7b3a 192.168.4.56:6356
   slots:6827-10922 (4096 slots) master
   1 additional replica(s)
S: 0ba5e235aa72f9ea10ed8f7da1a60caefc9b9b6c 192.168.4.55:6355
   slots: (0 slots) slave
   replicates b00bfb1d93247f56719582e8b9865ae374e17c33
M: 45f61b35eaf179a4b161008b79c54122617048ee 192.168.4.53:6353
   slots:0-1364,5461-6826,10923-16383 (8192 slots) master
   1 additional replica(s)
S: 9672778d5a8c6685daa7339df325d93f6c73b6bd 192.168.4.54:6354
   slots: (0 slots) slave
   replicates 45f61b35eaf179a4b161008b79c54122617048ee
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.






[root@host57 ~]# redis-cli -h 192.168.4.57 -p 6357 
192.168.4.57:6357> CLUSTER RESET
OK


192.168.4.57:6357> cluster info
cluster_state:ok
cluster_slots_assigned:16384
cluster_slots_ok:16384
cluster_slots_pfail:0
cluster_slots_fail:0
cluster_known_nodes:7
cluster_size:3
cluster_current_epoch:9
cluster_my_epoch:8
cluster_stats_messages_ping_sent:1230
cluster_stats_messages_pong_sent:587
cluster_stats_messages_meet_sent:6
cluster_stats_messages_sent:1823
cluster_stats_messages_ping_received:587
cluster_stats_messages_pong_received:1236
cluster_stats_messages_received:1823

把移除的主机在此添加到原有的集群中

[root@host57 ~]# redis-cli -h 192.168.4.57 -p 6357 
192.168.4.57:6357> CLUSTER RESET
OK
192.168.4.57:6357> cluster info
cluster_state:fail
cluster_slots_assigned:0
cluster_slots_ok:0
cluster_slots_pfail:0
cluster_slots_fail:0
cluster_known_nodes:1
cluster_size:0
cluster_current_epoch:9
cluster_my_epoch:8
cluster_stats_messages_ping_sent:32
cluster_stats_messages_pong_sent:7
cluster_stats_messages_sent:39
cluster_stats_messages_ping_received:7
cluster_stats_messages_pong_received:32
cluster_stats_messages_received:39


管理服务器
[root@51 ~]# redis-trib.rb add-node   192.168.4.57:6357  192.168.4.51:6351
>>> Adding node 192.168.4.57:6357 to cluster 192.168.4.51:6351
>>> Performing Cluster Check (using node 192.168.4.51:6351)
M: b00bfb1d93247f56719582e8b9865ae374e17c33 192.168.4.51:6351
   slots:1365-5460 (4096 slots) master
   1 additional replica(s)
S: 2f002d4ec870d72d2f966c6051a586c57cff1afa 192.168.4.52:6352
   slots: (0 slots) slave
   replicates 20b20d6ddf38a67e8f81bb7badec220bf2be7b3a
M: 20b20d6ddf38a67e8f81bb7badec220bf2be7b3a 192.168.4.56:6356
   slots:6827-10922 (4096 slots) master
   1 additional replica(s)
S: 0ba5e235aa72f9ea10ed8f7da1a60caefc9b9b6c 192.168.4.55:6355
   slots: (0 slots) slave
   replicates b00bfb1d93247f56719582e8b9865ae374e17c33
M: 45f61b35eaf179a4b161008b79c54122617048ee 192.168.4.53:6353
   slots:0-1364,5461-6826,10923-16383 (8192 slots) master
   1 additional replica(s)
S: 9672778d5a8c6685daa7339df325d93f6c73b6bd 192.168.4.54:6354
   slots: (0 slots) slave
   replicates 45f61b35eaf179a4b161008b79c54122617048ee
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.
>>> Send CLUSTER MEET to node 192.168.4.57:6357 to make it join the cluster.
[OK] New node added correctly.


[root@51 ~]# redis-trib.rb check 192.168.4.51:6351
>>> Performing Cluster Check (using node 192.168.4.51:6351)
M: b00bfb1d93247f56719582e8b9865ae374e17c33 192.168.4.51:6351
   slots:1365-5460 (4096 slots) master
   1 additional replica(s)
M: 6df9172d2b03bf298dc7342acdcf1b385f367aba 192.168.4.57:6357
   slots: (0 slots) master
   0 additional replica(s)
S: 2f002d4ec870d72d2f966c6051a586c57cff1afa 192.168.4.52:6352
   slots: (0 slots) slave
   replicates 20b20d6ddf38a67e8f81bb7badec220bf2be7b3a
M: 20b20d6ddf38a67e8f81bb7badec220bf2be7b3a 192.168.4.56:6356
   slots:6827-10922 (4096 slots) master
   1 additional replica(s)
S: 0ba5e235aa72f9ea10ed8f7da1a60caefc9b9b6c 192.168.4.55:6355
   slots: (0 slots) slave
   replicates b00bfb1d93247f56719582e8b9865ae374e17c33
M: 45f61b35eaf179a4b161008b79c54122617048ee 192.168.4.53:6353
   slots:0-1364,5461-6826,10923-16383 (8192 slots) master
   1 additional replica(s)
S: 9672778d5a8c6685daa7339df325d93f6c73b6bd 192.168.4.54:6354
   slots: (0 slots) slave
   replicates 45f61b35eaf179a4b161008b79c54122617048ee
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.






[root@host57 ~]# redis-cli -h 192.168.4.57 -p 6357 
192.168.4.57:6357> CLUSTER RESET
OK


192.168.4.57:6357> cluster info
cluster_state:ok
cluster_slots_assigned:16384
cluster_slots_ok:16384
cluster_slots_pfail:0
cluster_slots_fail:0
cluster_known_nodes:7
cluster_size:3
cluster_current_epoch:9
cluster_my_epoch:8
cluster_stats_messages_ping_sent:1230
cluster_stats_messages_pong_sent:587
cluster_stats_messages_meet_sent:6
cluster_stats_messages_sent:1823
cluster_stats_messages_ping_received:587
cluster_stats_messages_pong_received:1236
cluster_stats_messages_received:1823
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
根据你提供的命令,使用redis-cli创建Redis集群时出现了两个问题。 第一个问题是关于密码的警告信息:`Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.` 这个警告表示在命令行接口上使用密码选项 `-a` 可能不安全。为了更安全地传递密码,你可以使用Redis配置文件或者环境变量来指定密码。 第二个问题是关于节点 `10.17.75.221:16379` 的错误信息:`[ERR] Node 10.17.75.221:16379 is not empty. Either the node already knows other nodes (check with CLUSTER NODES) or contains some key in database 0.` 这个错误表示节点 `10.17.75.221:16379` 不为空,可能已经知道其他节点或者在数据库0中包含一些键。 为了解决这些问题,你可以尝试以下步骤: 1. 避免在命令行接口上直接传递密码。你可以在Redis配置文件中设置密码,或者通过环境变量来传递密码。 2. 在继续创建集群之前,确保节点 `10.17.75.221:16379` 是一个空节点。你可以使用以下命令检查节点的状态: ``` ./src/redis-cli -a <password> -h 10.17.75.221 -p 16379 CLUSTER NODES ``` 这将显示节点的状态信息。如果该节点已经知道其他节点或者在数据库0中包含键,你需要清空节点或者选择一个空节点来创建集群。 如果该节点是一个新节点并且没有包含任何键,你可以尝试移除该节点的数据文件,然后再次尝试创建集群。 请注意,以上步骤可能需要一定的技术知识和操作权限。如果你不确定如何执行这些步骤,建议联系Redis管理员或者查阅相关文档以获取更多帮助和支持。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值