kolla/docker/mariadb-app/config-mysql.sh
Daneyon Hansen 5547b5fe78 Implements: blueprint Implement a database container set
Previously, the database container was configured for use with
Kubernetes. This patch removed any k8s dependencies, adds a script
to manage mysql server.cnf settings and splits data and app
containers. Splitting the containers provides additional
portability and operational efficiencies compared to host mounts.

Change-Id: I80656450c02dda5f2959d187eec20d5877dc54a2
2015-03-20 16:17:51 +00:00

25 lines
893 B
Bash
Executable File

#!/bin/sh
. /opt/kolla/kolla-common.sh
: ${BIND_ADDRESS:=$PUBLIC_IP}
: ${DB_ROOT_PASSWORD:=$DB_ROOT_PASSWORD}
: ${DEFAULT_STORAGE_ENGINE:=innodb}
: ${COLLATION_SERVER:=utf8_general_ci}
: ${INIT_CONNECT:=SET NAMES utf8}
: ${CHAR_SET_SERVER:=utf8}
: ${INNODB_FILE_PER_TABLE:=true}
: ${DATADIR:=/var/lib/mysql}
: ${TEMP_FILE:='/tmp/mysql-first-time.sql'}
server_cnf=/etc/my.cnf.d/server.cnf
crudini --set $server_cnf mysqld bind-address $BIND_ADDRESS
crudini --set $server_cnf mysqld default-storage-engine $DEFAULT_STORAGE_ENGINE
crudini --set $server_cnf mysqld collation-server $COLLATION_SERVER
crudini --set $server_cnf mysqld init-connect "'${INIT_CONNECT}'"
crudini --set $server_cnf mysqld character-set-server $CHAR_SET_SERVER
if [ "${INNODB_FILE_PER_TABLE}" == "true" ] || ["${INNODB_FILE_PER_TABLE}" == "True" ] ; then
crudini --set $server_cnf mysqld innodb_file_per_table 1
fi