From cb7954fb66cd64a08df1b98ee9acb725136292af Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Thu, 21 Jun 2018 18:32:58 +0200 Subject: [PATCH 1/4] Make cache query really disabled --- tmpl/tunning.cnf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tmpl/tunning.cnf b/tmpl/tunning.cnf index e0d2e8f..329934c 100644 --- a/tmpl/tunning.cnf +++ b/tmpl/tunning.cnf @@ -14,6 +14,9 @@ query_cache_type = 1 query_cache_limit = %%getVar('dbQueryCacheLimit') query_cache_min_res_unit = %%getVar('dbQueryCacheMinRestUnit') query_cache_size = %%getVar('dbQueryCacheSize') +%else +query_cache_type = 0 +query_cache_size = 0 %end if tmp_table_size = %%dbTmpTableSize From 196a4b41f215c62a12d017ab65e854fe4a9fff9f Mon Sep 17 00:00:00 2001 From: vincent Date: Fri, 22 Jun 2018 16:33:59 +0200 Subject: [PATCH 2/4] Prise en charge du dump des bases mariadb par schedule et bareos + copier des dump sur le partage nfs --- eole-mariadb.mk | 4 +++- schedule_config/config.sh | 7 +++++++ schedule_extra/01_mysql.xml | 18 ++++++++++++++++++ schedule_scripts/mysql | 27 +++++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 schedule_config/config.sh create mode 100644 schedule_extra/01_mysql.xml create mode 100644 schedule_scripts/mysql diff --git a/eole-mariadb.mk b/eole-mariadb.mk index 7756e21..ca6673e 100644 --- a/eole-mariadb.mk +++ b/eole-mariadb.mk @@ -1 +1,3 @@ -creolefuncs_DATA_DIR := $(DESTDIR)/usr/share/creole/funcs \ No newline at end of file +creolefuncs_DATA_DIR := $(DESTDIR)/usr/share/creole/funcs +schedule_extra_DATA_DIR := $(DESTDIR)/usr/share/eole/creole/extra/schedule/ +schedule_config_DATA_DIR := $(DESTDIR)/usr/share/eole/schedule/ diff --git a/schedule_config/config.sh b/schedule_config/config.sh new file mode 100644 index 0000000..2562ef3 --- /dev/null +++ b/schedule_config/config.sh @@ -0,0 +1,7 @@ +# Configuration commune aux scripts schedule +# Configuration de base modifiée pour copier dans le partage nfs plutôt que /home + +SAVDIR=/mnt/sauvegardes/ +# pour que l'affichage de [ ok ] soit ok +export TERM='dumb' +umask 0077 diff --git a/schedule_extra/01_mysql.xml b/schedule_extra/01_mysql.xml new file mode 100644 index 0000000..e0327fa --- /dev/null +++ b/schedule_extra/01_mysql.xml @@ -0,0 +1,18 @@ + + + + + + + daily + + + + + + non + none + daily + + + diff --git a/schedule_scripts/mysql b/schedule_scripts/mysql new file mode 100644 index 0000000..06b3ff9 --- /dev/null +++ b/schedule_scripts/mysql @@ -0,0 +1,27 @@ +#!/bin/bash + +set -e + +DESC="Exportation des bases MySQL" + +. /usr/share/eole/schedule/config.sh + +MYSQLSAVDIR=$SAVDIR/sql +OPTION="--lock-tables" + +rm -f $MYSQLSAVDIR/*.sql +mkdir -p $MYSQLSAVDIR + +CMD="mysql --defaults-file=/etc/mysql/mariadb.cnf -e 'show databases' | grep -v '^Database$'" +DATABASES=$(CreoleRun "$CMD" mysql) +for databasename in $DATABASES; do + case "$databasename" in + information_schema|performance_schema|bareos) + continue + ;; + *) + CMD="mysqldump --defaults-file=/etc/mysql/mariadb.cnf --databases $databasename --flush-privileges --create-options -Q -c $OPTION 2>/dev/null" + CreoleRun "$CMD" mysql > $MYSQLSAVDIR/$databasename.sql + ;; + esac +done From f832feeae33d1cb055380dfb84980400ab171abf Mon Sep 17 00:00:00 2001 From: vincent Date: Fri, 22 Jun 2018 16:44:19 +0200 Subject: [PATCH 3/4] ajout d'une condition pour pouvoir activer ou non la sauveagrde de mariadb --- dicos/25_bdd_server.xml | 3 +++ schedule_extra/01_mysql.xml | 1 + 2 files changed, 4 insertions(+) diff --git a/dicos/25_bdd_server.xml b/dicos/25_bdd_server.xml index c14f991..6a0431f 100644 --- a/dicos/25_bdd_server.xml +++ b/dicos/25_bdd_server.xml @@ -30,6 +30,9 @@ non + + non + diff --git a/schedule_extra/01_mysql.xml b/schedule_extra/01_mysql.xml index e0327fa..cd4118c 100644 --- a/schedule_extra/01_mysql.xml +++ b/schedule_extra/01_mysql.xml @@ -11,6 +11,7 @@ non + dbEnableBackup none daily From 29aca663dda06260c40f2e51837f908bee0ffceb Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Mon, 3 Sep 2018 12:05:07 +0200 Subject: [PATCH 4/4] =?UTF-8?q?Ajout=20de=20la=20possibilit=C3=A9=20de=20s?= =?UTF-8?q?p=C3=A9cifier=20"innodb=5Flock=5Fwait=5Ftimeout"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dicos/25_bdd_server.xml | 3 +++ tmpl/tunning.cnf | 1 + 2 files changed, 4 insertions(+) diff --git a/dicos/25_bdd_server.xml b/dicos/25_bdd_server.xml index c14f991..df9c1a0 100644 --- a/dicos/25_bdd_server.xml +++ b/dicos/25_bdd_server.xml @@ -64,6 +64,9 @@ 6 + + 120 + 100 diff --git a/tmpl/tunning.cnf b/tmpl/tunning.cnf index 329934c..cf1e5f3 100644 --- a/tmpl/tunning.cnf +++ b/tmpl/tunning.cnf @@ -5,6 +5,7 @@ skip-name-resolve innodb_buffer_pool_size=%%getMemoryPercentage(%%getVar('dbInnoDBBufferPoolPercentage', 10)) innodb_log_buffer_size=%%{dbInnoDBLogBufferSize}M innodb_log_file_size=%%{dbInnoDBLogFileSize}M +innodb_lock_wait_timeout=%%{dbInnoDBLockWaitTimeout} max_connections=%%dbMaxConnections thread_cache_size=%%dbThreadCacheSize