我有一个由 6 个 master 组成的 redis 集群,我想手动将它变成 3 master 和 3 slave。
这可能吗?
最佳答案
需要先停止redis,再切换主备。
停止slave redis:
[root@localhost redis-2.8.3]# src/redis-cli -n 6379 shutdown
更新slave redis.conf(添加slaveof xxx.xx.xx.xx[master ip] yyyy[master port])
slaveof 192.168.10.1 6379
启动slave redis:
[root@localhost redis-2.8.3]# src/redis-cli -p 6380
另外,您可以将 salve 设置为 master:
[root@localhost redis-2.8.3]# src/redis-cli -p 6380 slaveof NO ONE
关于Redis - 手动将所有主人变成主人和奴隶,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48335365/