redis学习之集群报错Node is not empty
来源:互联网 发布:淘宝虚拟店铺开店条件 编辑:程序博客网 时间:2024/05/05 02:57
写在前面
继上一篇redis3.0.x集群搭建完成之后,当然要用客户端JedisCluster简单测试一下集群啦,这样就要将Redis.conf里bind 127.0.0.1改成bind +真机ip(我的192.168.161.131),下面简单地将测试中遇到的问题及解决办法记录在本篇。
遇到的问题及解决办法
在redis.conf里bind 真机ip后,接着重新执行每个redis.conf,最后再创建集群,但报错,如下图所示:
图中报的错即:
[ERR] Node 192.168.161.131:7000 is not empty. Either the node already knows other nodes (check with CLUSTER NODES) or contains some key in database 0.
这就奇怪了,于是我又去检查了一下redis.conf,ip我确实改过来了
想了一会发现这三个文件appendonly.aof dump.rdb nodes.conf是之前执行ip127.0.0.1时生成的,在我改为真机ip后在执行并没有生效。
这里解释一下dump.rdb文件:
dump.rdb是由Redis服务器自动生成的 默认情况下 每隔一段时间redis服务器程序会自动对数据库做一次遍历,把内存快照写在一个叫做“dump.rdb”的文件里,这个持久化机制叫做SNAPSHOT。有了SNAPSHOT后,如果服务器宕机,重新启动redis服务器程序时redis会自动加载dump.rdb,将数据库状态恢复到上一次做SNAPSHOT时的状态。
知道原因后就好办了,解决办法:
1)将每个节点下aof、rdb、nodes.conf本地备份文件删除;
2)172.168.63.201:7001> flushdb #清空当前数据库(可省略)
3)之后再执行脚本,成功执行;
问题解决了之后就可以成功从Java客户端测试了:
ps:这里大家不要这样测试,可以将其写在配置文件里,我这里是为了方便。
写在最后
其实平时在测试中遇到的很多问题,都可以在网上找到答案,这里只是简单的记录其中的一个。关于关于redis集群的介绍,了解请看 redis中文介绍
- redis学习之集群报错Node is not empty
- redis学习之集群报错Node is not empty
- redis学习之集群报错Node is not empty
- redis学习之集群报错Node is not empty
- Redis系列~集群报错Node is not empty(十九)
- Redis本地搭建伪集群报错Node is not empty
- redis 集群 Node is not empty
- redis 集群 创建报错 [ERR] Node is not empty. Either the node already knows other nodes (check with C
- redis集群新增节点:[ERR] Node is not empty
- redis集群服务器迁移报错[ERR] Node XXX.XXX.XXX.XX:7001 is not empty. Either the nodealready knows other nodes
- 错误信息:[ERR] Node 172.168.63.202:7001 is not empty.
- redis集群报错:clusterdown the cluster is down
- redis集群报错:clusterdown the cluster is down
- redis集群报错
- Redis集群报错
- Magento 报错 connection string is empty
- Queue is not empty
- [ERR] Node is not empty. Either the node already knows other nodes (check with C
- egret中切换皮肤的状态
- Android 如何用支付宝实现支付功能
- springcloud服务已经关但是Eureka还是显示up
- 一个优秀的Java程序员必须了解GC的工作原理
- git把一个新分支内容覆盖到另一个旧分支
- redis学习之集群报错Node is not empty
- 自定义仿IOS底部弹出Dialog
- Python处理Thread的方式start, stop回收
- 2016年终总结,2014-2016最忙碌的一年,敬自己!
- 如何快乐上手DroiBaaS 云代码操作! Oh My God, 怎么会这么简单!
- Redis3.0集群搭建/配置/FAQ
- spring里面事务的传播属性和事务隔离级别
- cookie不同系统间共享
- 修改Android开机图片、动画、声音