initialiser la HA en dernier
This commit is contained in:
parent
5661832da8
commit
a640384c5b
|
@ -442,22 +442,10 @@ function manage_datastores()
|
|||
return 0
|
||||
}
|
||||
|
||||
function init_ha() {
|
||||
# server with index 1 exists if already instanciate
|
||||
onezone show 0 | grep -A 3 ^"HA & FEDERATION SYNC STATUS" | tail -n 1 | grep -q ^" 1 "
|
||||
if [ ! $? = 0 ]; then
|
||||
FOLLOWER=$(CreoleGet one_nodes)
|
||||
for follower in $FOLLOWER; do
|
||||
onezone server-add 0 --name $follower --rpc http://$follower:2633/RPC2
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
function main()
|
||||
{
|
||||
wait_true_retcode "Wait for oned to be started" "onecluster show 0 > /dev/null"
|
||||
if [ "$(CreoleGet activer_one_ha)" = "oui" ]; then
|
||||
|
||||
if [ "$(CreoleGet one_ha_server_index)" != "0" ]; then
|
||||
return
|
||||
fi
|
||||
|
@ -493,13 +481,8 @@ function main()
|
|||
# Création des Datastores
|
||||
#
|
||||
manage_datastores "${clst_name}"
|
||||
|
||||
#
|
||||
# Dans le cas du mode HA, seul le leader fait l'init
|
||||
#
|
||||
if [ "$(CreoleGet activer_one_ha)" = "oui" ]; then
|
||||
init_ha
|
||||
fi
|
||||
}
|
||||
|
||||
main
|
||||
|
||||
exit 0
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
function init_ha() {
|
||||
# server with index 1 exists if already instanciate
|
||||
onezone show 0 | grep -A 3 ^"HA & FEDERATION SYNC STATUS" | tail -n 1 | grep -q ^" 1 "
|
||||
if [ ! $? = 0 ]; then
|
||||
FOLLOWER=$(CreoleGet one_nodes)
|
||||
for follower in $FOLLOWER; do
|
||||
onezone server-add 0 --name $follower --rpc http://$follower:2633/RPC2
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$(CreoleGet activer_one_ha)" = "oui" ]; then
|
||||
if [ "$(CreoleGet one_ha_server_index)" = "0" ]; then
|
||||
init_ha
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue