diff --git a/postservice/30-one-mng b/postservice/30-one-mng index 3344d36..77585ab 100755 --- a/postservice/30-one-mng +++ b/postservice/30-one-mng @@ -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 diff --git a/postservice/99-z-ha b/postservice/99-z-ha new file mode 100755 index 0000000..4a9c898 --- /dev/null +++ b/postservice/99-z-ha @@ -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