4.3. Installation and Initial Setup #
This section describes installation of the Postgres ProGate management service and initial setup. Postgres ProGate management service is a set of applications that supports Postgres ProGate web interface.
4.3.1. Hardware and Software Requirements #
The Postgres ProGate management service requires an allocated or virtual server with the following minimum characteristics:
CPU: 8 cores
RAM: 16 GB
Disk space: 100 GB
Network interface: 1Gb/sec
Postgres ProGate runs on the following Linux-based operating systems:
ALT 9/10/11, ALT SP Release 10
Astra Linux 1.7/1.8
Debian 12/13
Red OS Murom 7.3/8.2
Red Hat Enterprise (RHEL) Linux 8/9
ROSA Chrome 2021.2
SUSE Linux Enterprise Server (SLES) 15
Ubuntu 22.04/24.04
4.3.2. Components #
Postgres ProGate is shipped as the package progate, which includes all the needed dependencies.
The following utilities are included in progate, but they can also be installed individually (for example, to only use the command line):
procopy(package)prosync(package)procheck(package)
Note
procheck is not available through the web interface yet. So it can only be used as a command-line utility.
4.3.3. Installation Process #
To install and configure the Postgres ProGate management service, follow the steps below.
Install the repository:
wget -O pgpro-repo-add.sh https://repo.postgrespro.ru/progate/progate/keys/pgpro-repo-add.sh sh pgpro-repo-add.sh
Install the package:
apt install progateThe result of the installation is as follows:
The user and group named
progateare created.The procopy, prosync, and procheck utilities are installed in the
/opt/pgpro/progate/bin/directory.The progate.service service is added but initially disabled.
Note
At this point, only the procopy, prosync, and procheck command-line utilities are available. The web interface is not yet ready and requires additional setup. So follow the instructions from Section 4.3.4.
4.3.4. Initial Setup #
To start working with the Postgres ProGate web interface, execute the following steps:
Create a database, user, and schema.
The Postgres ProGate web interface requires a PostgreSQL/Postgres Pro database. In this database, create a dedicated schema where the web interface will store its support data and a user to work with this schema. For example, create the
dbnamedatabase, theprogateschema in it, and theuseruser with thepasswordpassword:CREATE USER user WITH PASSWORD 'password'; CREATE SCHEMA progate AUTHORIZATION user; GRANT ALL PRIVILEGES ON SCHEMA progate TO user; GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA progate TO user; ALTER DEFAULT PRIVILEGES IN SCHEMA progate GRANT ALL PRIVILEGES ON TABLES TO user; GRANT USAGE, CREATE ON SCHEMA progate TO user; GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA progate TO user;
Specify the database for the service.
To specify the database, in the environment file
/opt/pgpro/progate/etc/env_progate, edit the line under the comment below so that it looks as follows (for details, see Section 4.3.4.1):# PostgreSQL/Postgres Pro connection string PROGATE_DB="postgres://user:password@host:5430/dbname?sslmode=disable&search_path=progate"
Set the value of
search_pathabove to the name of the dedicated schema.When composing the connection string, double-check that:
The user specified in the connection string has permissions for the
progateschema.The schema is in the specified database.
Launch the
progate.serviceservice using the following commands and add them to the system autostart:systemctl start progate.service systemctl enable progate.service
(Optional) If a firewall is used, allow network connections on the
TCP/8081port.
If all the steps are performed without errors, the Postgres ProGate management service is launched successfully. The Postgres ProGate web interface is available at http://<server IP address>:8081. See Section 4.3.5 for how to log in.
4.3.4.1. Setting up Postgres ProGate with the Environment File #
For the service to work properly, in the environment file, which is created automatically, edit the PROGATE_DB setting to specify your user, password, host port, dbname, and search_path. search_path must contain the name of the schema where the support information is stored. The environment file is located at /opt/pgpro/progate/etc/env_progate and has the contents that may look like these:
# Port for Postgres ProGate backend PROGATE_HTTP_SERVER_PORT="8081" # Postgres ProGate backend serves static files from given directory PROGATE_HTTP_SERVER_STATIC_DIR="/opt/pgpro/progate/ui" # PostgreSQL/Postgres Pro connection string PROGATE_DB="postgres://user:password@host:5430/dbname?sslmode=disable&search_path=progate" # Log format: json | pretty PROGATE_LOGS_FORMAT=pretty # Log level: debug | info | warn | error PROGATE_LOGS_LEVEL=info # Length of the secret token. Must be greater than or equal to 32 characters PROGATE_AUTH_ACCESS_TOKEN_SECRET="mT-Y8ICZv-zhirL_j2K69vX_Upbo8B6rMKtplqv4U4I=" # Lifetime of the web interface's access token PROGATE_AUTH_ACCESS_TOKEN_LIFETIME="168h" # Lifetime of the web interface's access refresh token PROGATE_AUTH_REFRESH_TOKEN_LIFETIME="720h" # Path to prosync bin PROGATE_TRANSFER_WORK_PROSYNC_BIN="/opt/pgpro/progate/bin/prosync" # Path to procopy bin PROGATE_TRANSFER_WORK_PROCOPY_BIN="/opt/pgpro/progate/bin/procopy" # Path to directory with procopy/prosync configs and other Postgres ProGate backend-specific support files PROGATE_TRANSFER_WORK_WORKING_DIR="/var/lib/progate/execution"
For how to set values of time environment variables, refer to Section 4.3.6.
4.3.4.2. Setting up Postgres ProGate with the Configuration File #
In addition to environment variables, Postgres ProGate can be set up by means of the .yaml configuration file. Pass the path to this file with the -c flag. For example:
/opt/pgpro/progate/bin/progate -c path/to/config.yaml
The configuration file defines the same characteristics as the environment variables and may look as follows:
http_server:
port: 8081
static_dir: "/opt/pgpro/progate/ui"
db: "postgres://dbaas@localhost:5430/dbaas?sslmode=disable&search_path=progate"
logs:
format: pretty
level: info
auth:
access_token_secret: "mT-Y8ICZv-zhirL_j2K69vX_Upbo8B6rMKtplqv4U4I="
access_token_lifetime: 168h
refresh_token_lifetime: 720h
transfer_work:
prosync:
bin: "/opt/pgpro/progate/bin/prosync"
procopy:
bin: "/opt/pgpro/progate/bin/procopy"
working_dir: "/var/lib/progate/execution"
The configuration parameters are described in Table 4.8.
Table 4.8. Contents of the Postgres ProGate Configuration File
| Cofiguration parameter | Environment variable | Description | Example |
|---|---|---|---|
http_server.port | PROGATE_HTTP_SERVER_PORT | Port for the Postgres ProGate backend | 8081 |
http_server.static_dir | PROGATE_HTTP_SERVER_STATIC_DIR | Postgres ProGate backend serves static files from this directory | /opt/pgpro/progate/ui |
db | PROGATE_DB | PostgreSQL/Postgres Pro connection string | postgres://user:password@host:port/dbname?sslmode=disable?search_path=progate |
logs.format | PROGATE_LOGS_FORMAT | Log format: json / pretty | pretty |
logs.level | PROGATE_LOGS_LEVEL | Log level: debug / info / warn / error | info |
auth.access_token_secret | PROGATE_AUTH_ACCESS_TOKEN_SECRET | Length of the secret token. Must be greater than or equal to 32 characters | mT-Y8ICZv-zhirL_j2K69vX_Upbo8B6rMKtplqv4U4I= |
auth.access_token_lifetime | PROGATE_AUTH_ACCESS_TOKEN_LIFETIME | Lifetime of the web interface's access token | 168h |
auth.refresh_token_lifetime | PROGATE_AUTH_REFRESH_TOKEN_LIFETIME | Lifetime of the web interface's access refresh token | 720h |
transfer_work.prosync.bin | PROGATE_TRANSFER_WORK_PROSYNC_BIN | Path to the prosync binary | /opt/pgpro/progate/bin/prosync |
transfer_work.procopy.bin | PROGATE_TRANSFER_WORK_PROCOPY_BIN | Path to the procopy binary | /opt/pgpro/progate/bin/procopy |
transfer_work.working_dir | PROGATE_TRANSFER_WORK_WORKING_DIR | Path to the directory with procopy / prosync config files and other Postgres ProGate backend-specific support files | /var/lib/progate/execution |
4.3.5. Logging in to the Web Application #
To log in to the web application, use the following default credentials:
Login:
proadminPassword:
proadmin
4.3.6. Setting Time Values #
In Postgres ProGate, time environment variables and configuration values follow the Golang duration string format. For example:
100 ms — 100 milliseconds
5.5s — five and a half seconds
5m — five minutes
5h — five hours
1h7m — one hour and seven minutes