Test if mysql respondes
This commit is contained in:
parent
c61a026326
commit
24e0966a78
1 changed files with 13 additions and 0 deletions
13
common-db/overlay/etc/sunet-machine-healthy/health-checks.d/db.check
Executable file
13
common-db/overlay/etc/sunet-machine-healthy/health-checks.d/db.check
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
|
||||
while true; do
|
||||
if /usr/bin/docker exec -it mariadb-db-1 mysql -p"$(puppet lookup --render-as s mariadb_root_password 2>/dev/null)" -e "show status like 'wsrep_cluster_status';" | grep -q Primary; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
sleep 3
|
||||
done
|
Loading…
Add table
Reference in a new issue