Creating a Replication User on the Primary

For replication to work, you’ll need a PostgreSQL user on db01. Remember that users in PostgreSQL are ROLE objects that have the LOGIN privilege. Besides LOGIN, the replication user gets the REPLICATION privilege granted.

You’ll create the user on db01, then use the credentials for that user to initialize the replication process from replica instances.

Let’s configure db02 to act as a replica. The replication user must already exist on the primary instance. You’ll use the credentials on the replica to connect. Besides the credentials, you’ll grab the IP address of the replica.

To permit access to ‘db01‘, use the PostgreSQL Host-Based Authentication (HBA) file. This file is on the primary instance

Get High Performance PostgreSQL for Rails now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.