27.1. Установка в минимальной среде #
27.1.1. Выполнение предварительных требований #
Убедитесь, что выполнены следующие предварительные требования:
Таблица 27.1. Предварительные требования
Требование | Хост для менеджера | Хост для агента |
|---|---|---|
Платформа | Любая платформа, совместимая с архитектурой x86_64 (AMD64). Это может быть физический сервер, виртуальная машина или контейнер с доступом в привилегированном режиме. | |
Ресурсы хоста | 2 ядра ЦП, 4 ГБ ОЗУ, 40 ГБ SSD (или больше) | 2 ядра ЦП, 2 ГБ ОЗУ, 20 ГБ SSD (или больше) |
Операционная система | Любая из следующих ОС:
| |
Программное обеспечение |
|
|
(Необязательно) Чтобы включить дополнительную функциональность PPEM, такую как журналирование, мониторинг и сбор метрик, необходимо установить дополнительное программное обеспечение. | ||
Доступ к Интернету | У хоста должен быть выход в Интернет для доступа к репозиториям пакетов Postgres Pro. | |
Права пользователя |
| |
За подробной информацией о требованиях к аппаратному и программному обеспечению обратитесь к Главе 4.
27.1.2. Установка дополнительного программного обеспечения #
Примечание
Это необязательный шаг.
Пропустите его, если функциональность PPEM, перечисленная ниже, не требуется.
На хостах с СУБД и агентами необходимо установить дополнительное программное обеспечение для работы следующей функциональности PPEM:
Журналирование, мониторинг и сбор метрик:
Резервное копирование и восстановление и проверка целостности каталога данных:
Это программное обеспечение автоматически обнаруживается агентом, установленным на хосте, и соответствующая функциональность включается автоматически.
27.1.3. Подключение репозитория пакетов #
На хостах с менеджером и агентом подключите репозиторий пакетов Postgres Pro:
Получите ключ доступа к репозиторию:
Откройте свой личный кабинет на портале технической поддержки.
Перейдите на страницу Администрирование → Набор лицензий → Репозитории.
Найдите и скопируйте ключ доступа.
Ключи доступны только администраторам набора лицензий.
Скачайте bash-скрипт
pgpro-repo-add.sh:wget --user '
значение_ключа_доступа' --password='' https://repo.postgrespro.ru/ppem/ppem/keys/pgpro-repo-add.shПримечание
Значение ключа доступа нужно указывать в
--user, не в--password. Этот последний параметр должен быть пустым.Этот скрипт подключает репозиторий Postgres Pro, чтобы менеджер пакетов операционной системы хоста мог использовать его.
(Необязательно) При необходимости проверьте содержимое скрипта.
Сделайте файл скрипта исполняемым и запустите его:
chmod +x pgpro-repo-add.sh && ./pgpro-repo-add.sh
Скрипт установит ключи GPG Postgres Pro, подключит репозиторий и настроит менеджер пакетов.
При запросе введите указанные выше учётные данные для доступа:
Важно
Если учётные данные не предоставлены или неверны, скрипт предлагает добавить репозиторий без учётных данных.
Если вы решите подключить репозиторий без учётных данных, вам потребуется вручную ввести их позже для доступа к репозиторию.
27.1.4. Установка менеджера #
На хосте менеджера:
Подключите репозиторий пакетов Postgres Pro, если он ещё не подключён.
Установите двоичные пакеты
ppemиppem-guiс помощью менеджера пакетов операционной системы.Создайте базу данных репозитория PPEM:
От имени суперпользователя СУБД (например,
postgres) создайте пользователяppem, который будет владельцем базы данных репозитория. Используйте параметр--pwprompt, только если необходимо задать пароль для этого пользователя:sudo -u postgres createuser --pwprompt ppem
Если используется параметр
--pwprompt, при запросе пароля введите пароль для пользователяppem.От имени суперпользователя СУБД (например,
postgres) создайте базу данных репозитория с пользователемppemв качестве владельца:sudo -u postgres createdb -O ppem ppem
Убедитесь, что владелец базы данных может подключиться к базе данных репозитория
ppem:sudo -u ppem psql
При успешном соединении должно отобразиться приглашение psql.
Если СУБД установлена с нестандартными значениями параметров, может потребоваться скорректировать параметры аутентификации.
За подробной информацией обратитесь к разделам Подключения и аутентификация и Аутентификация клиентского приложения официальной документации Postgres Pro.
В файле конфигурации менеджера укажите учётные данные для базы данных репозитория:
repo: url: "postgres:///ppem?user=ppem&password=
пароль_пользователя_ppem"Где
пароль_пользователя_ppem— это пароль, заданный на шаге 3a.Как правило, конфигурация располагается в файле
/etc/ppem-manager.yml.Если найти файл конфигурации не удаётся, попробуйте поискать его или создать заново с помощью менеджера пакетов.
Включите и запустите службу менеджера:
systemctl enable --now ppem
Убедитесь, что службы работают корректно:
systemctl status ppem
Примечание
Если используется другая система инициализации, скорректируйте соответствующие команды при необходимости.
27.1.5. Доступ к веб-приложению PPEM #
Для взаимодействия с менеджером агенту требуется API-ключ.
Чтобы получить ключ, используйте веб-приложение PPEM:
В веб-браузере перейдите по следующему URL:
http://
адрес_хоста_менеджера_PPEM:8080/На странице авторизации введите имя пользователя
admin, заданное по умолчанию, и парольadmin, затем нажмите Войти.В навигационной панели перейдите в Главная.
На странице отобразится инструкция по установке агента. Скопируйте ключ из инструкции.
Если инструкция по установке агента случайно закрылась:
В навигационной панели перейдите в Инфраструктура → Агенты.
В столбце Ключ аутентификации рядом с любым агентом нажмите , чтобы скопировать ключ.
27.1.6. Установка агента #
Чтобы СУБД управлялась через PPEM, агент должен быть установлен на хосте СУБД.
В целях упрощения в этом руководстве по быстрому старту предполагается, что агент будет работать от имени суперпользователя СУБД postgres без необходимости явно предоставлять права выделенному пользователю агента.
Предупреждение
Используйте этот подход только в целях оценки и тестирования.
В производственных средах создайте отдельного пользователя агента и предоставьте ему минимальный набор прав.
Чтобы установить агент на хосте СУБД:
Подключите репозиторий пакетов Postgres Pro, если он ещё не подключён.
Установите двоичный пакет
ppem-agentс помощью менеджера пакетов операционной системы.В файле конфигурации агента
/etc/ppem-agent.ymlукажите значения для следующих параметров:agent.manager.api_key: ранее полученный API-ключ для подключения агента к менеджеру.agent.manager.url: URL для подключения агента к менеджеру.Пример:
http://ppem.example.com:8080/v1.agent.instance.connection_defaults: учётные данные суперпользователя (как правило, пользователяpostgres) СУБД, которой будет управлять PPEM.Параметр
passwordнеобязательный. Используйте его, только если необходимо установить пароль для подключения к СУБД.
При необходимости используйте пример файла конфигурации агента.
Включите и запустите службу агента:
systemctl enable --now ppem-agent
Убедитесь, что служба запущена и работает:
systemctl status ppem-agent
Примечание
Если используется другая система инициализации, скорректируйте соответствующие команды при необходимости.
27.1.7. Проверка установки #
После выполнения всех действий, описанных в предыдущих разделах, проверьте установку:
Войдите в веб-приложение PPEM, как описано в Подразделе 27.1.5.
В навигационной панели перейдите в Инфраструктура → Экземпляры.
Убедитесь, что ваш экземпляр Postgres Pro отображается в списке управляемых экземпляров базы данных.
PPEM успешно установлен в минимальной среде. Теперь экземпляром базы данных можно управлять через веб-приложение.
27.1. Installation in the Minimal Environment #
27.1.1. Meeting Prerequisites #
Ensure that the following prerequisites are met:
Table 27.1. Prerequisites
Prerequisite | Host for manager | Host for agent |
|---|---|---|
Platform | Any platform that is compatible with the x86_64 (AMD64) architecture. It can be either a physical server, a virtual machine, or a container that can be accessed in privileged mode. | |
Host resources | 2 CPU cores, 4 GB RAM, 40 GB SSD (or higher) | 2 CPU cores, 2 GB RAM, 20 GB SSD (or higher) |
Operating system | Any of:
| |
Software |
|
|
(Optional) Additional software must be installed to enable more PPEM features, such as logging, monitoring, and metrics collection. | ||
Internet access | The host must have Internet access to reach the Postgres Pro package repositories. | |
Privileged user |
| |
For more information about hardware and software requirements, refer to Chapter 4.
27.1.2. Installing the Additional Software #
Note
This is an optional step.
Skip it if you do not need the PPEM features listed below.
PPEM requires the additional software to be installed on the hosts with DBMS and agents for the following PPEM features to operate:
Logging, monitoring, and metrics collection:
This software is automatically detected by the agent installed on the host, and the related features are enabled automatically.
27.1.3. Adding the Package Repository #
On both the manager and agent hosts, add the Postgres Pro package repository:
Get the access key for the repository:
Open your personal account in the technical support portal.
Go to Administration → License Set → Repositories.
Locate and copy the access key.
Access keys are available only to license set administrators.
Download the
pgpro-repo-add.shBash script:wget --user '
access_key_value' --password='' https://repo.postgrespro.com/ppem/ppem/keys/pgpro-repo-add.shNote
Specify the access key value in
--user, not--password. The latter option must be empty.This script adds the Postgres Pro repository so that the package manager of the host operating system can use it.
(Optional) Examine the content of the script, if necessary.
Make the script file executable and run it:
chmod +x pgpro-repo-add.sh && ./pgpro-repo-add.sh
The script will install the Postgres Pro GPG keys, add the repository, and configure the package manager.
When prompted, enter the same access credentials as above:
Important
If no credentials are provided or they are invalid, the script offers to add the repository without credentials.
If you proceed without credentials, you must manually provide the credentials later in order to access the repository.
27.1.4. Installing the Manager #
On the manager host:
Add the Postgres Pro package repository, if not added yet.
Install the
ppemandppem-guibinary packages using the package manager of the operating system.Create the PPEM repository database:
On behalf of the DBMS superuser (e.g.,
postgres), create theppemuser who will own the repository database. Use the--pwpromptoption only if you want to set a password for this user:sudo -u postgres createuser --pwprompt ppem
If you used
--pwprompt, enter a password for theppemuser when prompted.On behalf of the DBMS superuser (e.g.,
postgres), create the repository database with theppemuser as its owner:sudo -u postgres createdb -O ppem ppem
Verify that the database owner can connect to the
ppemrepository database:sudo -u ppem psql
The psql prompt must be displayed, indicating the successful connection.
If the DBMS is installed with non-default settings, you may need to adjust the authentication parameters.
For more information, refer to the Connections and Authentication and Client Authentication sections of the official Postgres Pro documentation.
Specify the access credentials for the repository database in the manager configuration file:
repo: url: "postgres:///ppem?user=ppem&password=
ppem_user_password"Where
ppem_user_passwordis the password set at step 3a.Usually the configuration is located in the
/etc/ppem-manager.ymlfile.If you cannot locate the configuration file, try to locate or recreate it using the package manager.
Enable and start the manager service:
systemctl enable --now ppem
Verify that the services are running correctly:
systemctl status ppem
Note
If another initialization system is used, adjust the relevant commands as needed.
27.1.5. Accessing the PPEM Web Application #
The agent requires an API key to interact with the manager.
Access the PPEM web application to obtain the key:
In a web browser, go to the following URL:
http://
PPEM_manager_host_address:8080/On the authorization page, enter the default
adminusername andadminpassword, then click Log in.In the navigation panel, go to Summary.
The agent installation instruction will be displayed on the page. Copy the key from the instruction.
If the agent installation instruction was accidentally closed:
In the navigation panel, go to Infrastructure → Agents.
In the Authentication key column next to any agent, click to copy the key.
27.1.6. Installing the Agent #
For a DBMS to be managed by PPEM, the agent must be installed on the DBMS host.
For the sake of simplicity, it is assumed in the quick start guide that the agent will operate on behalf of the postgres DBMS superuser, without the need to explicitly grant privileges to a dedicated agent user.
Warning
Use this approach only for evaluating and testing purposes.
In production environments, create a separate agent user and grant a minimal set of privileges to it.
To install the agent on the DBMS host:
Add the Postgres Pro package repository, if not already added.
Install the
ppem-agentbinary package using the package manager of the operating system.In the
/etc/ppem-agent.ymlagent configuration file, specify values for the following parameters:agent.manager.api_key: The previously obtained API key for connecting the agent to the manager.agent.manager.url: The URL for connecting the agent to the manager.Example:
http://ppem.example.com:8080/v1.agent.instance.connection_defaults: The credentials of the superuser (typicallypostgres) of the DBMS that PPEM will manage.The
passwordparameter is optional. Use it only if you want to set a password for the DBMS connection.
If necessary, use the sample agent configuration file as a reference.
Enable and start the agent service:
systemctl enable --now ppem-agent
Ensure that the service is up and running:
systemctl status ppem-agent
Note
If another init system is in use, correct the related commands as necessary.
27.1.7. Verifying the Installation #
After completing the steps described in the previous sections, verify the installation:
Log in to the PPEM web application as described in Section 27.1.5.
In the navigation panel, go to Infrastructure → Instances.
Verify that your Postgres Pro instance appears in the list of managed database instances.
You have successfully installed PPEM in a minimal environment. The database instance can now be managed through the web application.