How to do it…

You can use the following procedure for base backups:

  1. Identify your master and standby nodes, and ensure that they have been configured according to the Replication best practices recipe.
  2. Configure replication security. Create or confirm the existence of the replication user on the master node:
CREATE USER repuser  REPLICATION  LOGIN  CONNECTION LIMIT 2  ENCRYPTED PASSWORD 'changeme';
  1. Allow the replication user to authenticate. The following example allows access from any IP address using MD5-encrypted password authentication; you may wish to consider other options. Add the following line to pg_hba.conf:
host   replication   repuser   0.0.0.1/0   md5
  1. Set the logging options in postgresql.conf on both the master and the standby so that ...

Get PostgreSQL 10 Administration Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.