Deploying an EDB Postgres Distributed example cluster on Linux hosts v5
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.
The TPA Linux host option allows users of any cloud or VM platform to use TPA to configure EDB Postgres Distributed. All you need from TPA is for the target system to be configured with a Linux operating system and accessible using SSH. Unlike the other TPA platforms (Docker and AWS), the Linux host configuration doesn't provision the target machines. It's up to you to provision them wherever you decide to deploy.
This cluster uses Linux server instances to host the cluster's nodes. The nodes include three replicating database nodes, three cohosted connection proxies, and one backup node. TPA can then provision, prepare, and deploy the required EDB Postgres Distributed software and configuration to each node.
On host compatibility
This set of steps is specifically for users running Ubuntu 22.04 LTS on Intel/AMD processors.
Prerequisites
Configure your Linux hosts
You will need to provision four hosts for this quick start. Each host should have a supported Linux operating system installed. To eliminate prompts for password, each host also needs to be SSH-accessible using certificate key pairs.
On machine provisioning
Azure users can follow a Microsoft guide on how to provision Azure VMs loaded with Linux. Google Cloud Platform users can follow a Google guide on how to provision GCP VMs with Linux loaded. You can use any virtual machine technology to host a Linux instance, too. Refer to your virtualization platform's documentation for instructions on how to create instances with Linux loaded on them.
Whichever cloud or VM platform you use, you need to make sure that each instance is accessible by SSH and that each instance can connect to the other instances. They can connect through either the public network or over a VPC for the cloud platforms. You can connect through your local network for on-premises VMs.
If you can't do this, you might want to consider the Docker or AWS quick start. These configurations are easier to set up and quicker to tear down. The AWS quick start, for example, automatically provisions compute instances and creates a VPC for those instances.
In this quick start, you will install PGD nodes onto four hosts configured in the cloud. Each of these hosts in this example is installed with Rocky Linux. Each has a public IP address to go with its private IP address.
Host name | Public IP | Private IP |
---|---|---|
linuxhost-1 | 172.19.16.27 | 192.168.2.247 |
linuxhost-2 | 172.19.16.26 | 192.168.2.41 |
linuxhost-3 | 172.19.16.25 | 192.168.2.254 |
linuxhost-4 | 172.19.16.15 | 192.168.2.30 |
These are example IP addresses. Substitute them with your own public and private IP addresses as you progress through the quick start.
Set up a host admin user
Each machine requires a user account to use for installation. For simplicity, use a user with the same name on all the hosts. On each host, also configure the user so that you can SSH into the host without being prompted for a password. Be sure to give that user sudo privileges on the host. On the four hosts, the user rocky is already configured with sudo privileges.
Preparation
EDB account
You'll need an EDB account to install both TPA and PGD.
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 are 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. Download and run a script to configure the EDB Postgres Distributed repository. This repository also contains the TPA packages.
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
:
TPA is now installed.
Installing PGD using TPA
Generating a configuration file
Run the tpaexec configure
command to generate a configuration folder:
You specify the PGD-Always-ON architecture (--architecture PGD-Always-ON
), which sets up the configuration for PGD 5's Always On architectures. As part of the default architecture, it configures your cluster with three data nodes, cohosting three PGD Proxy servers and a Barman