summaryrefslogtreecommitdiffstats
path: root/mysql/root-galera/usr/share/container-scripts/mysql/pre-init/30-ands-tuning.sh
diff options
context:
space:
mode:
Diffstat (limited to 'mysql/root-galera/usr/share/container-scripts/mysql/pre-init/30-ands-tuning.sh')
-rw-r--r--mysql/root-galera/usr/share/container-scripts/mysql/pre-init/30-ands-tuning.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql/root-galera/usr/share/container-scripts/mysql/pre-init/30-ands-tuning.sh b/mysql/root-galera/usr/share/container-scripts/mysql/pre-init/30-ands-tuning.sh
new file mode 100644
index 0000000..c717e9d
--- /dev/null
+++ b/mysql/root-galera/usr/share/container-scripts/mysql/pre-init/30-ands-tuning.sh
@@ -0,0 +1,24 @@
+export MYSQL_LOG_BIN=${MYSQL_LOG_BIN:-1}
+export MYSQL_SYNC_BINLOG=${MYSQL_SYNC_BINLOG:-0}
+export MYSQL_LOG_SLAVE_UPDATES=${MYSQL_LOG_SLAVE_UPDATES:-0}
+export MYSQL_BINLOG_SYNC_DELAY=${MYSQL_BINLOG_SYNC_DELAY:-0}
+export MYSQL_BINLOG_NODELAY_COUNT=${MYSQL_BINLOG_NODELAY_COUNT:-0}
+export MYSQL_FLUSH_LOG_TYPE=${MYSQL_FLUSH_LOG_TYPE:-2}
+export MYSQL_FLUSH_LOG_TIMEOUT=${MYSQL_FLUSH_LOG_TIMEOUT:-1}
+
+export MYSQL_SLAVE_WORKERS=${MYSQL_SLAVE_WORKERS:-4}
+export MYSQL_SLAVE_SKIP_ERRORS=${MYSQL_SLAVE_SKIP_ERRORS:-ddl_exist_errors}
+
+log_info 'Processing basic Ands configuration files ...'
+envsubst < ${CONTAINER_SCRIPTS_PATH}/pre-init/ands-tuning.cnf.template > /etc/my.cnf.d/ands-tuning.cnf
+
+if [ -v MYSQL_RUNNING_AS_SLAVE ] ; then
+ log_info 'Processing basic Ands configuration for replication (slave only) files ...'
+ envsubst < ${CONTAINER_SCRIPTS_PATH}/pre-init/ands-slave.cnf.template > /etc/my.cnf.d/ands-slave.cnf
+
+ if [ $MYSQL_LOG_BIN -ne 0 ]; then
+ log_info 'Enabling log-bin in slave configuration files ...'
+ envsubst < ${CONTAINER_SCRIPTS_PATH}/pre-init/ands-slave-logbin.cnf.template > /etc/my.cnf.d/ands-slave-logbin.cnf
+ fi
+fi
+