PG detect script probes the cluster from the database server that is the primary database for Siemplify servers. This keeps Siemplify servers updated. The script has a parameter that stores the value of the primary database. The script updates when the primary database changes.
- Edit siemplify_pg_detect.sh by updating the following details before exit :set ff=unix.
- V_SERVER_NODE_1=”{primary_db_ip}”
- V_SERVER_NODE_2=”{slave_db_ip}”
- PRIMARY_NODE_1=$(PGPASSWORD={Your_Password_Here} psql -t -h $V_SERVER_NODE_1 -p 5432 -d postgres -U repuser -c “select conninfo from repmgr.nodes where type = ‘primary’ and active = ‘true’” | xargs)
- PRIMARY_NODE_2=$(PGPASSWORD={Your_Password_Here} psql -t -h $V_SERVER_NODE_2 -p 5432 -d postgres -U repuser -c “select conninfo from repmgr.nodes where type = ‘primary’ and active = ‘true’” | xargs)
- Once the file is updated, upload HA APP rpms.zip and siemplify_pg_detect.sh to both apps machines.
- Unzip HA APP rpms.zip and install the rpms on both apps machines.
- Unzip HA APP rmps.zip using the command:
unzip HA APP rpms.zip
- Continue to install the rpms using the command:
yum install postgresql10*P
- Unzip HA APP rmps.zip using the command:
- Configure the crontab job on both app machines with the following commands. Change to “root” user to execute the commands for the siemplify_pg_detect.sh script to run:
chmod +x /home/siemplify/siemplify_pg_detect.sh
crontab -l > /root/tmpjobs
echo reboot /home/siemplify/siemplify_pg_detect.sh >> /root/tmpjobs
crontab /root/tmpjobs
rm -f /root/tmpjobs
reboot - both nodes
- Verify that the process was completed successfully using the command:
ps -aux | grep siemplify*
Need more help with this?
Click here to open a Support ticket