纯手打,转载请附上本文网址!!!
在redis集群配置的最后一步,使用命令报错[ERR] Node xxx is not empty. Either the node already knows other no...
redis-trib.rb create --replicas 1 192.168.56.102:7001 192.168.56.102:7002 192.168.56.103:7003 192.168.56.103:7004 192.168.56.104:7005 192.168.56.104:7006
这是由于上次redis集群没有配置成功,生成了每个节点的配置文件和db的备份文件,所以才会产生这个错误。
请按如下步骤操作:
1、删除每个redis节点的备份文件,数据库文件和集群配置文件
比如说我有7001~7006 6个节点,那么每个节点中的appendonly.aof、dump.rdb、node_xxx.conf文件都要被删除
2、使用redis-cli -c -h -p登录每个redis节点,使用以下命令
flushdb
cluster reset
3、重启所有的redis服务,再试试redis集群连接命令,应该就没问题了
redis-trib.rb create --replicas 1 192.168.56.102:7001 192.168.56.102:7002 192.168.56.103:7003 192.168.56.103:7004 192.168.56.104:7005 192.168.56.104:7006