The following steps should be taken when you already have installed the primary and secondary node with PostgreSQL and REPMGR as described in the previous topic.

  1. On the primary node, set the postgres password using the following commands:
    su - postgres
    psql -c "alter role postgres password '{postgres_user_Password_here}';"
  1. Create a user (role) in PostgreSQL to perform the replication on both nodes. The user must have the replication role:
    su - postgres
    psql -c "CREATE ROLE repuser LOGIN SUPERUSER REPLICATION PASSWORD '{repuser_user_Password_here}';"
  1. Change directory to /tmp
    cd /tmp
  1. Create the REPMGR extension for both PostgreSQL servers using the command:
    sudo -u postgres psql -c "CREATE EXTENSION repmgr;"
  1. Update PostgreSQL path in “~/.bash_profile.” so PostgreSQL is convenient to use. Then, run the following commands while logged in as the “root” user to open the bash profile. cd /root/ vi .bash_profile
  1. Copy and paste the following command to be the last line:
    export PATH=/usr/pgsql-10/bin:$PATH

  1. Save and exit by typing :wq.

After this is complete, you will configure REPMGR on the primary node.

Need more help with this?
Click here to open a Support ticket

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.