Created
September 26, 2024 11:42
-
-
Save binakot/32aa3256b920f69f1c4640b62138d5a4 to your computer and use it in GitHub Desktop.
PostgreSQL Cluster Checkup Report
This file contains hidden or 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
#!/bin/bash | |
set -ex | |
MASTER_HOST="192.168.1.1" | |
REPLICA_1_HOST="192.168.1.2" | |
REPLICA_2_HOST="192.168.1.3" | |
DB_NAME="postgres" | |
TIME_DIFF="3600" # 1 hour | |
for host in $MASTER_HOST $REPLICA_1_HOST $REPLICA_2_HOST; do | |
docker run --rm \ | |
--name postgres-checkup \ | |
--volume `pwd`/artifacts:/checkup/artifacts \ | |
--volume "$(echo ~)/.ssh/id_ed25519:/root/.ssh/id_ed25519:ro" \ | |
postgresai/postgres-checkup:latest \ | |
./checkup \ | |
--hostname root@"$host" \ | |
--username postgres \ | |
--dbname $DB_NAME \ | |
--project prod \ | |
--epoch "$(date +'%Y%m%d')001" | |
done | |
sleep "$TIME_DIFF" | |
for host in $MASTER_HOST $REPLICA_1_HOST $REPLICA_2_HOST; do | |
docker run --rm \ | |
--name postgres-checkup \ | |
--volume `pwd`/artifacts:/checkup/artifacts \ | |
--volume "$(echo ~)/.ssh/id_ed25519:/root/.ssh/id_ed25519:ro" \ | |
postgresai/postgres-checkup:latest \ | |
./checkup \ | |
--hostname root@"$host" \ | |
--username postgres \ | |
--dbname $DB_NAME \ | |
--project prod \ | |
--epoch "$(date +'%Y%m%d')001" | |
done |
Author
binakot
commented
Sep 26, 2024
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment