Skip to main content

redis cluster

· One min read

拉代码

git clone https://github.com/redis/redis.git
cd redis/
## 带上调试信息
make CFLAGS="-g -O0"
## 创建一个目录
mkdir rediscluster
mkdir 7000 7001 7002 7003 7004 7005

创建几个节点胡配置

tree
.
├── 7000
├── 7001
├── 7002
├── 7003
├── 7004
└── 7005

然后像这样启动6个:

src/redis-server rediscluster/7001/redis.conf

主动下线是一个命令

CLUSTER FAILOVER

相关阅读