wait for replication to start
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 22 Aug 2017 08:08:59 +0000 (10:08 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 22 Aug 2017 08:08:59 +0000 (10:08 +0200)
streaming-replication.sh

index eb60acb..87b5922 100755 (executable)
@@ -154,6 +154,14 @@ StartLocalAndThenRemotePostGreSql () {
     else
         echo "[OK] Master started.";
     fi
+
+       echo -n "[INFO] Wating for replication to start "
+       while [ "`psql -c 'SELECT * from pg_stat_replication' -h 10.200.1.61 -t postgres postgres | wc -l`" -lt 2 ] ; do
+               echo -n .
+               sleep 1
+       done
+       echo "OK"
+
 }
 
 #Execute above operations