check mariadb galera status in every loop.

in extend_start.sh, if Mariadb galera is not ready at first time, it will sleep 60s and then exit 1.
we should check it`s status every time in the loop.

Change-Id: I89174969687eecbf467ca3cad9aad1bfbfb8c4fe
Closes-Bug: #1676316
This commit is contained in:
huweihua 2017-03-27 17:02:22 +08:00
parent 464ca08bfe
commit f1d143128e
1 changed files with 1 additions and 0 deletions

View File

@ -22,6 +22,7 @@ function bootstrap_db {
CLUSTER_READY=$(mysql -u root --exec="SHOW STATUS LIKE 'wsrep_ready'" | grep ON)
TIMEOUT=${DB_MAX_TIMEOUT:-60}
while [[ -z "${CLUSTER_READY}" ]]; do
CLUSTER_READY=$(mysql -u root --exec="SHOW STATUS LIKE 'wsrep_ready'" | grep ON)
if [[ ${TIMEOUT} -gt 0 ]]; then
let TIMEOUT-=1
sleep 1