1.1.1 无法启动redis-server
【原因分析】:
检查配置文件,可能有参数配置出错。
[root@centos7 ~]# vim /usr/local/redis/conf/redis.conf bind 10.0.0.0/24 # 错误写法 改为 bind 10.0.0.0 dir "./data" # 需要已经存在data目录,否则出错 改为 dir "/usr/local/redis/data"
1.1.2 can't connect to node
【问题现象】:
[root@centos7 ~]# redis-trib.rb add-node 10.0.0.103:7005 10.0.0.103:7000 [ERR] Sorry, can't connect to node 10.0.0.103:7005
【原因分析】:
实例未开启或崩溃。
【解决办法】:
[root@centos7 ~]# redis-server /usr/local/redis/conf/redis_7005.conf
1.1.3 the node already knows other nodes or contains some key in database 0.
【问题现象】:
[root@centos7 ~]# redis-trib.rb add-node 10.0.0.103:7005 10.0.0.103:7000 [ERR] Node 10.0.0.103:7005 is not empty. Either the node already knows other nodes (check with CLUSTER NODES) or contains some key in database 0.
【原因分析】:
已加入集群的机器宕机后重新加入集群需要先删除节点配置文件才可以重新加入集群。
【解决办法】:
[root@centos7 ~]# rm -f /usr/local/redis/data/7005/nodes.conf [root@centos7 ~]# redis-server /usr/local/redis/conf/redis_7005.conf [root@centos7 ~]# redis-trib.rb add-node 10.0.0.103:7005 10.0.0.103:7000

我的微信
如果有技术上的问题可以扫一扫我的微信