PGD CLI on BigAnimal
When running a distributed high-availability cluster on BigAnimal, you can use the PGD CLI to manage cluster operations, such as switching over write leaders, performing cluster health checks, and viewing various details about nodes, groups, or other aspects of the cluster.
Installing the PGD CLI
To install the PGD CLI, replace <your-token>
with your EDB subscription token in the following command for Debian and Ubuntu machines:
or in this command for RHEL, Rocky, AlmaLinux, or Oracle Linux machines:
Connecting to your BigAnimal cluster
Discovering your database connection string
To connect to your distributed high-availability BigAnimal cluster via the PGD CLI, you need to discover the database connection string from your BigAnimal console:
- Log into the BigAnimal clusters view.
- In the filter, set Cluster Type to Distributed High Availability to show only clusters that work with PGD CLI.
- Select your cluster.
- In the view of your cluster, select the Connect tab.
- Copy the read/write URI from the connection info. This is your connection string.
Using the PGD CLI with your database connection string
Important
PGD does not prompt for interactive passwords. Accordingly, you should have a .pgpass
file properly configured to allow access to the cluster. Your BigAnimal cluster's connection information page has all the necessary information needed for the file.
Without a properly configured .pgpass
, you receive a database connection error when using a PGD CLI command, even when using the correct database connection string with the --dsn
flag.
To use the PGD CLI with your database connection string, use the --dsn
flag with your PGD CLI command:
PGD commands in BigAnimal
Note
There are three EDB Postgres Distributed CLI commands that don't work with distributed high-availability BigAnimal clusters: create-proxy
, delete-proxy
, and alter-proxy-option
. These are managed by BigAnimal, as BigAnimal runs on Kubernetes, and it is a technical best practice to have the Kubernetes operator handle these functions.
What follows are some examples of the most common PGD CLI commands with a BigAnimal cluster.
pgd check-health
pgd check-health
provides statuses with relevant messaging regarding the clock skew of node pairs, node accessibility, the current raft leader, replication slot health, and versioning consistency:
pgd show-nodes
pgd show-nodes
returns all the nodes in the DHA cluster and their summaries, including name, node id, group, and current/target state:
pgd show-groups
pgd show-groups
returns all groups in your DHA BigAnimal cluster. It also notes which node is the current write leader of each group:
pgd switchover
pgd switchover
manually changes the write leader of the group, and can be used to simulate a failover.
See the PGD CLI command reference for the full range of PGD CLI commands and their descriptions.