-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bash | ||
# https://github.com/paunin/PostDock/issues/225 | ||
docker-compose up -d pgmaster pgslave1 pgslave3 | ||
set -e | ||
|
||
docker-compose exec -T pgmaster wait_local_postgres | ||
docker-compose exec -T pgslave1 wait_local_postgres | ||
docker-compose exec -T pgslave3 wait_local_postgres | ||
sleep 10 | ||
|
||
# Result matrix should look like this(5 rows, 3 rows with stars but with no question marks): | ||
# | ||
# Name | Id | 1 | 2 | 4 | ||
# ------+----+----+----+---- | ||
# node1 | 1 | * | * | * | ||
# node2 | 2 | * | * | * | ||
# node4 | 4 | * | * | * | ||
|
||
for CONTAINER in "pgmaster" "pgslave1" "pgslave3"; do | ||
echo "Checking CONTAINER=$CONTAINER" | ||
UNKNOWN_NUMBER=`docker-compose exec $CONTAINER bash -c 'gosu postgres repmgr cluster crosscheck 2>/dev/null' | grep -v '?' | grep '*' | wc -l | tr -d ' '` | ||
if [[ "3" != "$UNKNOWN_NUMBER" ]]; then | ||
echo ">>> CrossCheck failed for CONTAINER=$CONTAINER (UNKNOWN_NUMBER=$UNKNOWN_NUMBER)" | ||
exit 1 | ||
fi | ||
done | ||
|
||
|
||
|