upgrade pgpool to 3.6.6
[pgpool-online-recovery] / Makefile
index 7423358..0399166 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,12 +2,13 @@ PRIMARY=$(shell ./t/99-primary-ip.sh)
 
 all:
        @echo "make push"
-       PAGER= psql -h 10.200.1.60 -c 'show pool_nodes' postgres postgres
+       PAGER= psql -h 10.200.1.60 -p 9999 -c 'show pool_nodes' postgres postgres
        PAGER= psql -h $(PRIMARY) -c 'SELECT * from pg_stat_replication' postgres postgres
 
 init:
        sh -xe ./t/0-ssh-deploy.sh
        sh -xe ./t/1-init-cluster.sh
+       sh -xe ./t/2-init-pgpool.sh
 
 pull:
        exit 1
@@ -50,10 +51,8 @@ push-pg:
 restart:
        #ssh root@10.200.1.61 systemctl restart postgresql-9.6
        #ssh root@10.200.1.62 systemctl restart postgresql-9.6
-       ssh root@10.200.1.61 rm /var/log/pgpool/pgpool_status
-       ssh root@10.200.1.61 systemctl restart pgpool
-       ssh root@10.200.1.62 rm /var/log/pgpool/pgpool_status
-       ssh root@10.200.1.62 systemctl restart pgpool
+       ssh root@10.200.1.61 'systemctl stop pgpool ; rm -v /var/log/pgpool/pgpool_status /tmp/.s.PGSQL.9* ; systemctl start pgpool'
+       ssh root@10.200.1.62 'systemctl stop pgpool ; rm -v /var/log/pgpool/pgpool_status /tmp/.s.PGSQL.9* ; systemctl start pgpool'
 
 status:
        ssh root@10.200.1.61 systemctl status pgpool
@@ -62,4 +61,4 @@ status:
        ssh root@10.200.1.62 systemctl status postgresql-9.6
 
 fix:
-       ssh root@10.200.1.60 /etc/pgpool-II/online-recovery.sh
+       ssh root@10.200.1.60 sudo -u postgres sh -xe /etc/pgpool-II/online-recovery.sh