diff --git a/dicos/25_bdd_server.xml b/dicos/25_bdd_server.xml index c14f991..9376818 100644 --- a/dicos/25_bdd_server.xml +++ b/dicos/25_bdd_server.xml @@ -30,6 +30,9 @@ non + + non + @@ -64,6 +67,9 @@ 6 + + 120 + 100 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..cd4118c --- /dev/null +++ b/schedule_extra/01_mysql.xml @@ -0,0 +1,19 @@ + + + + + + + daily + + + + + + non + dbEnableBackup + 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 diff --git a/tmpl/tunning.cnf b/tmpl/tunning.cnf index e0d2e8f..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 @@ -14,6 +15,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