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.

  1. Edit siemplify_pg_detect.sh by updating the following details before exit :set ff=unix.
    1. V_SERVER_NODE_1=”{primary_db_ip}”
    2. V_SERVER_NODE_2=”{slave_db_ip}”
    3. 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)
    4. 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)
  2. Once the file is updated, upload HA APP rpms.zip and siemplify_pg_detect.sh to both apps machines.  

    You can use WinSCP, SCP, Wget CURL or any other program for secure file sharing working on Linux as illustrated during Siemplify server node installation.

  3. Unzip HA APP rpms.zip and install the rpms on both apps machines.
    1. Unzip HA APP rmps.zip using the command:
      unzip HA APP rpms.zip
    2. Continue to install the rpms using the command:
      yum install postgresql10*P
  4. 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

    The path to the script is dependent on the path to which you downloaded the file.

  5. Verify that the process was completed successfully using the command:
    ps -aux | grep siemplify*