使用哨兵升级Redis的最佳实践? [英] Best Practice to Upgrade Redis with Sentinels?
问题描述
我有3个哨兵监视着三个Redis节点.我四处搜寻,关于如何最好地升级这种类型的配置,文档似乎还不清楚.我目前正在使用3.0.6版,并且想升级到最新的5.0.5版.我对此有一些疑问.
I have three redis nodes being watched by 3 sentinels. I've searched around and the documentation seems to be unclear as to how best to upgrade a configuration of this type. I'm currently on version 3.0.6 and I want to upgrade to the latest 5.0.5. I have a few questions on the procedure around this.
-
可以升级两个主要版本吗?我是在我们的暂存环境中执行此操作的,这似乎很好.我们使用了非常基本的redis功能,并且两个版本之间没有重大更改.
Is it ok to upgrade two major versions? I did this in our staging environment and it seemed to be fine. We use pretty basic redis functionality and there are no breaking changes between the versions.
订购重要吗?我应该先说所有哨兵然后再说redis节点,还是应该先确认哨兵飞机在验证redis平面之后是最后一个?我应该一次做一个哨兵节点吗?
Does order matter? Should I upgrade say all the sentinels first and then the redis nodes, or should the sentinel plane be last after verifying the redis plane? Should I do one sentinel/redis node at a time?
任何对此的建议或经验,将不胜感激.
Any advice or experience on this would be appreciated.
推荐答案
我对此缺乏回应感到惊讶,但我知道该主题跨越了诸如stackoverflow之类的东西和诸如堆栈交换之类的东西.我也对缺乏有关该主题的文档感到惊讶.
I am surprised by the lack of response to this, but I understand that the subject kind of straddles something like stackoverflow and something like stack exchange. I'm also surprised at the lack of documentation I was able to find on the subject.
我在登台环境中进行了一些广泛的测试,然后继续进行生产,我遵循的程序在很大程度上似乎是有效的:
I did some extensive testing in a staging environment and then proceeded to our production and the procedure I followed seemed to work for the most part:
-
在我们的案例中,从3.0.6升级到5.0.5似乎很顺利.正如我在原始帖子中所说,我们在redis中使用了基础知识,从客户的角度来看并没有太大变化.
Upgrading from 3.0.6 to 5.0.5 in our case seems to be working without a hitch. As I said in the original post, we use the basics in redis and there hasn't been much changed from the client perspective.
我按此顺序进行升级:
- 前两个哨兵同伴,然后是当前处于<c0>状态的哨兵.
- 每个redis节点均列为
slaves
(现称为replicas
).- 每个节点升级后,它将想要从主节点复制其
dump.rdb
- 可以从3个节点到5个节点进行同步,但是一旦5个节点成为主节点,则3个节点将无法同步,因此一旦故障转移到升级的节点,就无法返回到早期版本.
- 每个节点升级后,它将想要从主节点复制其
- The first two sentinel peers and then the sentinel currently in the
leader
status. - Each of the redis nodes listed as
slaves
(now known asreplicas
).- After each node is upgraded, it will want to copy its
dump.rdb
from the master - A sync can be done to a 5 node from a 3 node, but once a 5 node is the master, a 3 node cannot sync, so once you've failed over to an upgraded node, you can't go back to the earlier version.
- After each node is upgraded, it will want to copy its
希望有人可能会发现这很有用.
Hopefully someone might find this useful going forward.
这篇关于使用哨兵升级Redis的最佳实践?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!