Example: Deploying EDB Postgres Distributed v4
The following steps setup EDB Postgres Distributed with the Always On Silver architecture using Amazon EC2.
Generate a configuration file:
This creates a subdirectory directory in current working directory called
myedbdpcluster
containing theconfig.yml
configuration file TPAexec uses to create the cluster. Edit theconfig.yml
as needed, for example to change the IP address range used for servers or adjust locations of nodes.We included options to specify using BDR 4 (the default version) and the 2ndQuadrant repositories to install EDB Postgres Extended Server. By default, TPAexec installs the 2ndQuadrant public repository and adds on any product repositories that the architecture requires. In this example, we specified
--2Q-repositories
so the complete list of 2ndQuadrant repositories is installed on each instance in addition to the 2ndQuadrant public repository. Since we did this, before the provisioning step, you must first export TPA_2Q_SUBSCRIPTION_TOKEN=xxx. You can get a subscription token from the EnterpriseDB customer portal (Support > Software subscriptions > Add).Provision the cluster:
Since we specified AWS as the platform (the default platform), TPAexec provisions EC2 instances, VPCs, subnets, routing tables, internet gateways, security groups, EBS volumes, elastic IPs, and so on.
Deploy the cluster:
TPAexec installs the needed packages, appliies the configuration and sets up the actual EDB Postgres Distributed cluster
Test the cluster:
After the successful run of the
deploy
command the cluster is ready to use. You can connect to it viapsql
or any other database client.It's also possible to run a test that ensures the cluster is running as expected: