échange de clef entre tous les noeuds du cluster

This commit is contained in:
Emmanuel Garette 2019-03-18 11:48:59 +01:00
parent dcc8eeeece
commit f04a680864
2 changed files with 14 additions and 18 deletions

View File

@ -1,15 +1,10 @@
#!/bin/bash #!/bin/bash
if [[ ${1} == "instance" ]]; then
ha=$(CreoleGet activer_one_ha non) ha=$(CreoleGet activer_one_ha non)
if [[ ${ha} == "oui" ]] if [[ ${ha} == "oui" ]]
then
indx=$(CreoleGet one_ha_server_index)
else
indx="0"
fi
if [[ ${1} == "instance" ]] && [[ ${indx} == "0" ]]
then then
/usr/share/eole/sbin/onehost_create_all /usr/share/eole/sbin/onehost_create_all
fi fi
fi
exit 0 exit 0

View File

@ -163,12 +163,10 @@ HAPY_HA=$(CreoleGet activer_one_ha "non")
master=1 master=1
if [[ ${HAPY_HA} == "oui" ]]; then if [[ ${HAPY_HA} == "oui" ]]; then
idx=$(CreoleGet one_ha_server_index) idx=$(CreoleGet one_ha_server_index)
if [[ ${idx} != "0" ]]; then if [[ ${idx} = "0" ]]; then
EchoBleu "Mode HA: (on) Index : [${idx}]"
echo -e "\t$(basename ${0}) doit être lancé uniquement sur le leader (index 0)"
exit 0
else
master=0 master=0
else
master=2
fi fi
fi fi
@ -179,7 +177,7 @@ DBMODE=$(CreoleGet one_database_type "none")
echo -e "\n" echo -e "\n"
EchoBleu "Vous allez inscrire un noeud dans une grappe Hâpy" EchoBleu "Vous allez inscrire un noeud dans une grappe Hâpy"
EchoBleu "Pour ce faire vous devez vous munir du mot de passe de l'utilisateur 'oneadmin' de chacun des noeuds" EchoBleu "Pour ce faire vous devez vous munir du mot de passe de l'utilisateur 'root' de chacun des noeuds"
Question_ouinon "Voulez-vous commencer ?" 'True' "oui" Question_ouinon "Voulez-vous commencer ?" 'True' "oui"
if [[ $? -ne 0 ]] if [[ $? -ne 0 ]]
then then
@ -195,6 +193,9 @@ for host in ${HAPY_SLV}; do
EchoVert " * Gestion des clés SSH" EchoVert " * Gestion des clés SSH"
echo echo
copy_ssh_id ${host} copy_ssh_id ${host}
if [ $master = 2 ]; then
continue
fi
if [ $master = 0 ]; then if [ $master = 0 ]; then
copy_files ${host} copy_files ${host}
fi fi
@ -211,9 +212,9 @@ for host in ${HAPY_SLV}; do
fi fi
fi fi
fi fi
sync_nodes
if [[ ${HAPY_HA} != "oui" ]] if [[ ${HAPY_HA} != "oui" ]]
then then
sync_nodes
wait_node_ok ${HAPY_SLV[${i}]} wait_node_ok ${HAPY_SLV[${i}]}
if [[ ${?} -ne 0 ]] if [[ ${?} -ne 0 ]]
then then