From 4ee18114f4d582516eeff13b5b1e579483e731cb Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Mon, 4 Mar 2019 12:07:36 +0100 Subject: [PATCH] erreur template --- posttemplate/25-mariadb-passwd | 66 ---------------------------------- tmpl/galera.cnf | 2 +- 2 files changed, 1 insertion(+), 67 deletions(-) delete mode 100755 posttemplate/25-mariadb-passwd diff --git a/posttemplate/25-mariadb-passwd b/posttemplate/25-mariadb-passwd deleted file mode 100755 index f97b535..0000000 --- a/posttemplate/25-mariadb-passwd +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash - -systemctl stop mariadb - -mariadb_cfdir=/etc/mysql/ -dc=$mysql_cfgdir/mariadbBackup.cnf -mariadb_rundir=/var/run/mysqld/ -mariadb_statedir=/var/lib/mysql - -if [ -e "$dc" -a -n "`fgrep mysql_upgrade $dc 2>/dev/null`" ]; then - pass="`sed -n 's/^[ ]*password *= *// p' $dc | head -n 1`" - # Basedir is deprecated. Remove the option if it's in an existing mariadbBackup.cnf - sed -i '/basedir/d' "$dc" -else - pass=`perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..16)'`; - if [ ! -d "$mariadb_cfdir" ]; then - install -o 0 -g 0 -m 0755 -d $mariadb_cfdir - fi - umask 066 - cat /dev/null > $dc - umask 022 - echo "# Automatically generated DONT'T TOUCH !!!!!!" >>$dc - echo "[client]" >>$dc - echo "host = localhost" >>$dc - echo "user = maria-sys-maint" >>$dc - echo "password = $pass" >>$dc - echo "socket = $mariadb_rundir/mysqld.sock" >>$dc - echo "[mysql_upgrade]" >>$dc - echo "host = localhost" >>$dc - echo "user = maria-sys-maint" >>$dc - echo "password = $pass" >>$dc - echo "socket = $mariadb_rundir/mysqld.sock" >>$dc -fi - -# If this dir chmod go+w then the admin did it. But this file should not. - chown 0:0 $dc - chmod 0600 $dc - -# If database doesn't exist we create it. -mkdir /var/lib/mariadb-files -mariadb_filesdir=/var/lib/mariadb-files - -if [ ! "$(ls -A "${mariadb_statedir}")" ] && [ -d "${mariadb_filesdir}" ]; then - existingdatabase=0 - initfile=`mktemp --tmpdir=/var/lib/mariadb-files/` - touch "$initfile" - chmod 600 "$initfile" - chown mysql:mysql "$initfile" - echo "USE mysql; " >> "$initfile" - db_get mysql-server/root_password && rootpw="$RET" - if [ ! -z "$rootpw" ]; then - rootpw=$(printf %q "${rootpw}") - echo "ALTER USER 'root'@'localhost' IDENTIFIED BY '$rootpw';" >> "$initfile" - fi - echo "CREATE USER IF NOT EXISTS 'maria-sys-maint'@'localhost' IDENTIFIED BY '$pass';" >> "$initfile" - echo "GRANT ALL ON *.* TO 'maria-sys-maint'@'localhost' WITH GRANT OPTION;" >> "$initfile" - echo "SHUTDOWN;" >> "$initfile" - mysqld --initialize-insecure --user=mysql --init-file="$initfile"> /dev/null 2>&1 || true - rm "$initfile" -else - existingdatabase=1 -fi - -systemctl start mariadb - -exit 0 diff --git a/tmpl/galera.cnf b/tmpl/galera.cnf index 8040ea8..28dbcbf 100644 --- a/tmpl/galera.cnf +++ b/tmpl/galera.cnf @@ -8,7 +8,7 @@ wsrep_on=ON wsrep_provider=/usr/lib/galera/libgalera_smm.so # Galera Cluster Configuration wsrep_cluster_name="%%dbClusterName" -wsrep_cluster_address="gcomm://%%dbClusterMember +wsrep_cluster_address="gcomm://%%custom_join(%%dbClusterMember, ',')" # Tunning wsrep_provider_options="gcache.size=%%dbClusterGcacheSizeMb"