Installing PGD CLI¶
By default, Trusted Postgres Architect installs and configures PGD CLI on each PGD node. If you want to install PGD CLI on any non-PGD instance in the cluster, attach the pgdcli role to that instance in Trusted Postgres Architect’s configuration file before deploying. See
Trusted Postgres Architect for more information.
Installing manually¶
You can manually install the PGD CLI on any Linux machine using .deb
and .rpm packages available from the EDB repository. The package
name is edb-pgd5-cli . For example:
# for Debian
sudo apt-get install edb-pgd5-cli
When Trusted Postgres Architect configures the PGD CLI, it connects automatically. With a manual installation to a standalone EDB Postgres Distributed cluster, you need to provide a connection string.
Specifying database connection strings¶
You can use a configuration file to specify the database connection strings for your cluster. Alternatively, you can pass the connection string directly to a command. For details, see the sample use case .
Using a configuration file¶
Use the pgd-cli-config.yml configuration file to specify the
database connection string for your cluster. The configuration file must
contain the database connection string for at least one PGD node in the
cluster. The cluster name is optional and isn’t validated.
For example:
cluster:
name: cluster-name
endpoints:
- "host=bdr-a1 port=5432 dbname=bdrdb user=postgres "
- "host=bdr-b1 port=5432 dbname=bdrdb user=postgres "
- "host=bdr-c1 port=5432 dbname=bdrdb user=postgres "
By default, pgd-cli-config.yml is located in the
/etc/edb/pgd-cli directory. The PGD CLI searches for
pgd-cli-config.yml in the following locations. Precedence order is
high to low.
/etc/edb/pgd-cli(default) 2.$HOME/.edb/pgd-cli
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 entering a command. See the sample use case .