redis的3主3从扩容
redis的3主3从扩容
首先添加两个redis
1 |
|
配置步骤:
执行docker exec -it redis-node-1 bash
进入redis-node-1里面
执行redis-cli --cluster add-node 8.142.144.75:6387 8.142.144.75:6381

6387 新加入的节点
6381 相当于6387的领路人
使用redis-cli --cluster check 8.142.144.75:6381
检查

重新分配槽号
redis-cli —cluster reshard IP地址:端口号


在重新加载过程会碰到Do you want to proceed with the proposed reshard plan (yes/no)?
一句话,选择yes就可以

检查集群情况

为主节点6387分配从节点6388
redis-cli —cluster add-node ip:新slave端口 ip:新master端口 —cluster-slave —cluster-master-id 新主机节点ID

检查集群情况

本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 GGLSS!
评论
WalineValine