简体   繁体   English

Redis复制和集群差异

[英]Redis Replication and Cluster difference

Currently my Spring boot application has one redis server. 目前,我的Spring Boot应用程序具有一台Redis服务器。

Now that I want to make the redis server high available , which approach should I follow? 现在,我想使Redis服务器具有高可用性 ,应该采用哪种方法?

For example I would have master, slaves and sentinel set up where if my master goes down automatically new master got elect and application works normal. 例如,我将设置主服务器,从属服务器和哨兵,如果我的主服务器自动关闭,新的主服务器将被选出,应用程序将正常运行。 Does that approch is called replication with automatic failover? 该方法是否称为自动故障转移复制?

On the other hand how does cluster differ from above mentioned (replication) set up . 另一方面,群集与上述(复制)设置有何不同 Does it also has the support of sentinel servers for automatic failover? 它还具有哨兵服务器的自动故障转移支持吗?

And in terms of data, I read, cluster split data among multiple nodes instead relication has the exact copy of data of master in all slaves. 就数据而言,我读取了多个节点之间的集群拆分数据,而在所有从属中,relication均具有master数据的精确副本。 In that case splitting data in multiple nodes of a cluster, would lead to stale data situation if some nodes go down ? 在那种情况下,如果将数据拆分到群集的多个节点中,如果某些节点出现故障,是否会导致数据过时

If you have more data than RAM on a machine, use redis cluster to shard the data across machines. 如果计算机上的数据多于RAM,请使用Redis集群在计算机上分片数据。 Redis cluster supports master-slave replication and failover itself and doesn't need sentinel. Redis集群本身支持主从复制和故障转移,不需要哨兵。 If you have failures with a node, it will keep working until the majority of master nodes fail. 如果某个节点发生故障,它将继续工作,直到大多数主节点发生故障为止。

I you have less data than RAM on a machine, setup a master/slave replication with sentinel in front to handle the failover. 如果您的数据少于一台计算机上的RAM,请在前面设置哨兵以处理故障转移来设置主/从复制。

https://redis.io/topics/cluster-tutorial https://redis.io/topics/cluster-tutorial

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM