Commit 787bf242 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Added CWMP settings to control binlog filtering on master

parent a97a0aed
......@@ -42,6 +42,8 @@ all: client-cnf mysql-clients-cnf server-cnf mariadb-config
@echo "$$MARIADB_CONFIG" > /etc/config/mariadb
install -v -Dm755 mariadb /usr/share/easycwmp/functions
install -v -Dm755 wsrep-init /usr/sbin/wsrep-init
install -v -Dm755 binlog-init /usr/sbin/binlog-init
sed -i '/^\[Service\]$$/a ExecStartPre=/usr/sbin/binlog-init' /lib/systemd/system/mariadb.service
sed -i '/^\[Service\]$$/a ExecStartPre=/usr/sbin/wsrep-init' /lib/systemd/system/mariadb.service
sed -i '/^\[Service\]$$/a TimeoutStopSec=10min' /lib/systemd/system/mariadb.service
sed -i '/^\[Service\]$$/a TimeoutStartSec=120min' /lib/systemd/system/mariadb.service
......@@ -136,6 +138,7 @@ innodb_flush_log_at_trx_commit = 0
innodb_autoinc_lock_mode = 2
innodb_lock_wait_timeout = 50
!include /run/mysqld/binlog.conf
!include /run/mysqld/wsrep.conf
endef
export SERVER_CNF
......@@ -149,6 +152,11 @@ config wsrep 'galera'
option server_id ''
option wsrep_gtid_domain_id ''
option gtid_domain_id ''
config binlog 'binlog'
option do_db ''
option ignore_db ''
endef
export MARIADB_CONFIG
......
#!/bin/sh
UCI_GET="/sbin/uci -q get"
DO=`$UCI_GET mariadb.binlog.do_db`
IGNORE=`$UCI_GET mariadb.binlog.ignore_db`
echo "[mysqld]" > /run/mysqld/binlog.conf
if [ ! -z "$DO" ]; then
read -ra arr <<<"$DO"
for db in "${arr[@]}"; do echo "binlog_do_db = $db" >> /run/mysqld/binlog.conf; done
else
if [ ! -z "$IGNORE" ]; then
read -ra arr <<<"$IGNORE"
for db in "${arr[@]}"; do echo "binlog_ignore_db = $db" >> /run/mysqld/binlog.conf; done
fi
fi
chown mysql.mysql /run/mysqld/binlog.conf
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment