简体   繁体   English

在Redis Cluster中将数据从从服务器迁移到主服务器

[英]Migration of data from slave to master in Redis Cluster

I'm currently exploring Redis cluster. 我目前正在探索Redis集群。 I've started 6 instances on 3 physical servers(3 master and 3 slaves) with persistence enabled. 我已经在3个物理服务器(3个主服务器和3个从属服务器)上启用了持久性,开始了6个实例。

I've noticed that when I kill one of the master instances then it's slave is promoted to master after some time. 我注意到,当我杀死一个主实例时,它的从属将在一段时间后提升为主。 However, it remains as master even when I start the killed instance. 但是,即使我启动被杀死的实例,它也remains as master

Since, Redis does asynchronous replication, therefore, I was thinking of a scenario where the master, immediately after flushing the data is killed ie it wasn't able to replicate that data . 由于Redis进行异步复制,因此,我想到了这样一种情况,即在刷新数据后立即将主服务器杀死,即it wasn't able to replicate that data

Will this data get replicated to the new master(initially slave), once the instance comes back up? 实例恢复后,此数据是否会复制到新的主服务器(最初是从服务器)上?

NO. 没有。 If the master haven't replicate data to slave, the data will be lost. 如果主服务器尚未将数据复制到从服务器,则数据将丢失。 When the old master recovers, it will be become a slave of some other node based on some rules . 当旧的主机恢复后,它将根据某些规则成为其他节点的从机。 Then the old master will replicate data from its new master. 然后,旧的主服务器将从其新的主服务器复制数据。

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

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