大网数据广告活动
服务器运维问答

Setting up multiple redis masters

· 52CE 我爱测

In recent study, I was led to the belief that it is not possible for redis to be setup with multiple masters with each master having 2 slaves. https://github.com/uolter/redis_failover/issues/4#issuecomment-24377513 I was quite ta…

问题原文

原帖链接 · Mark · CC BY-SA 3.0

In recent study, I was led to the belief that it is not possible for redis to be setup with multiple masters with each master having 2 slaves.

https://github.com/uolter/redis_failover/issues/4#issuecomment-24377513

I was quite taken aback by this comment so I decided to ask the community whether it is possible and how people are handling fail overs?

I have heard of the redis-cluster project but it seems like this isn't really stable at the moment so I wasn't daring enough to try this in production.

社区高分解答

原帖链接 · ma.tome · CC BY-SA 3.0

You can deploy as many masters as you want, with any number of slaves each, but they will behave like a single separated cluster with their own memory space, and it will be your responsibility at the application layer to spread your keys properly using each of the masters, just as you would do in a Memcached multi-node deployment.

Also, if you have no Redis Sentinel watching your data nodes, your application will have to take care of the failover process in a per-master basis to promote one of the slaves as master and redirect other slaves to use the new master.

Anyway, a single slave is enough for most use cases, unless you intend to use all of the slaves as read replicas for improved read throughput.

And about Redis-Cluster, well... IMHO, Redis Cluster introduces some penalties (No multi-key operations. no pipelining...) that have a big impact in the typical Redis use case, so you should evaluate it carefully before implementing it.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2013-09-13)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。