-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Config rolling update strategy for operator (#2660)
* config-rolling-update-strategy-for-operator * change doc title * Update 11.rolling-update-strategy.md * Update 8.2.pv-reclaim.md * Update 11.rolling-update-strategy.md
- Loading branch information
1 parent
6dc6af3
commit 25e9b37
Showing
5 changed files
with
49 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# NebulaGraph 集群的滚动更新策略 | ||
|
||
NebulaGraph 集群使用分布式架构将数据分成多个逻辑分片,这些分片通常均分在不同的节点上。分布式系统中,同一份数据通常会有多个副本。为了保证多个副本数据的一致性,NebulaGraph 集群使用 Raft 协议实现了多分片副本同步。Raft 协议中,每个分片都会选举出一个 Leader 副本,Leader 副本负责处理写请求,Follower 副本负责处理读请求。 | ||
|
||
通过 Operator 创建的 NebulaGraph 集群在滚动更新过程中,一个存储节点会暂时停止提供服务以进行更新。关于滚动更新的概述,参见[执行滚动更新](https://kubernetes.io/zh-cn/docs/tutorials/kubernetes-basics/update/update-intro/)。如果 Leader 副本所在的节点停止提供服务,会导致该分片的读写不可用。为了避免这种情况,Operator 会在 NebulaGraph 集群滚动更新过程中,默认将 Leader 副本迁移到其他未受影响节点上。这样,当一个存储节点处于更新状态时,其他节点上的 Leader 副本能够继续处理客户端请求,以保证集群的读写可用性。 | ||
|
||
一个存储节点上的所有 Leader 副本全部迁移到其他节点的这个过程可能会持续较长时间。为了更好地控制滚动更新的时间,Operator 提供了一个名为`enableForceUpdate`参数。当确定没有外部访问流量时,可将该参数设置为`true`,这样,Leader 副本将不会被迁移到其他节点上,从而加快滚动更新的速度。 | ||
|
||
## 滚动更新触发条件 | ||
|
||
Operator 会在以下情况下触发 NebulaGraph 集群的滚动更新: | ||
|
||
- NebulaGraph 集群的版本发生变化。 | ||
- NebulaGraph 集群的配置发生变化。 | ||
|
||
## 配置滚动更新策略 | ||
|
||
在创建集群实例的 YAML 文件中,添加`spec.storaged.enableForceUpdate`参数,设置为`true`或`false`,以控制滚动更新的速度。 | ||
|
||
当`enableForceUpdate`为`true`时,表示不迁移分片 Leader 副本,从而加快滚动更新的速度;反之,表示迁移分片 Leader 副本,以保证集群的读写可用性。默认值为`false`。 | ||
|
||
!!! caution | ||
|
||
设置`enableForceUpdate`为`true`时,确保没有流量进入集群进行读写操作。因为该设置会强制重建集群 Pod,此过程会发生数据丢失或客户端请求失败的情况。 | ||
|
||
|
||
配置示例: | ||
|
||
```yaml | ||
... | ||
spec: | ||
... | ||
storaged: | ||
enableForceUpdate: true // 设置为 true 时,加快滚动更新的速度。 | ||
... | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters