Starting multiple postmasters with different clusters v16

You can configure EDB Postgres Advanced Server to use multiple postmasters, each with its own database cluster. The steps required are specific to the version of the Linux host.

On RHEL/CentOS 7.x or RHEL/Rocky Linux/AlmaLinux 8.x | 9.x

The edb-as16-server-core RPM for version 7.x | 8.x | 9.x contains a unit file that starts the EDB Postgres Advanced Server instance. The file allows you to start multiple services with unique data directories and monitor different ports. You need root access to invoke or modify the script.

This example creates an EDB Postgres Advanced Server installation with two instances. The secondary instance is named secondary.

  • Make a copy of the default file with the new name. As noted at the top of the file, all modifications must reside under /etc. You must pick a name that isn't already used in /etc/systemd/system.

    cp /usr/lib/systemd/system/edb-as-16.service /etc/systemd/system/secondary-edb-as-15.service
  • Edit the file, changing PGDATA to point to the new data directory that you're creating the cluster against.

  • Create the target PGDATA with the user enterprisedb.

  • Run initdb, specifying the setup script:

    /usr/edb/as16/bin/edb-as-16-setup initdb secondary-edb-as-16
  • Edit the postgresql.conf file for the new instance, specifying the port, the IP address, TCP/IP settings, and so on.

  • Make sure that the new cluster runs after a reboot:

    systemctl enable secondary-edb-as-16
  • Start the second cluster:

    systemctl start secondary-edb-as-16