Merge branch 'master' into dist/eole/2.6.2/master
This commit is contained in:
commit
eb6854d313
|
@ -8,12 +8,9 @@ gstateFile="/var/lib/mysql/grastate.dat"
|
||||||
if [[ ${db} == "oui" ]]
|
if [[ ${db} == "oui" ]]
|
||||||
then
|
then
|
||||||
if [[ ${cluster} == "oui" ]]
|
if [[ ${cluster} == "oui" ]]
|
||||||
then
|
|
||||||
if [[ ! -e ${gstateFile} ]]
|
|
||||||
then
|
then
|
||||||
[[ ${role} == "Leader" ]] && galera_new_cluster
|
[[ ${role} == "Leader" ]] && galera_new_cluster
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
|
@ -4,12 +4,14 @@
|
||||||
# and secure MariaDB installation
|
# and secure MariaDB installation
|
||||||
#
|
#
|
||||||
|
|
||||||
ROLE=$(CreoleGet dbClusterPosition)
|
ROLE=$(CreoleGet dbClusterPosition 'Leader')
|
||||||
SECURE_CMD="mysql_secure_installation"
|
SECURE_CMD="mysql_secure_installation"
|
||||||
PASSWORD=$(pwgen -1 10)
|
PASSWORD=$(pwgen -1 10)
|
||||||
passwd="/usr/share/eole/sbin/mariadbPwd"
|
passwd="/usr/share/eole/sbin/mariadbPwd"
|
||||||
logfile="/var/log/eole/maria-init.log"
|
logfile="/var/log/eole/maria-init.log"
|
||||||
|
|
||||||
|
if [[ ${ROLE} == "Leader" ]]
|
||||||
|
then
|
||||||
${passwd} ${PASSWORD}
|
${passwd} ${PASSWORD}
|
||||||
|
|
||||||
# Run secure installation script
|
# Run secure installation script
|
||||||
|
@ -22,3 +24,6 @@ y
|
||||||
y
|
y
|
||||||
y
|
y
|
||||||
__EOF__
|
__EOF__
|
||||||
|
else
|
||||||
|
exit 0
|
||||||
|
fi
|
|
@ -6,6 +6,10 @@
|
||||||
cmd="mysql"
|
cmd="mysql"
|
||||||
options='--defaults-file=/etc/mysql/debian.cnf'
|
options='--defaults-file=/etc/mysql/debian.cnf'
|
||||||
|
|
||||||
|
role=$(CreoleGet dbClusterRole 'Leader')
|
||||||
|
|
||||||
|
if [[ ${role} == "Leader"]]
|
||||||
|
then
|
||||||
if [[ -z ${1} ]]
|
if [[ -z ${1} ]]
|
||||||
then
|
then
|
||||||
read -s -p "New Password : " password
|
read -s -p "New Password : " password
|
||||||
|
@ -18,3 +22,7 @@ sql="FLUSH PRIVILEGES; ALTER USER 'root'@'localhost' IDENTIFIED BY '${password}'
|
||||||
|
|
||||||
${cmd} ${options} -e "${sql}"
|
${cmd} ${options} -e "${sql}"
|
||||||
exit $?
|
exit $?
|
||||||
|
else
|
||||||
|
echo "This command don't work in a MariaDB Cluster Node, try in the Leader"
|
||||||
|
exit 3
|
||||||
|
fi
|
Loading…
Reference in New Issue