Redis - 手动将所有主人变成主人和奴隶

标签 redis

我有一个由 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/

相关文章:

python - 部分使用 Django

lua 按键访问表元素

mysql - 为 EC2 上的高流量调整 php-fpm、nginx、mysql

python - celery 如何将任务结果存储在redis中

laravel - Redis + Docker : PDOException: could not find driver

go - 使用golang在redis中存储单次使用记录的最佳方法

ruby-on-rails - Sidekiq卡在空闲模式下(Heroku)

redis - 如何使用Redisgraph中的密码查询获取在标签上创建的所有索引

相同变量的 Redis 复制

java - Hibernate 二级缓存使用 redis 用于多个容器