Deploying an EDB Postgres Distributed example cluster on Docker v5.6
This quick start uses TPA to set up PGD with an Always-on Single Location architecture using local Docker containers.
Introducing TPA and PGD
We created TPA to make installing and managing various Postgres configurations easily repeatable. TPA orchestrates creating and deploying Postgres. In this quick start, you install TPA first. If you already have TPA installed, you can skip those steps. You can use TPA to deploy various configurations of Postgres clusters.
PGD is a multi-master replicating implementation of Postgres designed for high performance and availability. The installation of PGD is orchestrated by TPA. You will use TPA to generate a configuration file for a PGD demonstration cluster.
This cluster uses local Docker containers to host the cluster's nodes: three replicating database nodes, three cohosted connection proxies, and one backup node. You can then use TPA to provision and deploy the required configuration and software to each node.
This configuration of PGD isn't suitable for production use but can be valuable for testing the functionality and behavior of PGD clusters. You might also find it useful when familiarizing yourself with PGD commands and APIs to prepare for deployment on cloud, VM, or Linux hosts.
Note
This set of steps is specifically for Ubuntu 22.04 LTS on Intel/AMD processors.
Prerequisites
To complete this example, you need a system with enough RAM and free storage. You also need curl and Docker installed.
RAM requirements
You need a minimum of 4GB of RAM on the system. You need this much RAM because you will be running four containers, three of which will be hosting Postgres databases.
Free disk space
You need at least 5GB of free storage, accessible by Docker, to deploy the cluster described by this example. We recommend that you have a bit more than that.
The curl utility
You will download and run scripts during this quick start using the curl utility, which might not be installed by default. To ensure that curl is installed, run:
Docker Engine
You will use Docker containers as the target platform for this PGD deployment. Install Docker Engine:
Running as a non-root user
Once Docker Engine is installed, be sure to add your user to the Docker group:
Preparation
EDB account
To install both TPA and PGD, you need an EDB account.
Sign up for a free EDB account if you don't already have one. Signing up gives you a trial subscription to EDB's software repositories.
After you're registered, go to the EDB Repos 2.0 page, where you can obtain your repo token.
On your first visit to this page, select Request Access to generate your repo token. Copy the token using the Copy Token icon, and store it safely.
Setting environment variables
First, set the EDB_SUBSCRIPTION_TOKEN
environment variable to the value of your EDB repo token, obtained in the EDB account step.
You can add this to your .bashrc
script or similar shell profile to ensure it's always set.
Configure the repository
All the software needed for this example is available from the EDB Postgres Distributed package repository. The following command downloads and runs a script to configure the EDB Postgres Distributed repository. This repository also contains the TPA packages.
Troubleshooting repo access
The script should produce output starting with:
If it produces no output or an error, double-check that you entered your token correctly. It the problem persists, contact Support for assistance.
Installing Trusted Postgres Architect (TPA)
You'll use TPA to provision and deploy PGD. If you previously installed TPA, you can move on to the next step. You'll find full instructions for installing TPA in the Trusted Postgres Architect documentation, which we've also included here.
Linux environment
TPA supports several distributions of Linux as a host platform. These examples are written for Ubuntu 22.04, but steps are similar for other supported platforms.
Install the TPA package
Configuring TPA
You now need to configure TPA, which configures TPA's Python environment. Call tpaexec
with the command setup
:
You can add the export
command to your shell's profile.
Testing the TPA installation
You can verify TPA is correctly installed by running selftest
: