efbfd7912b
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
21 lines
583 B
Bash
Executable File
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
|
|
|