407d774ffb
Use the healthcheck_mariadb script to check the status of mariadb Related patch of kolla-ansible: https://review.opendev.org/c/openstack/kolla-ansible/+/780404 Change-Id: I9e8fb8fab1adba03aba4ed9ce42e4d4666bc764b
20 lines
446 B
Bash
Executable File
20 lines
446 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
MYSQL_USERNAME="${MYSQL_USERNAME:=-haproxy}"
|
|
MYSQL_TIMEOUT=10
|
|
|
|
MYSQL_CMDLINE="mysql -sN --connect-timeout=${MYSQL_TIMEOUT} -u ${MYSQL_USERNAME}"
|
|
|
|
WSREP_STATUS=$($MYSQL_CMDLINE -e "SHOW STATUS LIKE 'wsrep_local_state_comment';" | awk '{print $2}')
|
|
|
|
if [[ "${WSREP_STATUS}" == "Synced" ]]
|
|
then
|
|
echo "MariaDB Galera Cluster Node is synced."
|
|
exit 0
|
|
else
|
|
echo "MariaDB Galera Cluster Node is NOT synced"
|
|
exit 1
|
|
fi
|