summaryrefslogtreecommitdiffstats
path: root/root-galera/usr/share/container-scripts/mysql/galera-init
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2018-03-17 21:07:38 +0100
committerSuren A. Chilingaryan <csa@suren.me>2018-03-17 21:07:38 +0100
commit14d10bc21087e3734d4e7ac15883c76d0cd19818 (patch)
tree02600a93e7849e9f9e4ab9399c1258ec36cc2273 /root-galera/usr/share/container-scripts/mysql/galera-init
downloadmysql-galera-14d10bc21087e3734d4e7ac15883c76d0cd19818.tar.gz
mysql-galera-14d10bc21087e3734d4e7ac15883c76d0cd19818.tar.bz2
mysql-galera-14d10bc21087e3734d4e7ac15883c76d0cd19818.tar.xz
mysql-galera-14d10bc21087e3734d4e7ac15883c76d0cd19818.zip
MySQL 5.7 with Galera (produced as combination of standard MySQL container and openshift-mariadb-galera by adfinis-sygroup)
Diffstat (limited to 'root-galera/usr/share/container-scripts/mysql/galera-init')
-rw-r--r--root-galera/usr/share/container-scripts/mysql/galera-init/60-galera-config.sh6
-rw-r--r--root-galera/usr/share/container-scripts/mysql/galera-init/galera.cnf.template15
-rw-r--r--root-galera/usr/share/container-scripts/mysql/galera-init/galera.cnf.template.maria17
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