简体   繁体   English

故障转移后Redis主机后备

[英]Redis master fallback after a failover

We are trying to upgrade our redis/sentinel cluster from 2.8 to 3.2. 我们正在尝试将我们的redis / sentinel集群从2.8升级到3.2。 Upgrade is going to happen under a heavy traffic. 在交通繁忙的情况下,升级将会发生。 No downtime is acceptable for us. 我们不接受停机时间。

Our setup has 6 redis/sentinels (3 sites, 2 servers on each site, each server has one instance of redis and sentinel running). 我们的设置有6个redis / sentinels(3个站点,每个站点2个服务器,每个服务器有一个redis和sentinel运行实例)。 Obviously we have 1 master and 5 slaves. 显然我们有1个主人和5个奴隶。 We plan to upgrade our server one by one leaving our master server as the last one to upgrade. 我们计划逐个升级我们的服务器,将我们的主服务器作为最后一个升级服务器。

By the time we are ready to upgrade our master, all slaves will be running on 3.2 and those slaves are able to sync up with master running on 2.8 当我们准备升级我们的主站时,所有从站将在3.2上运行,并且那些从站能够与运行在2.8上的主站同步
Once we stop our master(2.8) or manually request a failover, a new server (3.2) will become master. 一旦我们停止我们的主服务器(2.8)或手动请求故障转移,新服务器(3.2)将成为主服务器。

We want to keep our old master(2.8) around for a while, to be able to fallback in case if we find any issue with our new setup. 我们想让我们的老主人(2.8)保持一段时间,以便能够在我们的新设置发现任何问题的情况下回退。 Unfortunately an old redis(2.8) slave is not able to sync up with new master (3.2), because of different RDB format. 不幸的是,由于RDB格式不同,旧的redis(2.8)slave无法与新的master(3.2)同步。 We can stop our old server, slave(2.8), but we also want to be able to fallback to 2.8 as a master in case if we find an issue with 3.2. 我们可以停止我们的旧服务器,slave(2.8),但是如果我们发现3.2的问题,我们也希望能够作为主服务器回退到2.8。 Since 2.8 is not able to sync up with 3.2, it would not have any data, thus can not be elected as new master by sentinel. 由于2.8无法与3.2同步,因此不会有任何数据,因此不能被哨兵选为新的主人。

The question is how to fallback from 3.2 to 2.8 without losing any of the data? 问题是如何在不丢失任何数据的情况下从3.2回退到2.8?

I wouldn't recommend keeping a 2.8 node around as a fallback. 我不建议保留2.8节点作为后备。 Like you mentioned, you can't sync 3.2 -> 2.8 so falling back to 2.8 will mean all writes made to 3.2 will be lost. 就像你提到的那样,你不能同步3.2 - > 2.8,所以回落到2.8将意味着所有写入3.2的写入都将丢失。

I would recommend setting up a staging environment that runs 3.2 and do whatever testing you need to do there. 我建议设置一个运行3.2的暂存环境,并做你需要做的任何测试。 Once you are feeling relatively confident about it, take a backup of your production database and go through the migration process. 一旦您对此感到相对自信,请备份生产数据库并完成迁移过程。

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

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