Задание 2: Развертывание по умолчанию с помощью Pangolin Installer
В этом разделе мы рассмотрим процесс подготовки и запуска установки системы: установку виртуального окружения, инсталляцию Pangolin Installer, работу с конфигурационным файлом и запуск установки по умолчанию.
Установка виртуального окружения
Для запуска установки Pangolin с помощью Ansible рекомендуется создать виртуальное окружение Python. Создать такое окружение позволяет пакет RPM pangolin-ansible-venv-controller-6.7.0-redos8.0.rpm, который был извлечен из архива в каталоге 3rdparty ранее.
Установим пакет:
[student@srv1 3rdparty]$ sudo rpm -ivh pangolin-ansible-venv-controller-6.7.0-redos8.0.x86_64.rpm
Вывод команды:
Verifying... ################################# [100%]
Подготовка... ################################# [100%]
Обновление / установка...
1:pangolin-ansible-venv-controller-################################# [100%]
Create virtuaenv for /opt/pangolin-ansible-venv-controller
Installing package pip
Processing /opt/pangolin-ansible-venv-controller-tmp/pip-25.3-py3-none-any.whl
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 25.1.1
Uninstalling pip-25.1.1:
Successfully uninstalled pip-25.1.1
Successfully installed pip-25.3
[notice] A new release of pip is available: 25.3 -> 26.0.1
[notice] To update, run: pip install --upgrade pip
Processing /opt/pangolin-ansible-venv-controller-tmp/setuptools-80.9.0-py3-none-any.whl
Installing collected packages: setuptools
Attempting uninstall: setuptools
Found existing installation: setuptools 78.1.1
Uninstalling setuptools-78.1.1:
Successfully uninstalled setuptools-78.1.1
Successfully installed setuptools-80.9.0
[notice] A new release of pip is available: 25.3 -> 26.0.1
[notice] To update, run: pip install --upgrade pip
Processing /opt/pangolin-ansible-venv-controller-tmp/wheel-0.45.1-py3-none-any.whl
Installing collected packages: wheel
Successfully installed wheel-0.45.1
[notice] A new release of pip is available: 25.3 -> 26.0.1
[notice] To update, run: pip install --upgrade pip
Processing /opt/pangolin-ansible-venv-controller-tmp/ansible-4.10.0.tar.gz
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Processing /opt/pangolin-ansible-venv-controller-tmp/ansible-core-2.11.7.tar.gz
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Processing /opt/pangolin-ansible-venv-controller-tmp/cffi-2.0.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Processing /opt/pangolin-ansible-venv-controller-tmp/cryptography-46.0.3-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Processing /opt/pangolin-ansible-venv-controller-tmp/dnspython-2.7.0-py3-none-any.whl
Processing /opt/pangolin-ansible-venv-controller-tmp/jinja2-3.1.6-py3-none-any.whl
Processing /opt/pangolin-ansible-venv-controller-tmp/jmespath-1.0.1-py3-none-any.whl
Processing /opt/pangolin-ansible-venv-controller-tmp/markupsafe-3.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Processing /opt/pangolin-ansible-venv-controller-tmp/netaddr-0.8.0-py2.py3-none-any.whl
Processing /opt/pangolin-ansible-venv-controller-tmp/packaging-25.0-py3-none-any.whl
Processing /opt/pangolin-ansible-venv-controller-tmp/pip-25.3-py3-none-any.whl
Processing /opt/pangolin-ansible-venv-controller-tmp/pycparser-2.23-py3-none-any.whl
Processing /opt/pangolin-ansible-venv-controller-tmp/pyparsing-3.2.1-py3-none-any.whl
Processing /opt/pangolin-ansible-venv-controller-tmp/pyyaml-6.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Processing /opt/pangolin-ansible-venv-controller-tmp/resolvelib-0.5.4-py2.py3-none-any.whl
Processing /opt/pangolin-ansible-venv-controller-tmp/setuptools-80.9.0-py3-none-any.whl
Processing /opt/pangolin-ansible-venv-controller-tmp/six-1.17.0-py2.py3-none-any.whl
Processing /opt/pangolin-ansible-venv-controller-tmp/wheel-0.45.1-py3-none-any.whl
pip is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.
setuptools is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.
wheel is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.
Building wheels for collected packages: ansible, ansible-core
Building wheel for ansible (pyproject.toml) ... done
Created wheel for ansible: filename=ansible-4.10.0-py3-none-any.whl size=60297127 sha256=b5aa5ef4d89daa0de1d0785385bf7dc53e564c8ac8348c28bc9c2f96d015016f
Stored in directory: /root/.cache/pip/wheels/b8/ff/34/e6b431d40dbb5d0245f5e80e84daf566cec1bcb5bf832e97e5
Building wheel for ansible-core (pyproject.toml) ... done
Created wheel for ansible-core: filename=ansible_core-2.11.7-py3-none-any.whl size=1952128 sha256=7f7818f5d2c60874e352c877c6a1155f25c205498d586103527f210631807fb3
Stored in directory: /root/.cache/pip/wheels/c0/fd/98/2247966450b663f01e4637bc4a28a0da6c6acced19ad1e4f25
Successfully built ansible ansible-core
Installing collected packages: resolvelib, netaddr, six, pyyaml, pyparsing, pycparser, packaging, markupsafe, jmespath, dnspython, jinja2, cffi, cryptography, ansible-core, ansible
Successfully installed ansible-4.10.0 ansible-core-2.11.7 cffi-2.0.0 cryptography-46.0.3 dnspython-2.7.0 jinja2-3.1.6 jmespath-1.0.1 markupsafe-3.0.3 netaddr-0.8.0 packaging-25.0 pycparser-2.23 pyparsing-3.2.1 pyyaml-6.0.3 resolvelib-0.5.4 six-1.17.0
[notice] A new release of pip is available: 25.3 -> 26.0.1
[notice] To update, run: pip install --upgrade pip
Remove tmp directory
Create link in /opt/pangolin-ansible-venv-controller/lib/ to /opt/pangolin-ansible-venv-controller/lib/python3
Активируем виртуальное окружение:
[student@srv1 3rdparty]$ cd
[student@srv1 ~]$ source /opt/pangolin-ansible-venv-controller/bin/activate
(pangolin-ansible-venv-controller) [student@srv1 ~]$
Проверим версии установленного ПО в виртуальном окружении:
(pangolin-ansible-venv-controller) [student@srv1 ~]$ which python
/opt/pangolin-ansible-venv-controller/bin/python
(pangolin-ansible-venv-controller) [student@srv1 ~]$ which pip
/opt/pangolin-ansible-venv-controller/bin/pip
(pangolin-ansible-venv-controller) [student@srv1 ~]$ python -V
Python 3.11.15
(pangolin-ansible-venv-controller) [student@srv1 ~]$ pip -V
pip 25.3 from /opt/pangolin-ansible-venv-controller/lib64/python3.11/site-packages/pip (python 3.11)
(pangolin-ansible-venv-controller) [student@srv1 ~]$ pip list
Package Version
------------ -------
ansible 4.10.0
ansible-core 2.11.7
cffi 2.0.0
cryptography 46.0.3
dnspython 2.7.0
Jinja2 3.1.6
jmespath 1.0.1
MarkupSafe 3.0.3
netaddr 0.8.0
packaging 25.0
pip 25.3
pycparser 2.23
pyparsing 3.2.1
PyYAML 6.0.3
resolvelib 0.5.4
setuptools 80.9.0
six 1.17.0
wheel 0.45.1
В этом виртуальном окружении установлены те версии ПО, которые необходимы для корректной установки.
Если виртуальное окружение устанавливается вручную, а не из пакета pangolin-ansible-venv-controller, то можно установить необходимые python пакеты самостоятельно:
pip install cffi==1.15.0 cryptography==3.3.* Jinja2==3.0.3 jmespath==0.10.0 MarkupSafe==2.0.1 netaddr==0.7.19 packaging==21.3 pycparser==2.21 pyparsing==3.0.6 PyYAML==6.0 resolvelib==0.5.5 six==1.16.0 ansible==4.10.0
Деактивируем виртуальное окружение:
(pangolin-ansible-venv-controller) [student@srv1 ~]$ deactivate
[student@srv1 ~]$
Установка Pangolin Installer
Зарегистрируем на всех трех узлах пользователя postgres:
[student@srv1 ~]$ for comp in srv{1..3}; do echo -e "\n${comp}"; ssh $comp sudo useradd -m -r -d /home/postgres postgres; id postgres; done
srv1
uid=990(postgres) gid=990(postgres) группы=990(postgres)
srv2
uid=990(postgres) gid=990(postgres) группы=990(postgres)
srv3
uid=990(postgres) gid=990(postgres) группы=990(postgres)
Пользователь postgres востребован при установке пакета Pangolin Installer и не устанавливается им автоматически. Установим пакет Pangolin Installer:
[student@srv1 ~]$ sudo dnf install -y Distr/distributive/installer/utilities/pangolin-installer-1.0.3-redos8.0.x86_64.rpm
Вывод команды:
Последняя проверка окончания срока действия метаданных: 2:06:25 назад, Пт 17 апр 2026 12:44:59.
Зависимости разрешены.
==================================================================================================================================================
Пакет Архитектура Версия Репозиторий Размер
==================================================================================================================================================
Установка:
pangolin-installer x86_64 1.0.3-redos8.0 @commandline 15 M
Результат транзакции
==================================================================================================================================================
Установка 1 Пакет
Общий размер: 15 M
Объем изменений: 54 M
Загрузка пакетов:
Проверка транзакции
Проверка транзакции успешно завершена.
Идет проверка транзакции
Тест транзакции проведен успешно.
Выполнение транзакции
Подготовка : 1/1
Запуск скриптлета: pangolin-installer-1.0.3-redos8.0.x86_64 1/1
Установка : pangolin-installer-1.0.3-redos8.0.x86_64 1/1
Проверка : pangolin-installer-1.0.3-redos8.0.x86_64 1/1
Установлен:
pangolin-installer-1.0.3-redos8.0.x86_64
Выполнено!
Проверим работоспособность утилиты:
[student@srv1 ~]$ /opt/pangolin-ansible-venv-controller/bin/pangolin-installer terminal --help
usage: pangolin-installer terminal [-h] [--version] [--debug] -c CONFIG [-a {info,install,clean,updates,scouting,configure_roles}] [-v]
[--no_archive_logs] [--force] [--vault-password-file VAULT_PASSWORD_FILE] [--wont-clean-hosts]
options:
-h, --help show this help message and exit
--version Версия pangolin-installer
--debug Включает функцию debug pangolin-installer (По умолчанию=False)
-c CONFIG, --config CONFIG
Путь до конфигурационного файла
-a {info,install,clean,updates,scouting,configure_roles}, --action {info,install,clean,updates,scouting,configure_roles}
Выбор действия для pangolin-installer`a, по умолчанию автовыбор. Для визуализации автовыбора введите -a info
-v Уровень логирования работы ansible-playbook (По умолчанию: vvv)
--no_archive_logs Выключить архивирование директории с логами (По умолчанию=False)
--force Принудительно запускать action (По умолчанию=False)
--vault-password-file VAULT_PASSWORD_FILE
Путь до файла ansible-vault
--wont-clean-hosts Выключить запуск очистки перед установкой (По умолчанию=False)
Конфигурационный файл установки
Заготовку конфигурационного файла установки создает сама утилита Pangolin Installer:
[student@srv1 ~]$ /opt/pangolin-ansible-venv-controller/bin/pangolin-installer init --terminal
Конфигурационный файл создан - /home/student/config.yml
[student@srv1 ~]$ less config.yml
hosts:
master:
hostname: 127.0.0.1
username: student
password: password
local_distr_path: path_to_distr
pangolin_license_path: <path_to_license>
tune_pangolin_local_repo: true
Для кластерной конфигурации нам потребуется три узла. Кроме этого необходимо указать корректные имя пользователя, его пароль, пути к дистрибутиву и файлу лицензии.
Пример отредактированной версии файла:
[student@srv1 ~]$ less config.yml
hosts:
master:
hostname: srv1
username: student
password: <password>
replica:
hostname: srv2
username: student
password: <password>
arbiter:
hostname: srv3
username: student
password: <password>
local_distr_path: /home/student/Distr/distributive
pangolin_license_path: /home/student/license.json
tune_pangolin_local_repo: true
used_fqdn_host: false
Запуск установки по умолчанию
Пока в файле конфигурации нет никаких дополнительных настроек. Проверим возможность установки Pangolin с такими параметрами:
[student@srv1 ~]$ /opt/pangolin-ansible-venv-controller/bin/pangolin-installer terminal -c config.yml -a install
Вывод команды:
Запуск предварительных проверок.
Предварительные проверки пройдены.
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| clean |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Node | Action | CPU | MEM | Disk available | OS | Version OS | Packages Removed | Packages Installed | Configuration |
|----------------|---------|-----|------|--------------------------|--------|------------|-------------------------------------------------------|--------------------|---------------|
| node: master | install | 1 | 4 GB | / 16G | RED OS | 8.0 | pangolin-ansible-venv-controller (6.7.0) | | cluster |
| ip/dns: (srv1) | | | | | | | pangolin-installer (1.0.3) | | |
| | | | | | | | | | |
| node: replica | install | 1 | 4 GB | / 20G | RED OS | 8.0 | | | cluster |
| ip/dns: (srv2) | | | | | | | | | |
| node: arbiter | install | 1 | 4 GB | / 20G | RED OS | 8.0 | | | cluster |
| ip/dns: (srv3) | | | | | | | | | |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
Процедура очистит стенд от компонентов Pangolin. Продолжить? (Y/N): Y
Выполняемая задача: clean
🟢 Роль MAIN PLAY - Завершена! [Время выполнения: 0:01:46] Задач выполнено: 43 | | |#####################################|
Очистка стенда(ов) прошла успешно!
Запуск предварительных проверок.
Предварительные проверки пройдены.
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| install |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Node | Action | CPU | MEM | Disk available | OS | Version OS | Packages Removed | Packages Installed | Configuration |
|----------------|---------|-----|------|--------------------------|--------|------------|-------------------------------------------------------|--------------------|---------------|
| node: master | install | 1 | 4 GB | / 16G | RED OS | 8.0 | pangolin-ansible-venv-controller (6.7.0) | | cluster |
| ip/dns: (srv1) | | | | | | | pangolin-installer (1.0.3) | | |
| | | | | | | | | | |
| node: replica | install | 1 | 4 GB | / 20G | RED OS | 8.0 | | | cluster |
| ip/dns: (srv2) | | | | | | | | | |
| node: arbiter | install | 1 | 4 GB | / 20G | RED OS | 8.0 | | | cluster |
| ip/dns: (srv3) | | | | | | | | | |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
Выполняемая задача: install
🟢 Роль MAIN PLAY - Завершена! [Время выполнения: 0:00:10] Задач выполнено: 20 | | |#####################################|
🟢 Роль PANGOLIN_CHECKS - Завершена! [Время выполнения: 0:07:05] Задач выполнено: 662 | | |#####################################|
🟢 Роль PANGOLIN_LICENSE - Завершена! [Время выполнения: 0:00:04] Задач выполнено: 7 | | |#####################################|
🟢 Роль PANGOLIN_AUTH_PASSWORD - Завершена! [Время выполнения: 0:00:06] Задач выполнено: 8 | | |#####################################|
🟢 Роль ETCD - Завершена! [Время выполнения: 0:00:34] Задач выполнено: 34 | | |#####################################|
🟢 Роль PANGOLIN_CERTS_ROTATE - Завершена! [Время выполнения: 0:00:23] Задач выполнено: 26 | | |#####################################|
🟢 Роль PANGOLIN_SECURITY_UTILITIES - Завершена! [Время выполнения: 0:00:08] Задач выполнено: 18 | | |#####################################|
🟢 Роль PANGOLIN_DBMS - Завершена! [Время выполнения: 0:00:57] Задач выполнено: 96 | | |#####################################|
🟢 Роль PANGOLIN_MANAGER - Завершена! [Время выполнения: 0:01:07] Задач выполнено: 31 | | |#####################################|
🟢 Роль PANGOLIN_BACKUP_TOOLS - Завершена! [Время выполнения: 0:00:14] Задач выполнено: 37 | | |#####################################|
🟢 Роль PANGOLIN_POOLER - Завершена! [Время выполнения: 0:00:18] Задач выполнено: 16 | | |#####################################|
🟢 Роль PANGOLIN_POOLER_MT - Завершена! [Время выполнения: 0:00:00] Задач выполнено: 5 | | |#####################################|
🟢 Роль PANGOLIN_DIAGNOSTIC_TOOL - Завершена! [Время выполнения: 0:00:05] Задач выполнено: 12 | | |#####################################|
🟢 Роль PANGOLIN_AUTH_REENCRYPT - Завершена! [Время выполнения: 0:00:18] Задач выполнено: 20 | | |#####################################|
🟢 Роль PANGOLIN_UNTRUSTED_EXTENSIONS - Завершена! [Время выполнения: 0:01:04] Задач выполнено: 151 | | |#####################################|
🟢 Роль CONFIGURE - Завершена! [Время выполнения: 0:01:54] Задач выполнено: 167 | | |#####################################|
Установка Pangolin прошла успешно!
Запуск предварительных проверок.
Предварительные проверки пройдены.
|-----------------------------------------------------------------------------------------------------|
| after install |
|-----------------------------------------------------------------------------------------------------|
| Node | Action | Packages Installed |
|-----------------------------------------------------------------------------------------------------|
| node: master | after install | pangolin-ansible-venv-controller (6.7.0) |
| ip/dns: (srv1) | | pangolin-installer (1.0.3) |
| | | pangolin-ansible-venv-controlled (6.7.0) |
| | | pangolin-auth-password (6.7.0) |
| | | pangolin-certs-rotate (6.7.0) |
| | | pangolin-security-utilities (6.7.0) |
| | | pangolin-dbms-6.7 (6.7.0) |
| | | pangolin-dbms-6.7-client (6.7.0) |
| | | pangolin-timescaledb-6.7-apache (2.25.0) |
| | | pangolin-manager-venv (2.1.13) |
| | | pangolin-manager (2.1.13) |
| | | pangolin-backup-tools-venv (6.7.0) |
| | | pangolin-backup-tools (6.7.0) |
| | | pangolin-pooler (1.5.6) |
| | | pangolin-diagnostic-tool (6.7.0) |
| | | pangolin-auth-reencrypt (6.7.0) |
| | | pangolin-dbms-6-pltcl (6.7.0) |
| | | pangolin-dbms-6-plperl (6.7.0) |
| | | pangolin-dbms-6-jsonb-plperl (6.7.0) |
| | | pangolin-dbms-6-hstore-plperl (6.7.0) |
| | | pangolin-dbms-6-bool-plperl (6.7.0) |
| | | pangolin-dbms-6-plpython3 (6.7.0) |
| | | pangolin-dbms-6-ltree-plpython3 (6.7.0) |
| | | pangolin-dbms-6-jsonb-plpython3 (6.7.0) |
| | | pangolin-dbms-6-hstore-plpython3 (6.7.0) |
| | | pangolin-tuner (1.1.1) |
| | | |
| node: replica | after install | pangolin-ansible-venv-controlled (6.7.0) |
| ip/dns: (srv2) | | pangolin-auth-password (6.7.0) |
| | | pangolin-certs-rotate (6.7.0) |
| | | pangolin-security-utilities (6.7.0) |
| | | pangolin-dbms-6.7 (6.7.0) |
| | | pangolin-dbms-6.7-client (6.7.0) |
| | | pangolin-timescaledb-6.7-apache (2.25.0) |
| | | pangolin-manager-venv (2.1.13) |
| | | pangolin-manager (2.1.13) |
| | | pangolin-backup-tools-venv (6.7.0) |
| | | pangolin-backup-tools (6.7.0) |
| | | pangolin-pooler (1.5.6) |
| | | pangolin-diagnostic-tool (6.7.0) |
| | | pangolin-auth-reencrypt (6.7.0) |
| | | pangolin-dbms-6-pltcl (6.7.0) |
| | | pangolin-dbms-6-plperl (6.7.0) |
| | | pangolin-dbms-6-jsonb-plperl (6.7.0) |
| | | pangolin-dbms-6-hstore-plperl (6.7.0) |
| | | pangolin-dbms-6-bool-plperl (6.7.0) |
| | | pangolin-dbms-6-plpython3 (6.7.0) |
| | | pangolin-dbms-6-ltree-plpython3 (6.7.0) |
| | | pangolin-dbms-6-jsonb-plpython3 (6.7.0) |
| | | pangolin-dbms-6-hstore-plpython3 (6.7.0) |
| | | pangolin-tuner (1.1.1) |
| | | |
| node: arbiter | after install | |
| ip/dns: (srv3) | | |
|-----------------------------------------------------------------------------------------------------|
Если на этапе очистки у вас возникла «Необработанная ошибка»:
Запуск предварительных проверок.
Предварительные проверки пройдены.
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| clean |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Node | Action | CPU | MEM | Disk available | OS | Version OS | Packages Removed | Packages Installed | Configuration |
|----------------|---------|-----|------|---------------------------|--------|------------|------------------------------------------------------|--------------------|---------------|
| node: master | install | 1 | 2 GB | / 29G | RED OS | 8.0 | pangolin-ansible-venv-controller (6.7.0) | | cluster |
| ip/dns: (srv1) | | | | /boot/efi 100M | | | pangolin-installer (1.0.3) | | |
| | | | | | | | | | |
| node: replica | install | 1 | 2 GB | / 34G | RED OS | 8.0 | | | cluster |
| ip/dns: (srv2) | | | | /boot/efi 100M | | | | | |
| node: arbiter | install | 1 | 2 GB | / 34G | RED OS | 8.0 | | | cluster |
| ip/dns: (srv3) | | | | /boot/efi 100M | | | | | |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
Процедура очистит стенд от компонентов Pangolin. Продолжить? (Y/N): y
Выполняемая задача: clean
🟢 Роль MAIN PLAY - Завершена! [Время выполнения: 0:02:16] Задач выполнено: 17 | | |#################################################################|
Необработанная ошибка.
На всех трех серверах от имени student сделайте:
[student@srv1 ~]$ for comp in srv{1..3}; do echo -e "\n$comp"; ssh $comp sudo rm -rf /etc/yum.repos.d/pangolin_local_repo_*.repo; done
Проверим процессы экземпляров на мастере и реплике:
[student@srv1 ~]$ ps f -C postgres
PID TTY STAT TIME COMMAND
38844 ? S 0:00 /usr/pangolin-6.7/bin/postgres -D /pgdata/06/data/ --config-file=/pgdata/06/data/postgresql.conf --listen_addresses=0
38847 ? Ss 0:00 \_ postgres: clustername: logger
38848 ? Ss 0:00 \_ postgres: clustername: checkpointer
38849 ? Ss 0:00 \_ postgres: clustername: background writer
38851 ? Ss 0:00 \_ postgres: clustername: idle sessions terminator
38852 ? Ss 0:00 \_ postgres: clustername: walwriter
38853 ? Ss 0:00 \_ postgres: clustername: autovacuum launcher
38854 ? Ss 0:00 \_ postgres: clustername: integrity check launcher
38855 ? Ss 0:00 \_ postgres: clustername: license checker
38856 ? Ss 0:00 \_ postgres: clustername: authproc
38857 ? Ss 0:00 \_ postgres: clustername: password policy cache
38858 ? Ss 0:00 \_ postgres: clustername: pg_cron launcher
38859 ? Ss 0:00 \_ postgres: clustername: logical replication launcher
38864 ? Ss 0:00 \_ postgres: clustername: patroni postgres 127.0.0.1(51814) idle
38868 ? Ss 0:00 \_ postgres: clustername: walsender patroni <IP-Address2>(38136) streaming 0/6000070
[student@srv1 ~]$ ssh srv2 ps f -C postgres
PID TTY STAT TIME COMMAND
24990 ? S 0:00 /usr/pangolin-6.7/bin/postgres -D /pgdata/06/data/ --config-file=/pgdata/06/data/postgresql.conf --listen_addresses=0.0.0.0 --port=5433 --cluster_name=clustername --wal_level=replica --hot_standby=on --max_connections=110 --max_wal_senders=10 --max_prepared_transactions=3 --max_locks_per_transaction=64 --track_commit_timestamp=False --max_replication_slots=10 --max_worker_processes=32 --wal_log_hints=True --authentication_max_workers=16 --enable_page_compression=off
24993 ? Ss 0:00 \_ postgres: clustername: logger
24994 ? Ss 0:00 \_ postgres: clustername: checkpointer
24995 ? Ss 0:00 \_ postgres: clustername: background writer
24996 ? Ss 0:00 \_ postgres: clustername: startup recovering 000000020000000000000006
24997 ? Ss 0:00 \_ postgres: clustername: idle sessions terminator
24998 ? Ss 0:00 \_ postgres: clustername: authproc
24999 ? Ss 0:00 \_ postgres: clustername: password policy cache
25000 ? Ss 0:00 \_ postgres: clustername: walreceiver streaming 0/6000070
25003 ? Ss 0:00 \_ postgres: clustername: integrity check launcher
25004 ? Ss 0:00 \_ postgres: clustername: license checker
25007 ? Ss 0:00 \_ postgres: clustername: patroni postgres 127.0.0.1(34856) idle
Проверим состояние кластера:
[student@srv1 ~]$ sudo su - postgres
===============================================================
You are connected to Pangolin Cluster (clustername)
- Hostname : srv1
- IP Address : <IP-Address1>
---------------------------------------------------------------
- node ( master ) : <IP-Address1>
- node ( replica ) : <IP-Address2>
- arbiter : <IP-Address3>
- Manager version : 2.1.13
- Pangolin version : 6.7.0
===============================================================
[postgres@srv1 ~]$ health
member 21d7c907c7616a87 is healthy: got healthy result from http://<IP-Address2>:2379
member 8362176fed77d2af is healthy: got healthy result from http://<IP-Address1>:2379
member 86548f5f3d651054 is healthy: got healthy result from http://<IP-Address3>:2379
[postgres@srv1 ~]$ members
|--------------------------------------------------------------------------------------------------------|
| ID | STATUS | NAME | PEER ADDRS | CLIENT ADDRS | IS LEARNER |
|--------------------------------------------------------------------------------------------------------|
| 21d7c907c7616a87 | started | srv2 | http://<IP-Address2>:2380 | http://<IP-Address2>:2379 | false |
| 8362176fed77d2af | started | srv1 | http://<IP-Address1>:2380 | http://<IP-Address1>:2379 | false |
| 86548f5f3d651054 | started | srv3 | http://<IP-Address3>:2380 | http://<IP-Address3>:2379 | false |
|--------------------------------------------------------------------------------------------------------|
[postgres@srv1 ~]$ exit
Поскольку была выполнена установка с настройками по умолчанию, были использованы пароли, заданные в файле custom_config_initial.yml. Этот файл является шаблоном кастомизированной установки, которую подробнее мы рассмотрим в «Задание 4: Кастомизированная установка».
Проверим возможность подключиться с использованием пароля суперпользователя СУБД (не будем его выводить на экран):
[student@srv1 ~]$ psql -c '\conninfo' \
"host=srv1 port=5433 user=postgres password=$(awk '/postgres_db_pass:/{print $2}' /home/student/Distr/distributive/installer/group_vars/custom_config_initial.yml)"
Вы подключены к базе данных "postgres" как пользователь "postgres" (компьютер "srv1": адрес "<IP-Address1>", порт "5433").
В этой команде с помощью awk получен пароль суперпользователя, находящийся в строке, содержащей postgres_db_pass, файла custom_config_initial.yml. Этот пароль с помощью командной подстановки Bash помещен в строку подключения psql.