diff options
Diffstat (limited to 'root-galera/usr/share/container-scripts/mysql/galera-init')
3 files changed, 38 insertions, 0 deletions
diff --git a/root-galera/usr/share/container-scripts/mysql/galera-init/60-galera-config.sh b/root-galera/usr/share/container-scripts/mysql/galera-init/60-galera-config.sh new file mode 100644 index 0000000..3b9fa31 --- /dev/null +++ b/root-galera/usr/share/container-scripts/mysql/galera-init/60-galera-config.sh @@ -0,0 +1,6 @@ +if [ -v POD_NAMESPACE ]; then + export MYSQL_GALERA_CLUSTER="$(hostname -f | cut -d'.' -f2)" + + log_info 'Processing basic Galera configuration files ...' + envsubst < ${CONTAINER_SCRIPTS_PATH}/galera-init/galera.cnf.template > /etc/my.cnf.d/galera.cnf +fi diff --git a/root-galera/usr/share/container-scripts/mysql/galera-init/galera.cnf.template b/root-galera/usr/share/container-scripts/mysql/galera-init/galera.cnf.template new file mode 100644 index 0000000..e1013d7 --- /dev/null +++ b/root-galera/usr/share/container-scripts/mysql/galera-init/galera.cnf.template @@ -0,0 +1,15 @@ +[mysqld] +wsrep_on = ON +wsrep_provider = /usr/lib64/galera-3/libgalera_smm.so +wsrep_sst_auth=${MYSQL_GALERA_USER}:${MYSQL_GALERA_PASSWORD} +wsrep_cluster_name=${MYSQL_GALERA_CLUSTER} +#wsrep_provider_options="gcache.size=300M; gcache.page_size=300M" +wsrep_sst_method = xtrabackup-v2 +default_storage_engine = innodb +binlog_format = row + +# Performance settings +innodb_autoinc_lock_mode = 2 +innodb_flush_log_at_trx_commit = 0 +query_cache_size = 0 +query_cache_type = 0 diff --git a/root-galera/usr/share/container-scripts/mysql/galera-init/galera.cnf.template.maria b/root-galera/usr/share/container-scripts/mysql/galera-init/galera.cnf.template.maria new file mode 100644 index 0000000..3adbf58 --- /dev/null +++ b/root-galera/usr/share/container-scripts/mysql/galera-init/galera.cnf.template.maria @@ -0,0 +1,17 @@ +[galera] +wsrep_on = ON +wsrep_provider = /usr/lib64/galera/libgalera_smm.so +wsrep_sst_method = xtrabackup-v2 +default_storage_engine = innodb +binlog_format = row +innodb_autoinc_lock_mode = 2 +innodb_flush_log_at_trx_commit = 0 +query_cache_size = 0 +query_cache_type = 0 + +wsrep_sst_auth=${MYSQL_GALERA_USER}:${MYSQL_GALERA_PASSWORD} +wsrep_cluster_name=${MYSQL_GALERA_CLUSTER} + +# By default every node is standalone +wsrep_cluster_address=gcomm:// +wsrep_node_address=127.0.0.1 |