After configuring the PostgreSQL, we need to restart PostgreSQL:
- Enter the command
systemctl restart postgresql-10
- After restarting we need to open the default port (5432) using firewall-cmd:
(root)firewall-cmd --add-port=5432/tcp --permanent
firewall-cmd --reload
- Enter the following commands on the primary node ONLY:
su - postgres
psql -c "alter role postgres password '<postgres user password>';"
exit
- On all nodes create a user (role) in PostgreSQL to perform the replication. The user has to have the replication role on all nodes:
su - postgres
psql -c "CREATE ROLE repuser LOGIN SUPERUSER REPLICATION PASSWORD '<postgres user password>';"
exit
- Create the REPMGR extension once for each PostgreSQL server:
su - postgres
psql -c "CREATE EXTENSION repmgr;"
exit
- Finally, we need to update the path in “~/.bash_profile” (user: root). Add the following line to the bash_profile file (Note the commands are case-sensitive):
vi /root/.bash_profile
Replace“export PATH”
with“export PATH=/usr/pgsql-10/bin:$PATH”
source /root/.bash_profile
- Validate by running
“repmgr”
, you will get an error message“cannot be run as root
Need more help with this?
Click here to open a Support ticket