Example: Deploying EDB Postgres Distributed v4

The following steps setup EDB Postgres Distributed with the Always On Silver architecture using Amazon EC2.

  1. Generate a configuration file:

    $ tpaexec configure myedbdpcluster --architecture BDR-Always-ON --layout silver --platform aws --bdr-version 4 --2q --2Q-repositories products/2ndqpostgres/release

    This creates a subdirectory directory in current working directory called myedbdpcluster containing the config.yml configuration file TPAexec uses to create the cluster. Edit the config.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).

    cd ~/clusters/myedbdpcluster
    
    export TPA_2Q_SUBSCRIPTION_TOKEN=<token>
  2. Provision the cluster:

    tpaexec provision myedbdpcluster

    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.

  3. Deploy the cluster:

    tpaexec deploy myedbdpcluster

    TPAexec installs the needed packages, appliies the configuration and sets up the actual EDB Postgres Distributed cluster

  4. Test the cluster:

    After the successful run of the deploy command the cluster is ready to use. You can connect to it via psql or any other database client.

    It's also possible to run a test that ensures the cluster is running as expected:

    tpaexec test myedbdpcluster