diff --git a/dicos/25_bdd_server.xml b/dicos/25_bdd_server.xml
index 9cccabd..0b86174 100644
--- a/dicos/25_bdd_server.xml
+++ b/dicos/25_bdd_server.xml
@@ -192,6 +192,14 @@
dbSlowQueryLogTime
dbSlowQueryLogFile
+
+
+ Node
+ dbCreateFixAdmin
+ accName
+ accLimits
+ accLimitTarget
+
diff --git a/postservice/25-bdd-admin b/postservice/25-bdd-admin
index 8d12fce..422d39f 100755
--- a/postservice/25-bdd-admin
+++ b/postservice/25-bdd-admin
@@ -2,6 +2,12 @@
todo=$(CreoleGet dbCreateFixAdmin 'non')
autoRepair=$(CreoleGet dbAutoOptimizeAndRepare 'non')
+role=$(CreoleGet dbClusterPosition 'Leader')
+
+if [[ ${role} == 'Node' ]]
+then
+ exit 0
+fi
if [[ ${todo} != 'non' ]]
then
@@ -13,6 +19,9 @@ then
tempFile=$(mktemp -p /root)
sqlFile=$(mktemp -p /root)
+ password=$(pwgen -1 10)
+ /usr/share/eole/sbin/mariaPwd ${password}
+
accounts=($(CreoleGet accName))
limits="$(CreoleGet accLimitTarget '')"
accLimits=(${limits// /})
@@ -55,7 +64,7 @@ then
index=$((index+1))
done
- mysql < ${sqlFile}
+ mysql -u root --password=${password} < ${sqlFile}
mv ${tempFile} ${readerfile}
chmod 600 ${readerfile}
@@ -64,7 +73,10 @@ fi
if [[ ${autoRepair} == "oui" ]]
then
- mysqlcheck -u root --auto-repair --check --optimize --all-databases
+
+ mysqlcheck -u root -p ${password} --auto-repair --check --all-databases
+ mysqlcheck -u root -p ${password} --optimize --check --all-databases
+
fi
exit 0