Redis操作相关错误

一、Redis集群错误

  1、/usr/local/redis/utils/create-cluster/create-cluster create

实际执行的命令: redis-cli –cluster create 127.0.0.1:8001 127.0.0.1:8002 127.0.0.1:8003 127.0.0.1:8004 127.0.0.1:8005 127.0.0.1:8006 –cluster-replicas 1

Unrecognized option or bad number of args for: ‘–cluster’

问题表述:未识别–cluster选项,或者–cluster参数数量错误

2、/usr/local/redis/src/redis-trib.rb create –replicas 1 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005

[WARNING] Some slaves are in the same host as their master

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

问题表述:节点不为空

解决方式:曾经创建过这些集群节点,配置文件存在,数据也存在,删除配置文件和数据,然后重启Redis实例

localhost:~ kendo$ rm -rf /usr/local/var/db/redis/*

 

Leave Comment

电子邮件地址不会被公开。 必填项已用*标注