Loading pgpool/pgpool-II/pgpool-primary.conf +4 −4 Original line number Diff line number Diff line Loading @@ -296,7 +296,7 @@ sr_check_user = 'postgres' # sr_check_period = 0 sr_check_password = 'postgres' # Password for streaming replication check user delay_threshold = 0 delay_threshold = 131072 # Threshold before not dispatching query to standby node # Unit is in bytes # Disabled (0) by default Loading Loading @@ -511,7 +511,7 @@ wd_escalation_command = '' wd_lifecheck_method = 'heartbeat' # Method of watchdog lifecheck ('heartbeat' or 'query') # (change requires restart) wd_interval = 2 wd_interval = 5 # lifecheck interval (sec) > 0 # (change requires restart) Loading @@ -520,10 +520,10 @@ wd_interval = 2 wd_heartbeat_port = 9694 # Port number for receiving heartbeat signal # (change requires restart) wd_heartbeat_keepalive = 2 wd_heartbeat_keepalive = 1 # Interval time of sending heartbeat signal (sec) # (change requires restart) wd_heartbeat_deadtime = 6 wd_heartbeat_deadtime = 15 # Deadtime interval for heartbeat signal (sec) # (change requires restart) heartbeat_destination0 = '__PGPOOL_STANDBY_HOST__' Loading pgpool/pgpool-II/pgpool-standby.conf +4 −4 Original line number Diff line number Diff line Loading @@ -296,7 +296,7 @@ sr_check_user = 'postgres' # sr_check_period = 0 sr_check_password = 'postgres' # Password for streaming replication check user delay_threshold = 0 delay_threshold = 131072 # Threshold before not dispatching query to standby node # Unit is in bytes # Disabled (0) by default Loading Loading @@ -511,7 +511,7 @@ wd_escalation_command = '' wd_lifecheck_method = 'heartbeat' # Method of watchdog lifecheck ('heartbeat' or 'query') # (change requires restart) wd_interval = 2 wd_interval = 5 # lifecheck interval (sec) > 0 # (change requires restart) Loading @@ -520,10 +520,10 @@ wd_interval = 2 wd_heartbeat_port = 9694 # Port number for receiving heartbeat signal # (change requires restart) wd_heartbeat_keepalive = 2 wd_heartbeat_keepalive = 1 # Interval time of sending heartbeat signal (sec) # (change requires restart) wd_heartbeat_deadtime = 6 wd_heartbeat_deadtime = 15 # Deadtime interval for heartbeat signal (sec) # (change requires restart) heartbeat_destination0 = '__PGPOOL_PRIMARY_HOST__' Loading postgresql/bin/pg_failover +7 −1 Original line number Diff line number Diff line #!/bin/bash echo $1 NODE_ID=$1 HOST_NAME=$2 PORT_NUMBER=$3 Loading Loading @@ -29,7 +30,12 @@ if [ $NEW_MASTER_NODE_ID == -1 ]; then exit 0 fi if [ $NEW_MASTER_NODE_ID == $OLD_PRIMARY_NODE_ID ]; then #if [ $NEW_MASTER_NODE_ID == $OLD_PRIMARY_NODE_ID ]; then # echo "[INFO] Standby node is down. Failover not triggered!" # exit 0 #fi if [ $HOST_NAME == $NEW_MASTER_HOST_NAME ]; then echo "[INFO] Standby node is down. Failover not triggered!" exit 0 fi Loading postgresql/bin/pg_recovery +3 −2 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ function recovery () { # Stop backup psql -U $PG_USER -p $PG_PORT -c "SELECT pg_stop_backup()" su $PG_USER -c "rsync -azvh --delete --progress $PG_DATA/pg_xlog $PRIMARY_HOST:/$PG_DATA" # Reconfigure old primary cluster su $PG_USER -c "ssh $PRIMARY_HOST 'rm -rf /tmp/postgresql.trigger'" Loading @@ -83,7 +84,7 @@ function recovery () { su $PG_USER -c "ssh $PRIMARY_HOST 'echo '\''hot_standby = on'\'' >> $PG_CONF'" su $PG_USER -c "ssh $PRIMARY_HOST 'pg_ctl start -w -D $PG_DATA -s &>/dev/null'" #su $PG_USER -c "ssh $PRIMARY_HOST 'pgpool -n >> /var/log/pgpool/pgpool.log 2>&1 < /dev/null & '" echo -e "Need stop pgpool on old master system" echo -e "Need start pgpool on old master system" ssh $PRIMARY_HOST 'pgpool -n -D >> /var/log/pgpool/pgpool.log 2>&1 < /dev/null &' sleep 2 Loading Loading
pgpool/pgpool-II/pgpool-primary.conf +4 −4 Original line number Diff line number Diff line Loading @@ -296,7 +296,7 @@ sr_check_user = 'postgres' # sr_check_period = 0 sr_check_password = 'postgres' # Password for streaming replication check user delay_threshold = 0 delay_threshold = 131072 # Threshold before not dispatching query to standby node # Unit is in bytes # Disabled (0) by default Loading Loading @@ -511,7 +511,7 @@ wd_escalation_command = '' wd_lifecheck_method = 'heartbeat' # Method of watchdog lifecheck ('heartbeat' or 'query') # (change requires restart) wd_interval = 2 wd_interval = 5 # lifecheck interval (sec) > 0 # (change requires restart) Loading @@ -520,10 +520,10 @@ wd_interval = 2 wd_heartbeat_port = 9694 # Port number for receiving heartbeat signal # (change requires restart) wd_heartbeat_keepalive = 2 wd_heartbeat_keepalive = 1 # Interval time of sending heartbeat signal (sec) # (change requires restart) wd_heartbeat_deadtime = 6 wd_heartbeat_deadtime = 15 # Deadtime interval for heartbeat signal (sec) # (change requires restart) heartbeat_destination0 = '__PGPOOL_STANDBY_HOST__' Loading
pgpool/pgpool-II/pgpool-standby.conf +4 −4 Original line number Diff line number Diff line Loading @@ -296,7 +296,7 @@ sr_check_user = 'postgres' # sr_check_period = 0 sr_check_password = 'postgres' # Password for streaming replication check user delay_threshold = 0 delay_threshold = 131072 # Threshold before not dispatching query to standby node # Unit is in bytes # Disabled (0) by default Loading Loading @@ -511,7 +511,7 @@ wd_escalation_command = '' wd_lifecheck_method = 'heartbeat' # Method of watchdog lifecheck ('heartbeat' or 'query') # (change requires restart) wd_interval = 2 wd_interval = 5 # lifecheck interval (sec) > 0 # (change requires restart) Loading @@ -520,10 +520,10 @@ wd_interval = 2 wd_heartbeat_port = 9694 # Port number for receiving heartbeat signal # (change requires restart) wd_heartbeat_keepalive = 2 wd_heartbeat_keepalive = 1 # Interval time of sending heartbeat signal (sec) # (change requires restart) wd_heartbeat_deadtime = 6 wd_heartbeat_deadtime = 15 # Deadtime interval for heartbeat signal (sec) # (change requires restart) heartbeat_destination0 = '__PGPOOL_PRIMARY_HOST__' Loading
postgresql/bin/pg_failover +7 −1 Original line number Diff line number Diff line #!/bin/bash echo $1 NODE_ID=$1 HOST_NAME=$2 PORT_NUMBER=$3 Loading Loading @@ -29,7 +30,12 @@ if [ $NEW_MASTER_NODE_ID == -1 ]; then exit 0 fi if [ $NEW_MASTER_NODE_ID == $OLD_PRIMARY_NODE_ID ]; then #if [ $NEW_MASTER_NODE_ID == $OLD_PRIMARY_NODE_ID ]; then # echo "[INFO] Standby node is down. Failover not triggered!" # exit 0 #fi if [ $HOST_NAME == $NEW_MASTER_HOST_NAME ]; then echo "[INFO] Standby node is down. Failover not triggered!" exit 0 fi Loading
postgresql/bin/pg_recovery +3 −2 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ function recovery () { # Stop backup psql -U $PG_USER -p $PG_PORT -c "SELECT pg_stop_backup()" su $PG_USER -c "rsync -azvh --delete --progress $PG_DATA/pg_xlog $PRIMARY_HOST:/$PG_DATA" # Reconfigure old primary cluster su $PG_USER -c "ssh $PRIMARY_HOST 'rm -rf /tmp/postgresql.trigger'" Loading @@ -83,7 +84,7 @@ function recovery () { su $PG_USER -c "ssh $PRIMARY_HOST 'echo '\''hot_standby = on'\'' >> $PG_CONF'" su $PG_USER -c "ssh $PRIMARY_HOST 'pg_ctl start -w -D $PG_DATA -s &>/dev/null'" #su $PG_USER -c "ssh $PRIMARY_HOST 'pgpool -n >> /var/log/pgpool/pgpool.log 2>&1 < /dev/null & '" echo -e "Need stop pgpool on old master system" echo -e "Need start pgpool on old master system" ssh $PRIMARY_HOST 'pgpool -n -D >> /var/log/pgpool/pgpool.log 2>&1 < /dev/null &' sleep 2 Loading