File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # https://github.com/paunin/PostDock/issues/225
3+ docker-compose up -d pgmaster pgslave1 pgslave3
4+ set -e
5+
6+ docker-compose exec -T pgmaster wait_local_postgres
7+ docker-compose exec -T pgslave1 wait_local_postgres
8+ docker-compose exec -T pgslave3 wait_local_postgres
9+ sleep 10
10+
11+ # Result matrix should look like this(5 rows, 3 rows with stars but with no question marks):
12+ #
13+ # Name | Id | 1 | 2 | 4
14+ # ------+----+----+----+----
15+ # node1 | 1 | * | * | *
16+ # node2 | 2 | * | * | *
17+ # node4 | 4 | * | * | *
18+
19+ for CONTAINER in " pgmaster" " pgslave1" " pgslave3" ; do
20+ echo " Checking CONTAINER=$CONTAINER "
21+ UNKNOWN_NUMBER=` docker-compose exec $CONTAINER bash -c ' gosu postgres repmgr cluster crosscheck 2>/dev/null' | grep -v ' ?' | grep ' *' | wc -l | tr -d ' ' `
22+ if [[ " 3" != " $UNKNOWN_NUMBER " ]]; then
23+ echo " >>> CrossCheck failed for CONTAINER=$CONTAINER (UNKNOWN_NUMBER=$UNKNOWN_NUMBER )"
24+ exit 1
25+ fi
26+ done
27+
28+
29+
You can’t perform that action at this time.
0 commit comments