diff --git a/ydb/docs/en/core/devops/ansible/toc_p.yaml b/ydb/docs/en/core/devops/ansible/toc_p.yaml index b5cf51906031..a8bb0c6d3808 100644 --- a/ydb/docs/en/core/devops/ansible/toc_p.yaml +++ b/ydb/docs/en/core/devops/ansible/toc_p.yaml @@ -7,6 +7,8 @@ items: href: preparing-vms-with-terraform.md - name: Restart href: restart.md +- name: Update config + href: update-config.md - name: Observability include: mode: link diff --git a/ydb/docs/en/core/devops/ansible/update-config.md b/ydb/docs/en/core/devops/ansible/update-config.md new file mode 100644 index 000000000000..2737981662fc --- /dev/null +++ b/ydb/docs/en/core/devops/ansible/update-config.md @@ -0,0 +1,44 @@ +# Updating configuration of {{ ydb-short-name }} clusters deployed with Ansible + +During [initial deployment](initial-deployment.md), the Ansible playbook used the provided config file to create the initial cluster configuration. Technically, it generates two variants of the original config file and deploys them to all hosts via Ansible's mechanism for cross-server file copy. This article explains which options are available to change the cluster's configuration after the initial deployment. + +## Update configuration via Ansible playbook + +[ydb-ansible](https://github.com/ydb-platform/ydb-ansible) repository contains a playbook called `ydb_platform.ydb.update_config` that can be used to update {{ ydb-short-name }} cluster's configuration. Go to the same directory used for the [initial deployment](initial-deployment.md), edit `files/config.yaml` as needed, and then run this playbook: + +```bash +ansible-playbook ydb_platform.ydb.update_config +``` + +The playbook deploys the new version of the config files and then performs a [rolling restart](restart.md). + +### Filter by node type + +Tasks in the `ydb_platform.ydb.update_config` playbook are tagged with node types, so you can use Ansible's tags functionality to filter nodes by their kind. + +These two commands are equivalent and will change the configuration of all storage nodes: + +```bash +ansible-playbook ydb_platform.ydb.update_config --tags storage +ansible-playbook ydb_platform.ydb.update_config --tags static +``` + +These two commands are equivalent and will change the configuration of all database nodes: +```bash +ansible-playbook ydb_platform.ydb.update_config --tags database +ansible-playbook ydb_platform.ydb.update_config --tags dynamic +``` + +### Skip restart + +There's a `no_restart` tag to only deploy the config files and skip the cluster restart. This might be useful if the cluster will be [restarted](restart.md) later manually or as part of some other maintenance tasks. Example: + +```bash +ansible-playbook ydb_platform.ydb.update_config --tags no_restart +``` + +## Dynamic configuration + +{{ ydb-short-name }} has its own configuration management mechanism called [dynamic configuration](../../maintenance/manual/dynamic-config.md). It is agnostic of the chosen cluster deployment method and allows for flexible cluster configuration even in multitenant environments. + +Consider switching to dynamic configuration if manually deploying config files and doing a complete rolling restart on any change is no longer feasible. \ No newline at end of file diff --git a/ydb/docs/ru/core/devops/ansible/toc_p.yaml b/ydb/docs/ru/core/devops/ansible/toc_p.yaml index e70cea929636..6b539bb883eb 100644 --- a/ydb/docs/ru/core/devops/ansible/toc_p.yaml +++ b/ydb/docs/ru/core/devops/ansible/toc_p.yaml @@ -7,6 +7,8 @@ items: href: preparing-vms-with-terraform.md - name: Перезапуск href: restart.md +- name: Обновление конфигурации + href: update-config.md - name: Наблюдаемость include: mode: link diff --git a/ydb/docs/ru/core/devops/ansible/update-config.md b/ydb/docs/ru/core/devops/ansible/update-config.md new file mode 100644 index 000000000000..19885fdd5494 --- /dev/null +++ b/ydb/docs/ru/core/devops/ansible/update-config.md @@ -0,0 +1,44 @@ +# Обновление конфигурации кластеров {{ ydb-short-name }}, развёрнутых с Ansible + +Во время [первоначального развёртывания](initial-deployment.md) Ansible playbook использует предоставленный конфигурационный файл для создания начальной конфигурации кластера. Технически, он генерирует два варианта конфигурационного файла на основе исходного и размещает их на всех хостах через механизм Ansible для копирования файлов между серверами. В этой статье рассматриваются доступные способы для измения онфигурации кластера после первоначального развёртывания. + +## Обновление конфигурации через Ansible playbook + +В репозитории [ydb-ansible](https://github.com/ydb-platform/ydb-ansible) есть playbook под названием `ydb_platform.ydb.update_config`, который можно использовать для обновления конфигурации кластера {{ ydb-short-name }}. Перейдите в ту же директорию, которая использовалась для [первоначального развёртывания](initial-deployment.md) кластера, отредактируйте файл `files/config.yaml` по необходимости и затем запустите этот playbook: + +```bash +ansible-playbook ydb_platform.ydb.update_config +``` + +Этот playbook развернёт новую версию конфигурационных файлов и затем выполнит [постепенную перезагрузку](restart.md) кластера. + +### Фильтрация по типу узла + +Задачи в playbook `ydb_platform.ydb.update_config` помечены типами узлов, поэтому вы можете использовать функциональность тегов Ansible для фильтрации узлов по их типу. + +Эти две команды эквивалентны и изменят конфигурацию всех узлов хранения: + +```bash +ansible-playbook ydb_platform.ydb.update_config --tags storage +ansible-playbook ydb_platform.ydb.update_config --tags static +``` + +Эти две команды эквивалентны и изменят конфигурацию всех узлов баз данных: +```bash +ansible-playbook ydb_platform.ydb.update_config --tags database +ansible-playbook ydb_platform.ydb.update_config --tags dynamic +``` + +### Пропуск перезагрузки + +Также есть тег `no_restart`, который позволяет только обновить конфигурационные файлы и пропустить перезагрузку кластера. Это может быть полезно, если кластер будет [перезагружен](restart.md) позже вручную или в рамках других задач по обслуживанию. Пример запуска: + +```bash +ansible-playbook ydb_platform.ydb.update_config --tags no_restart +``` + +## Динамическая конфигурация + +У {{ ydb-short-name }} есть собственный механизм управления конфигурацией под названием [динамическая конфигурация](../../maintenance/manual/dynamic-config.md). Он не зависит от выбранного метода развёртывания кластера и позволяет гибко настраивать кластер даже в мультиарендных средах. + +Рассмотрите возможность перехода на динамическую конфигурацию, если ручное развёртывание конфигурационных файлов с полной перезагрузкой при любых изменениях больше не приемлемы. \ No newline at end of file