diff options
| -rw-r--r-- | docker/mariadb/extend_start.sh | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/docker/mariadb/extend_start.sh b/docker/mariadb/extend_start.sh index 1402a6381..83180cb47 100644 --- a/docker/mariadb/extend_start.sh +++ b/docker/mariadb/extend_start.sh @@ -1,7 +1,7 @@ #!/bin/bash function bootstrap_db { - mysqld_safe --wsrep-new-cluster --skip-networking --wsrep-on=OFF --pid-file=/var/lib/mysql/mariadb.pid & + mysqld_safe --skip-networking --wsrep-on=OFF --pid-file=/var/lib/mysql/mariadb.pid & # Wait for the mariadb server to be "Ready" before starting the security reset with a max timeout # NOTE(huikang): the location of mysql's socket file varies depending on the OS distributions. # Querying the cluster status has to be executed after the existence of mysql.sock and mariadb.pid. @@ -16,21 +16,7 @@ function bootstrap_db { exit 1 fi done -# NOTE(sbezverk): Currently kolla-kubernetes does not use Galera and disables wsrep driver. -# This check will run only for non kolla-kubernetes bootstrap deployments. - if [[ ! "${!KOLLA_KUBERNETES[@]}" ]]; then - 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 - else - exit 1 - fi - done - fi + sudo -E kolla_security_reset mysql -u root --password="${DB_ROOT_PASSWORD}" -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '${DB_ROOT_PASSWORD}' WITH GRANT OPTION;" mysql -u root --password="${DB_ROOT_PASSWORD}" -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '${DB_ROOT_PASSWORD}' WITH GRANT OPTION;" |
