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