kolla/docker/common/galera/config-internal.sh
Sam Yaple efbfd7912b Ansible Mariadb w/ Galera support
Adds initial support for Mariadb with Galera replication in Ansible
using the CONFIG_EXTERNAL methods.

Additionally, this refactors some of the Galera config script to allow
for reuse by CONFIG_EXTERNAL.

Partially Implements: blueprint ansible-service

Change-Id: I566fea0376ecca39fc8a5167f9ff9ff434ea7b7e
2015-07-03 13:56:06 +00:00

21 lines
583 B
Bash
Executable File

#!/bin/bash
. /opt/kolla/kolla-common.sh
. /opt/kolla/config-galera.sh
check_required_vars DB_CLUSTER_BIND_ADDRESS DB_CLUSTER_NAME DB_CLUSTER_NODES \
DB_ROOT_PASSWORD DB_CLUSTER_WSREP_METHOD DB_CLUSTER_INIT_DB
CFG=/etc/my.cnf.d/server.cnf
DB_CLUSTER_INIT_SQL=/tmp/mysql-first-time.sql
prepare_db
if [[ "${DB_CLUSTER_INIT_DB}" == "true" ]] && ! [[ -a /var/lib/mysql/cluster.exists ]]; then
DB_CLUSTER_IS_MASTER_NODE="--wsrep-new-cluster"
touch /var/lib/mysql/cluster.exists
fi
mysqld_safe --init-file=$DB_CLUSTER_INIT_SQL $DB_CLUSTER_IS_MASTER_NODE