diff options
Diffstat (limited to 'docker')
| -rw-r--r-- | docker/mariadb-server/Dockerfile.j2 | 2 | ||||
| -rw-r--r-- | docker/mariadb-server/backup_replica.sh | 3 | ||||
| -rw-r--r-- | docker/mariadb-server/extend_start.sh | 14 |
3 files changed, 10 insertions, 9 deletions
diff --git a/docker/mariadb-server/Dockerfile.j2 b/docker/mariadb-server/Dockerfile.j2 index ddb045fbb..8d17ff4ff 100644 --- a/docker/mariadb-server/Dockerfile.j2 +++ b/docker/mariadb-server/Dockerfile.j2 @@ -43,7 +43,7 @@ RUN ln -s /usr/lib64/galera-4 /usr/lib64/galera {{ macros.install_packages(mariadb_packages | customizable("packages")) }} {% block mariadb_healthcheck %} -ENV MARIADB_VERSION=10.11 +ENV MARIADB_VERSION=11.4 ADD plugins-archive / RUN install -m 755 /plugins/mariadb-server-plugin-mariadb-docker-archive*/$MARIADB_VERSION/healthcheck.sh /usr/bin/healthcheck.sh {% endblock %} diff --git a/docker/mariadb-server/backup_replica.sh b/docker/mariadb-server/backup_replica.sh index ebdcbf6b0..fe10bc61b 100644 --- a/docker/mariadb-server/backup_replica.sh +++ b/docker/mariadb-server/backup_replica.sh @@ -8,6 +8,7 @@ DEFAULT_MY_CNF="/etc/mysql/my.cnf" REPLICA_MY_CNF="$(mktemp)" RETRY_INTERVAL=5 # Interval between retries (in seconds) MAX_RETRIES=12 # Max retries (12 retries * 5 seconds = 60 seconds) +VERIFY_DB_SERVER_CERT="${VERIFY_DB_SERVER_CERT:=FALSE}" # Cleanup function to remove the REPLICA_MY_CNF file cleanup() { @@ -74,7 +75,7 @@ retry_mysql_query() { local attempt=1 while [ ${attempt} -le ${MAX_RETRIES} ]; do - result=$(mysql -h "${HOST}" -u "${USER}" -p"${PASS}" -s -N -e "${query}" 2>/dev/null || true) + result=$(mariadb --ssl-verify-server-cert="${VERIFY_DB_SERVER_CERT}" -h "${HOST}" -u "${USER}" -p"${PASS}" -s -N -e "${query}" 2>/dev/null || true) if [ -n "${result}" ]; then echo "${result}" return 0 diff --git a/docker/mariadb-server/extend_start.sh b/docker/mariadb-server/extend_start.sh index 53a54557d..f14c85949 100644 --- a/docker/mariadb-server/extend_start.sh +++ b/docker/mariadb-server/extend_start.sh @@ -3,7 +3,7 @@ : ${MARIADB_LOG_DIR:=/var/log/kolla/mariadb} function bootstrap_db { - mysqld_safe --wsrep-new-cluster --skip-networking --wsrep-on=OFF --pid-file=/var/lib/mysql/mariadb.pid & + mariadbd-safe --wsrep-new-cluster --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. @@ -22,9 +22,9 @@ function bootstrap_db { sudo -E kolla_security_reset set +o xtrace - 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;" - mysqladmin -uroot -p"${DB_ROOT_PASSWORD}" shutdown + mariadb -u root --password="${DB_ROOT_PASSWORD}" -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '${DB_ROOT_PASSWORD}' WITH GRANT OPTION;" + mariadb -u root --password="${DB_ROOT_PASSWORD}" -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '${DB_ROOT_PASSWORD}' WITH GRANT OPTION;" + mariadb-admin -uroot -p"${DB_ROOT_PASSWORD}" shutdown set -o xtrace } @@ -38,21 +38,21 @@ fi # This catches all cases of the BOOTSTRAP variable being set, including empty if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then - mysql_install_db 2>&1 | tee -a ${MARIADB_LOG_DIR}/mariadb-bootstrap.log + mariadb-install-db 2>&1 | tee -a ${MARIADB_LOG_DIR}/mariadb-bootstrap.log bootstrap_db 2>&1 | tee -a ${MARIADB_LOG_DIR}/mariadb-bootstrap.log exit 0 fi # This catches all cases of the KOLLA_UPGRADE variable being set, including empty if [[ "${!KOLLA_UPGRADE[@]}" ]]; then - # The mysql_upgrade command treats any directories under /var/lib/mysql as + # The mariadb-upgrade command treats any directories under /var/lib/mysql as # databases. Somehow we can end up with a .pki directory, which causes the # command to fail with this error: # Incorrect database name '#mysql50#.pki' when selecting the database # There doesn't seem to be anything in the directory, so remove it. rm -rf /var/lib/mysql/.pki - mysql_upgrade --host=${DB_HOST} --port=${DB_PORT} --user=root --password="${DB_ROOT_PASSWORD}" 2>&1 | tee -a ${MARIADB_LOG_DIR}/mariadb-upgrade.log + mariadb-upgrade --host=${DB_HOST} --port=${DB_PORT} --user=root --password="${DB_ROOT_PASSWORD}" 2>&1 | tee -a ${MARIADB_LOG_DIR}/mariadb-upgrade.log exit 0 fi |
