Installing PGD Proxy v5
Installing PGD Proxy
There are two ways to install and configure PGD Proxy to manage Postgres Distributed cluster. The recommended way to install and configure PGD Proxy is to use the EDB Trusted Postgres Architect (TPA) utility for cluster deployment and management.
Installing through TPA
If PGD cluster is being deployed through TPA then it installs and configures PGD Proxy automatically as per recommended architecture. If you wish to install PGD Proxy on any other node in PGD cluster then, you simply need to attach the pgd-proxy
role to that instance in TPA configuration file and set the bdr_child_group
parameter as shown below before deploying. See Trusted Postgres Architect for more information.
Configuration
Proxy connects to the BDR database for its internal operations, like getting proxy options, getting write leader details, etc. Therefore, it needs a list of endpoints/dsn to connect to BDR nodes. Proxy expects these configurations in a local config file pgd-proxy-config.yml
. Following is a functional example of pgd-proxy-config.yml
file:
By default, in the cluster created through TPA, pgd-proxy-config.yml
is located in the /etc/edb/pgd-proxy
directory. The PGD Proxy searches for pgd-proxy-config.yml
in the following locations. Precedence order is high to low.
/etc/edb/pgd-proxy
(default)$HOME/.edb/pgd-proxy
If you rename the file or move it to another location, specify the new name and location using the optional -f
or --config-file
flag when starting a service. See the sample service file.
The log level for the PGD Proxy service can be set using the top level config parameter log-level
as shown in the sample config. The valid values for log-level
are debug
, info
, warn
and error
.
The cluster.endpoints
and cluster.proxy.name
are mandatory fields in the config file. Proxy always tries to connect to the first endpoint in the list, if it fails it tries the next endpoint and so on.
Proxy uses endpoints given in the local config file only at the time of proxy startup. After that, proxy retrieves the list of actual endpoints (route_dsn) from the bdr catalog. Therefore, the node option - route_dsn
, must be set for each bdr node. See route_dsn for more information.
Proxy user
The database user specified in the endpoint doesn’t need to be a superuser. Typically, in the TPA environment, pgdproxy
is an OS user as well as database user with the bdr_superuser
role.
PGD Proxy service
PGD Proxy is preferably run as a systemd service. The pgd-proxy
service unit file is located at /etc/systemd/system/pgd-proxy.service
by default. Following is the sample service file created by TPA.
Use the below commands to manage pgd-proxy
service
Installing manually
You can manually install PGD Proxy on any Linux machine using .deb
and .rpm
packages available from the PGD repository. The package name is edb-pgd5-proxy
. For example:
- On this page
- Installing PGD Proxy