Skip to content

Commit ed038e2

Browse files
authored
Add english version of CMS docs (#4272)
1 parent c302505 commit ed038e2

File tree

7 files changed

+128
-28
lines changed

7 files changed

+128
-28
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Maintenance without downtime
2+
3+
A {{ ydb-short-name }} cluster periodically needs maintenance, such as upgrading its version or replacing broken disks. Maintenance can cause a cluster or its databases to become unavailable due to:
4+
- Going beyond the expectations of the affected [storage groups](../../concepts/databases.md#storage-groups) failure model.
5+
- Going beyond the expectations of the [State Storage](../../deploy/configuration/config.md#domains-state) failure model.
6+
- Lack of computational resources due to stopping too many [dynamic nodes](../../concepts/cluster/common_scheme_ydb.md#nodes).
7+
8+
To avoid such situations, {{ ydb-short-name }} has a system [tablet](../../concepts/cluster/common_scheme_ydb.md#tablets) that monitors the state of the cluster - the *Cluster Management System (CMS)*. The CMS allows you to answer the question of whether a {{ ydb-short-name }} node or host running {{ ydb-short-name }} nodes can be safely taken out for maintenance. To do this, create a [maintenance task](#maintenance-task) in the CMS and specify in it to acquire exclusive locks on the nodes or hosts that will be involved in the maintenance. The cluster components on which the locks are acquired are considered unavailable from the CMS perspective and can be safely engaged in maintenance. The CMS will [check](#checking-algorithm) the current state of the cluster and acquire locks only if the maintenance complies with the [availability mode](#availability-mode) and [unavailable node limits](#unavailable-node-limits).
9+
10+
{% note warning "Failures during maintenance" %}
11+
12+
During maintenance activities whose safety is guaranteed by the CMS, failures unrelated to those activities may occur in the cluster. If the failures threaten the cluster's availability, urgently aborting the maintenance can help mitigate the risk of cluster downtime.
13+
14+
{% endnote %}
15+
16+
## Maintenance task {#maintenance-task}
17+
18+
A *maintenance task* is a set of *actions* that the user asks the CMS to perform for safe maintenance.
19+
20+
Supported actions:
21+
- Acquiring an exclusive lock on a cluster component (node or host).
22+
23+
Actions in a task are divided into groups. Actions from the same group are performed atomically. Currently, groups can consist of only one action.
24+
25+
If an action cannot be performed at the time of the request, the CMS informs you of the reason and time it is worth *refreshing* the task and sets the action status to *pending*. When the task is refreshed, the CMS attempts to perform the pending actions again.
26+
27+
*Performed* actions have a deadline after which they are considered *completed* and stop affecting the cluster. For example, an exclusive lock is released. An action can be completed early.
28+
29+
{% note info "Protracted maintenance" %}
30+
31+
If maintenance continues after the actions performed to make it safe have been completed, this is considered a failure in the cluster.
32+
33+
{% endnote %}
34+
35+
Completed actions are automatically removed from the task.
36+
37+
### Availability mode {#availability-mode}
38+
39+
In a maintenance task, you need to specify the cluster's availability mode to comply with when checking whether actions can be performed. The following modes are supported:
40+
- **Strong**: a mode that minimizes the risk of availability loss.
41+
- No more than one unavailable [VDisk](../../concepts/cluster/distributed_storage.md#storage-groups) is allowed in each affected storage group.
42+
- No more than one unavailable State Storage ring is allowed.
43+
- **Weak**: a mode that does not allow exceeding the failure model.
44+
- For affected storage groups with the [block-4-2](../../deploy/configuration/config.md#reliability) scheme, no more than two unavailable VDisks are allowed.
45+
- For affected storage groups with the [mirror-3-dc](../../deploy/configuration/config.md#reliability) scheme, up to four unavailable VDisks are allowed, three of which must be in the same data center.
46+
- No more than `(nto_select - 1) / 2` unavailable State Storage rings are allowed.
47+
- **Force**: a forced mode, the failure model is ignored. *Not recommended for use.*
48+
49+
### Priority {#priority}
50+
51+
You can specify the priority of a maintenance task. A lower value means a higher priority.
52+
53+
The task's actions cannot be performed until all conflicting actions from tasks with a higher priority are completed. Tasks with the same priority have no advantage over each other.
54+
55+
## Unavailable node limits {#unavailable-node-limits}
56+
57+
In the CMS configuration, you can configure limits on the number of unavailable nodes for a database (tenant) or the cluster as a whole. Relative and absolute limits are supported.
58+
59+
By default, each database and the cluster as a whole are allowed to have no more than 10% unavailable nodes.
60+
61+
## Checking algorithm {#checking-algorithm}
62+
63+
To check if the actions of a maintenance task can be performed, the CMS sequentially goes through each action group in the task and checks the action from the group:
64+
- If the action's object is a host, the CMS checks whether the action can be performed with all nodes running on the host.
65+
- If the action's object is a node, the CMS checks:
66+
- Whether there is a lock on the node.
67+
- Whether it's possible to lock the node according to the limits of unavailable nodes.
68+
- Whether it's possible to lock all VDisks of the node according to the availability mode.
69+
- Whether it's possible to lock the State Storage ring of the node according to the availability mode.
70+
- Whether it's possible to lock the node according to the limit of unavailable nodes on which cluster system tablets can run.
71+
72+
The action can be performed if the checks are successful, and temporary locks are acquired on the checked nodes. The CMS then considers the next group of actions. Temporary locks help to understand whether the actions requested in different groups conflict with each other. Once the check is complete, the temporary locks are released.
73+
74+
## Examples {#examples}
75+
76+
The [ydbops](https://github.com/ydb-platform/ydbops) utility tool uses CMS for cluster maintenance without downtime. You can also use the CMS directly through the [gRPC API](https://github.com/ydb-platform/ydb/blob/main/ydb/public/api/grpc/draft/ydb_maintenance_v1.proto).
77+
78+
### Rolling restart {##rolling-restart}
79+
80+
To perform a rolling restart of the entire cluster, you can use the command:
81+
```
82+
$ ydbops restart --endpoint grpc://<cluster-fqdn> --availability-mode strong
83+
```
84+
If your systemd unit name is different from the default one, you may need to override it with `--systemd-unit` flag.
85+
86+
The `ydbops` utility will automatically create a maintenance task to restart the entire cluster using the given availability mode. As it progresses, the `ydbops` will refresh the maintenance task and acquire exclusive locks on the nodes in the CMS until all nodes are restarted.
87+
88+
### Take out a node for maintenance {#node-maintenance}
89+
90+
{% note info "Functionality in development" %}
91+
92+
Functionality is expected in upcoming versions of the `ydbops`.
93+
94+
{% endnote %}
95+
96+
To take out a node for maintenance, you can use the `ydbops` utility. When taking a node out, the `ydbops` will acquire an exclusive lock on this node in CMS.

ydb/docs/en/core/devops/manual/toc_p.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ items:
2323
href: ../../maintenance/manual/cms.md
2424
- name: System views
2525
href: system-views.md
26+
- name: Maintenance without downtime
27+
href: maintenance-without-downtime.md
2628

ydb/docs/en/core/maintenance/toc_i.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ items:
1111
include: { mode: link, path: manual/toc_p.yaml }
1212
- name: Changing an actor system's configuration
1313
href: manual/change_actorsystem_configs.md
14+
- name: Maintenance without downtime
15+
href: manual/maintenance-without-downtime.md
1416
- name: Updating configurations via CMS
1517
href: manual/cms.md

ydb/docs/ru/core/maintenance/maintenance-without-outages.md renamed to ydb/docs/ru/core/devops/manual/maintenance-without-downtime.md

+24-26
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Обслуживание кластера без потери доступности
22

33
Периодически кластер {{ ydb-short-name }} необходимо обслуживать, например, обновлять его версию или заменять сломавшиеся диски. Работы по обслуживанию могут привести к недоступности кластера или имеющихся баз данных из-за:
4-
- Превышения модели отказа затронутых [групп хранения](../concepts/databases.md#storage-groups).
5-
- Превышения модели отказа [State Storage](../deploy/configuration/config.md#domains-state).
6-
- Недостатка вычислительных ресурсов вследствие остановки слишком большого количества [динамических узлов](../concepts/cluster/common_scheme_ydb.md#nodes).
4+
- Превышения модели отказа затронутых [групп хранения](../../concepts/databases.md#storage-groups).
5+
- Превышения модели отказа [State Storage](../../deploy/configuration/config.md#domains-state).
6+
- Недостатка вычислительных ресурсов вследствие остановки слишком большого количества [динамических узлов](../../concepts/cluster/common_scheme_ydb.md#nodes).
77

8-
Для избежания таких ситуаций в {{ ydb-short-name }} есть системная [таблетка](../concepts/cluster/common_scheme_ydb.md#tablets), которая следит за состоянием кластера — *Cluster Management System (CMS)*. CMS позволяет ответить на вопрос можно ли безопасно вывести в обслуживание узел {{ ydb-short-name }} или хост, на котором работают узлы {{ ydb-short-name }}. Для этого необходимо создать [задачу обслуживания](#maintenance-task) в CMS и указать в ней взятие эксклюзивных блокировок на узлы или хосты, которые будут задействованы в обслуживании. Компоненты кластера, на которые взяты блокировки, считаются недоступными с точки зрения CMS, и их можно безопасно обслуживать. CMS [проверит](#check-task-actions-algorithm) текущее состояние кластера и возьмет блокировки, только если работы по обслуживанию соответствуют ограничениям [режима доступности](#availability-mode) и [лимитам недоступных узлов](#unavailable-node-limits).
8+
Для избежания таких ситуаций в {{ ydb-short-name }} есть системная [таблетка](../../concepts/cluster/common_scheme_ydb.md#tablets), которая следит за состоянием кластера — *Cluster Management System (CMS)*. CMS позволяет ответить на вопрос можно ли безопасно вывести в обслуживание узел {{ ydb-short-name }} или хост, на котором работают узлы {{ ydb-short-name }}. Для этого необходимо создать [задачу обслуживания](#maintenance-task) в CMS и указать в ней взятие эксклюзивных блокировок на узлы или хосты, которые будут задействованы в обслуживании. Компоненты кластера, на которые взяты блокировки, считаются недоступными с точки зрения CMS, и их можно безопасно обслуживать. CMS [проверит](#checking-algorithm) текущее состояние кластера и возьмет блокировки, только если работы по обслуживанию соответствуют ограничениям [режима доступности](#availability-mode) и [лимитам недоступных узлов](#unavailable-node-limits).
99

1010
{% note warning "Поломки во время проведения работ" %}
1111

@@ -18,7 +18,7 @@
1818
*Задача обслуживания* представляет собой набор *действий*, которые пользователь просит выполнить CMS для возможности проведения безопасного обслуживания.
1919

2020
Поддерживаемые действия:
21-
- Взятие эксклюзивной блокировки на компонент кластера узел или хост.
21+
- Взятие эксклюзивной блокировки на компонент кластера (узел или хост).
2222

2323
В задаче действия делятся на группы. Действия из одной группы выполняются атомарно. На данный момент группы могут состоять только из одного действия.
2424

@@ -37,14 +37,14 @@
3737
### Режим доступности {#availability-mode}
3838

3939
В задаче обслуживания необходимо указать режим доступности кластера, который должен соблюдаться при проверке возможности выполнения действий. Поддерживаются следующие режимы:
40-
- **Strong** режим, минимизирующий риск потери доступности.
41-
- Допускается не более одного недоступного [VDisk](../concepts/cluster/distributed_storage.md#storage-groups) в каждой из затрагиваемых групп хранения.
40+
- **Strong**: режим, минимизирующий риск потери доступности.
41+
- Допускается не более одного недоступного [VDisk](../../concepts/cluster/distributed_storage.md#storage-groups) в каждой из затрагиваемых групп хранения.
4242
- Допускается не более одного недоступного кольца State Storage.
43-
- **Weak** режим, не позволяющий превысить модель отказа.
44-
- Допускается не более двух недоступных VDisk-ов для затрагиваемых групп хранения со схемой [block-4-2](../administration/production-storage-config.md#reliability).
45-
- Допускается не более четырех недоступных VDisk-ов, три из которых должны находиться в одном датацентре, для затрагиваемых групп хранения со схемой [mirror-3-dc](../administration/production-storage-config.md#reliability).
43+
- **Weak**: режим, не позволяющий превысить модель отказа.
44+
- Допускается не более двух недоступных VDisk-ов для затрагиваемых групп хранения со схемой [block-4-2](../../deploy/configuration/config.md#reliability).
45+
- Допускается не более четырех недоступных VDisk-ов, три из которых должны находиться в одном датацентре, для затрагиваемых групп хранения со схемой [mirror-3-dc](../../deploy/configuration/config.md#reliability).
4646
- Допускается не более `(nto_select - 1) / 2` недоступных колец State Storage.
47-
- **Force**принудительный режим, модель отказа игнорируется. Не рекомендуется к использованию.
47+
- **Force**: принудительный режим, модель отказа игнорируется. *Не рекомендуется к использованию*.
4848

4949
### Приоритет {#priority}
5050

@@ -58,7 +58,7 @@
5858

5959
По умолчанию допускается не более 10% недоступных узлов для каждой базы данных и кластера в целом.
6060

61-
## Алгоритм проверки действий задачи {#check-task-actions-algorithm}
61+
## Алгоритм проверки {#checking-algorithm}
6262

6363
Для того, чтобы проверить можно ли выполнить действия задачи обслуживания, CMS последовательно идет по каждой группе действий в задаче и проверяет действие из группы:
6464
- Если объектом действия является хост, то CMS проверяет можно ли выполнить действие со всеми узлами, запущенными на хосте.
@@ -75,24 +75,22 @@
7575

7676
Утилита [ydbops](https://github.com/ydb-platform/ydbops) использует CMS для проведения обслуживания кластера без потери доступности. Также CMS можно использовать напрямую через [gRPC API](https://github.com/ydb-platform/ydb/blob/main/ydb/public/api/grpc/draft/ydb_maintenance_v1.proto).
7777

78+
### Rolling restart {#rolling-restart}
79+
80+
Чтобы выполнить rolling restart всего кластера можно воспользоваться командой:
81+
```
82+
$ ydbops restart --endpoint grpc://<cluster-fqdn> --availability-mode strong
83+
```
84+
Если используемое имя systemd unit отличается от стандартного, его можно переопределить с помощью флага `--systemd-unit`.
85+
86+
Утилита `ydbops` автоматически создаст задачу обслуживания на рестарт всего кластера, используя указанный режим доступности. По ходу продвижения `ydbops` будет обновлять задачу обслуживания и получать эксклюзивные блокировки на узлы в CMS, пока все узлы не будут перезапущены.
87+
7888
### Вывести узел для обслуживания {#node-maintenance}
7989

8090
{% note info "Функциональность в разработке" %}
8191

82-
Функциональность ожидается в ближайших версиях ydbops.
92+
Функциональность ожидается в ближайших версиях `ydbops`.
8393

8494
{% endnote %}
8595

86-
Для выведения узла для обслуживания можно воспользоваться командой:
87-
```
88-
$ ydbops node maintenance --host <node_fqdn>
89-
```
90-
При выполнении этой команды ydbops возьмет эксклюзивную блокировку на узел в CMS.
91-
92-
### Rolling restart {#rolling-restart}
93-
94-
Чтобы выполнить rolling restart всего кластера можно воспользоваться командой:
95-
```
96-
$ ydbops restart --endpoint grpc://<cluster-fqdn> --availability-mode strong
97-
```
98-
Утилита ydbops автоматически создаст задачу обслуживания на рестарт всего кластера, используя указанный режим доступности. По ходу продвижения ydbops будет обновлять задачу обслуживания и получать эксклюзивные блокировки на узлы в CMS, пока все узлы не будут перезапущены.
96+
Чтобы вывести узел для обслуживания можно воспользоваться утилитой `ydbops`. При выведении узла `ydbops` возьмет эксклюзивную блокировку на этот узел в CMS.

0 commit comments

Comments
 (0)