> For the complete documentation index, see [llms.txt](https://kb.pvhostvm.ru/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.pvhostvm.ru/hostvm-vdi/hostvm-vdi-installation-guide/update-guide/update-ha-config-internal-db.md).

# Обновление конфигурации из двух экземпляров брокера со встроенной БД (с репликацией)

1. **Подготовка к обновлению:**

**На мастер-сервере:**

1.1. Проверьте имя используемой базы данных в настройках брокера:

```
# cat /var/server/server/settings.py | grep "'NAME'"
```

Пример вывода:

```
'NAME': 'udsdb', # Or path to database file if using sqlite3.
```

где **udsdb** – имя базы данных брокера.

1.2. Создайте резервную копию БД, выполнив команду:

```
# mysqldump -u root --single-transaction udsdb > backup.sql
```

где **udsdb** – имя базы данных брокера,

**backup.sql** – имя файла резервной копии.

1.3. Скопируйте файл резервной копии на внешний ресурс.

1.4. Сохраните сетевые настройки из файла `/etc/network/interfaces` и имя машины, если их планируется переносить на новую ВМ.

После завершения выключите обе ВМ брокеров VDI.

**2. Развертывание новых версий брокера:**

2.1 Выполните процедуру импорта новой версии ВМ брокера согласно статье ["Установка HOSTVM VDI Broker"](/hostvm-vdi/hostvm-vdi-installation-guide/hostvm-vdi-ova-install.md), до момента авторизации в веб-интерфейсе управления (в двух экземплярах).

2.2 Задайте настройки сети и имена машин от старых версий ВМ брокера, если применимо.

2.3. Выполните перезагрузку обеих виртуальных машин или следующие команды для применения настроек сети:

```
# ifdown <network interface>
# ip addr flush <network interface>
# ifup <network interface>
```

2.4 После завершения базовой настройки на ВМ первого брокера (мастер сервер БД) скопируйте с внешнего ресурса и разверните резервную копию:

```
# systemctl stop uds apache2
# cat backup.sql | /usr/bin/mysql -u root udsdb
# systemctl start uds apache2
```

где **udsdb** – имя базы данных брокера,

**backup.sql** – имя файла резервной копии.

**3. Настройка репликации:**

3.1 Выполните процедуру настройки репликации базы данных между двумя серверами согласно [статье](/hostvm-vdi/hostvm-vdi-installation-guide/high-availability/db-replication/mariadb.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://kb.pvhostvm.ru/hostvm-vdi/hostvm-vdi-installation-guide/update-guide/update-ha-config-internal-db.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
