[ERR] Node is not empty. Either the node already knows other nodes (check with C

搭建redis集群整合出现问题:

 

>>> Creating cluster
[ERR] Node 192.168.211.128:6379 is not empty. Either the node already knows other nodes (check with CLUSTER NODES) or contains some key in database 0.
[ERR] Node is not empty. Either the node already knows other nodes (check with C

 

 

 

解决方法:

1)、将需要新增的节点下aof、rdb等本地备份文件删除;同时将新Node的集群配置文件删除,即:删除你redis.conf里面cluster-config-file所在的文件;

我设置的目录存放的备份文件。

[ERR] Node is not empty. Either the node already knows other nodes (check with C

dir就是设置备份文件目录的,如果没设置,在哪文件夹下开启过服务,那个文件夹下就会生成一个dump.rdb.

[ERR] Node is not empty. Either the node already knows other nodes (check with C

2)、再次添加新节点如果还是报错,则登录新Node对数据库进行清除:

192.168.211.128:6379>  flushdb      #清空当前数据库

 

我的是原来节点的数据库内容没有清空,之前三个用来搭建主从复制了,不过清空就好了。

[ERR] Node is not empty. Either the node already knows other nodes (check with C

可以看到三主三从搭建成功。