升级 Redis Software 集群
将集群升级到 Redis Software 的更高版本。
Redis 企业软件 |
---|
在将集群升级到更高版本的 Redis Software 之前,请查看支持的升级路径和先决条件。
要升级集群的 Redis Software 版本,请使用以下方法之一:
-
就地升级 - 直接升级集群中每个节点上的 Redis 软件。尽管此方法比滚动升级方法更简单,但在升级每个节点时,可能会导致短暂的服务中断。
-
滚动升级 – 通过向集群添加具有更新的 Redis Software 版本的新节点(一次一个),同时保持集群的其余部分正常运行,从而最大限度地减少停机时间。对于需要持续可用性的生产环境,建议使用此方法。
支持的升级路径
✅ 支持 – 您可以直接从当前的 Redis Software 集群版本升级。
❌ 不支持 – 您不能直接从当前的 Redis Software 集群版本升级。您必须先升级到受支持的中间版本。
当前 Redis Software 集群版本 | 升级到 Redis 软件 6.2.x | 升级到 Redis 软件 6.4.x | 升级到 Redis 软件 7.2.x | 升级到 Redis 软件 7.4.x | 升级到 Redis 软件 7.8.x |
---|---|---|---|---|---|
6.0.x 版本 | ✅ | ✅ | ✅ | ❌ | ❌ |
6.2.4 6.2.8 |
✅ | ✅ | ✅ | ✅ | ❌ |
6.2.10 6.2.12 6.2.18 |
✅ | ✅ | ✅ | ✅ | ✅ |
6.4.x | – | ✅ | ✅ | ✅ | ✅ |
7.2.x 版本 | – | – | ✅ | ✅ | ✅ |
7.4.x 版本 | – | – | – | ✅ | ✅ |
有关版本号和生命周期终止计划的更多信息,请参阅 Redis Enterprise Software 产品生命周期。
升级先决条件
升级集群前:
-
验证您是否满足目标集群版本的升级路径要求,并查看相关的发行说明以获取任何准备说明。
-
在升级集群之前,请将数据库升级到目标 Redis Enterprise Software 版本支持的版本。如果可能,我们建议您将数据库升级到最新的受支持版本。确保在非生产环境中测试升级以确定任何影响。
-
避免在集群升级过程中更改数据库配置或执行其他集群管理作,因为这可能会导致意外结果。
-
首先升级集群的主(主)节点。要识别主节点,请使用以下方法之一:
-
新集群管理器 UI 中的节点屏幕(仅适用于 Redis Enterprise 版本 7.2 及更高版本)
-
GET /nodes/status
REST API 请求
-
就地升级
从主节点开始,对集群中的每个节点执行以下步骤。为保证集群可用性,请分别升级每个节点。
-
使用以下命令验证节点作:
$ rlcheck $ rladmin status extra all
Warning:Do not proceed if any shard, node, or endpoint is notOK
. -
Download the Redis Enterprise Software installation package to the machine running the node from the Download Center on https://cloud.redis.io.
-
Extract the installation package:
tar vxf <tarfile name>
Note:You cannot change the installation path or the user during the upgrade. -
Run the install command. See installation script options for a list of command-line options you can add to the following command:
sudo ./install.sh
The installation script automatically recognizes the upgrade and responds accordingly.
The upgrade replaces all node processes, which might briefly interrupt any active connections.
-
Verify the node was upgraded to the new version and is still operational:
$ rlcheck $ rladmin status extra all
-
Visit the Cluster Manager UI.
If the Cluster Manager UI was open in a web browser during the upgrade, refresh the browser to reload the console.
Rolling upgrade
To perform a rolling upgrade of the cluster, use one of the following methods:
-
Extra node method - recommended if you have additional resources available
-
Replace node method - recommended if you cannot temporarily allocate additional resources
Extra node upgrade method
-
Install a later version of Redis Software on a new node.
-
Add the new node to the cluster.
-
Promote the first new node to become the primary node.
-
Remove one node running the earlier Redis Software version from the cluster.
-
Repeat the previous steps until all nodes with the earlier Redis Software version are removed. If the final node to remove from the cluster is the primary node, demote it to a secondary node before you remove it.
Replace node upgrade method
-
Remove a node with the earlier Redis Software version from the cluster.
-
Uninstall Redis Enterprise Software from the removed node:
sudo ./rl_uninstall.sh
-
Install a later version of Redis Software on the removed node or a new node.
-
Add the new node to the cluster.
If you want to reuse the removed node's ID when you add the node to the cluster, run rladmin cluster join
with the replace_node
flag:
rladmin cluster join nodes <cluster_member_ip_address> username <username> password <password> replace_node <node_id>
-
Promote the first new node to become the primary node.
-
Verify node health:
-
Run rlcheck
on all nodes:
rlcheck
The output lists the result of each verification test:
##### Welcome to Redis Enterprise Cluster settings verification utility ####
Running test: verify_bootstrap_status
PASS
...
Running test: verify_encrypted_gossip
PASS
Summary:
-------
ALL TESTS PASSED.
For healthy nodes, the expected output is ALL TESTS PASSED
.
-
Run rladmin status
on the new node:
rladmin status extra all
The expected output is the OK
status for the cluster, nodes, endpoints, and shards:
CLUSTER:
OK. Cluster master: 2 (<IP.address>)
Cluster health: OK, [0, 0.0, 0.0]
failures/minute - avg1 0.00, avg15 0.00, avg60 0.00.
...
-
Repeat the previous steps until all nodes with the earlier Redis Software version are replaced. If the final node to remove from the cluster is the primary node, demote it to a secondary node before you remove it.
After cluster upgrade
After all nodes are upgraded, the cluster is fully upgraded. Certain features introduced in the new version of Redis Software only become available after upgrading the entire cluster.
After upgrading from version 6.0.x to 6.2.x, restart cnm_exec
on each cluster node to enable more advanced state machine handling capabilities:
supervisorctl restart cnm_exec
On this page