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.
- On the primary node, set the postgres password using the following commands:
su - postgres
psql -c "alter role postgres password '{postgres_user_Password_here}';"
exit
- 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}';"
exit
- Change directory to /tmp
cd /tmp
- Create the REPMGR extension for both PostgreSQL servers using the command:
sudo -u postgres psql -c "CREATE EXTENSION repmgr;"
- 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
- Copy and paste the following command to be the last line:
export PATH=/usr/pgsql-10/bin:$PATH
- 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