# SET UP POSTGRESQL 9.6 MASTER-SLAVE REPLICATION USING REPMGR Follow this blog for 9.6 https://edwardsamuel.wordpress.com/2016/04/28/set-up-postgresql-9-5-master-slave-replication-using-repmgr/ ### Changes Keep replication config separate as explained [here](https://github.com/2ndQuadrant/repmgr#postgresql-configuration). While cloning slave use following: ```bash POSTGRES_VERSION=9.6 sudo service postgresql stop sudo -u postgres rm -r /var/lib/postgresql/${POSTGRES_VERSION}/main sudo -u postgres repmgr -h repmgr_node1 -U repmgr -d repmgr -D /var/lib/postgresql/${POSTGRES_VERSION}/main -f /etc/repmgr.conf standby clone --copy-external-config-files=pgdata # Do manually copy `postgresql.replication.conf` file also sudo mv /var/lib/postgresql/${POSTGRES_VERSION}/main/pg_hba.conf /etc/postgresql/${POSTGRES_VERSION}/main/pg_hba.conf sudo mv /var/lib/postgresql/${POSTGRES_VERSION}/main/postgresql.conf /etc/postgresql/${POSTGRES_VERSION}/main/postgresql.conf sudo mv /var/lib/postgresql/${POSTGRES_VERSION}/main/pg_ident.conf /etc/postgresql/${POSTGRES_VERSION}/main/pg_ident.conf sudo service postgresql start ```