all queries via pgpool 10.200.1.60:9999
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 31 Aug 2017 13:43:10 +0000 (15:43 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 31 Aug 2017 13:44:57 +0000 (15:44 +0200)
pg_hba.conf
t/2-init-pgpool.sh
t/3-test.sh
t/80-insert-test.sh

index e3ab457..405a074 100644 (file)
@@ -101,5 +101,6 @@ host    replication     replication     10.200.1.62/32          trust
 # management node
 host    all             all             10.200.1.1/32           trust
 # allow postgres management
-host    postgres        postgres     10.200.1.61/32          trust
-host    postgres        postgres     10.200.1.62/32          trust
+host    all             postgres        10.200.1.61/32          trust
+host    all             postgres        10.200.1.62/32          trust
+
index 0d2a41c..6834a48 100755 (executable)
@@ -37,10 +37,6 @@ ssh root@10.200.1.61 'echo 0 > /tmp/postgres_master'
 
 make push-pgpool
 
-# init pgpool
-#ssh root@10.200.1.60 rm -f /var/log/pgpool/pgpool_status
-#echo 0 | ssh root@10.200.1.60 'cat > /tmp/postgres_master'
-
-ssh root@10.200.1.61 systemctl restart pgpool
-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'
 
index fb45fb8..9f509a0 100755 (executable)
@@ -3,15 +3,15 @@
 export PAGER=''
 
 # test database
-psql -h 10.200.1.60 -c 'create database test' --user postgres
+psql -h 10.200.1.60 -p 9999 -c 'create database test' --user postgres
 
-psql -h 10.200.1.60 --user postgres -l
+psql -h 10.200.1.60 -p 9999 --user postgres -l
 
-psql -h 10.200.1.60 -f t/1-create-test.sql test postgres 
+psql -h 10.200.1.60 -p 9999 -f t/1-create-test.sql test postgres 
 
-psql -c 'SELECT * from pg_stat_replication' -h 10.200.1.61 postgres postgres
+psql -c 'SELECT * from pg_stat_replication' -h 10.200.1.60 -p 9999 postgres postgres
 
-psql -h 10.200.1.60 -c 'select * from t' test postgres
-psql -h 10.200.1.61 -c 'select * from t' test postgres
-psql -h 10.200.1.62 -c 'select * from t' test postgres
+psql -h 10.200.1.60 -p 9999 -c 'select * from t' test postgres
+psql -h 10.200.1.61         -c 'select * from t' test postgres
+psql -h 10.200.1.62         -c 'select * from t' test postgres
 
index 425108b..ea6c108 100755 (executable)
@@ -1,9 +1,9 @@
 #!/bin/sh
 
-id=`psql -h 10.200.1.60 -t -c "select max(id)+1 from t" test postgres`
+id=`psql -h 10.200.1.60 -p 9999 -t -c "select max(id)+1 from t" test postgres`
 
 while true ; do
-       psql -h 10.200.1.60 -t \
+       psql -h 10.200.1.60 -p 9999 -t \
                -c "insert into t (a,b) values ('t',$id)" \
                -c "select * from t order by id desc limit 1" \
                test postgres