Deploying PGD manually#
EDB offers automated PGD deployment using Trusted Postgres Architect (TPA) because it’s generally more reliable than manual processes. See Deploying with TPA for full details about how to install TPA and use its automated best-practice-driven PGD deployment options. Or refer to any of the Quick start walkthroughs , which use TPA to get you up and running quickly.
To complement automated deployment, and to enable alternative installation and deployment processes, this section looks at the basic operations needed to manually configure a three-node PGD cluster (with a local subgroup), PGD Proxy, and PGD CLI.
Each step is outlined and followed by a worked example with further detail. This isn’t a quick start guide but an exploration of PGD installation. It configures a basic deployment that will be used for further examples of PGD administration tasks.
The examples deploy a 3-node cluster of EDB Postgres Advanced Server 16 on Red Hat Enterprise Linux 9. These instructions also apply to RHEL derivatives like Alma Linux, Rocky Linux, or Oracle Linux.
At the highest level, manually deploying PGD involves the following steps. (For completeness, the steps also include instructions for installing PostgreSQL. If you’re familiar with that, then skip to step 3.)
1: Step 1 - Provisioning hosts to run the cluster on
2: Step 2 - Installing Postgres on each of the hosts
3: Step 3 - Configuring PGD repositories to add PGD capabilities to each host
4: Step 4 - Installing the PGD software on each host
5: Step 5 - Creating the PGD cluster by connecting to each node and telling it to join the cluster
6: Step 6 - Checking the cluster by running SQL commands and confirming replication has happened
7: Step 7 - Configure proxies by creating a proxy config file
8: Step 8 - Using PGD CLI , including how to install PGD CLI and how to use it to inspect and manage your cluster
- Step 1 - Provisioning hosts
- Step 2 - Installing Postgres
- Step 3 - Configuring PGD repositories
- Step 5 - Creating the PGD cluster
- Step 4 - Installing the PGD software
- Installing the PGD software
- Worked example
- Install the packages
- Ensure the database is initialized and started
- Configure the BDR extension
- Preload the BDR library
- Set the
wal_level - Enable commit timestamp tracking
- Increase
max_worker_processes - Add a password to the Postgres enterprisedb user
- Enable inter-node authentication in pg_hba.conf
- Enable authentication between nodes
- Restart the server
- Check the extension has been installed
- Create the replicated database
- Summaries
- Step 6 - Checking the cluster
- Checking the cluster
- Worked example
- Preparation
- Ensure the cluster is ready
- Create data
- On node-one, create a table
- On node-one, populate the table
- On node-one, monitor performance
- On node-one get a checksum
- Check data
- Log in to host-two’s Postgres server
- On node-two, get a checksum
- Compare with the result from node-one
- Log in to host-three’s Postgres server
- On node-three, get a checksum
- Compare with the result from node-one and node-two
- Step 7 - Configure proxies
- Configure proxies
- Worked example
- Preparing for proxies
- Create a pgdproxy user on the database
- Configure proxy routes to each node
- Create a pgdproxy user on each host
- Configure the systemd service on each host
- Create a proxy config file for each host
- Install a PGD proxy configuration on each host
- Restart the service
- Test the proxy
- Step 8 - Using PGD CLI