【redis集群】Node xxx is not empty 解决方法

[root@localhost redis-6.2.4]# redis-cli --cluster create --cluster-replicas 1 192.168.136.160:7001 192.168.136.160:7002 192.168.136.160:7003 192.168.136.160:8001 192.168.136.160:8002 192.168.136.160:8003
[ERR] Node 192.168.136.160:8001 is not empty. Either the node already knows other nodes (check with CLUSTER NODES) or contains some key in database 0.

今天创建redis集群 胡搞乱搞 一会创建哨兵  一会搞主从  又删除之前的  搞分片,后来出问题了
1.重置对应端口的节点 redis-cli -p 8001 cluster reset

2. 然后重新执行创建集群命令

 redis-cli --cluster create --cluster-replicas 1 192.168.136.160:7001 192.168.136.160:7002 192.168.136.160:7003 192.168.136.160:8001 192.168.136.160:8002 192.168.136.160:8003
3.

今天在redis中执行192.168.136.160:7003> set a 1
(error) MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.

大意为:(错误)misconf redis被配置以保存数据库快照,但misconf redis目前不能在硬盘上持久化。用来修改数据集合的命令不能用,请使用日志的错误详细信息。

这是由于强制停止redis快照,不能持久化引起的,运行info命令查看redis快照的状态,如下:

解决方案如下:

连接redis后运行 config set stop-writes-on-bgsave-error no 命令

关闭配置项stop-writes-on-bgsave-error解决该问题。