Merge branch 'develop' into dist/eole/2.7.0/develop

This commit is contained in:
vincent 2019-02-22 14:49:53 +01:00
commit d89f1dfdeb
3 changed files with 23 additions and 19 deletions

View File

@ -200,6 +200,7 @@
<target type="variable">one_database_name</target> <target type="variable">one_database_name</target>
<target type="variable">one_database_user</target> <target type="variable">one_database_user</target>
<target type="variable">one_database_pass</target> <target type="variable">one_database_pass</target>
<target type="variable">one_database_connections</target>
</condition> </condition>
<condition name='disabled_if_in' source='activer_multinode'> <condition name='disabled_if_in' source='activer_multinode'>

View File

@ -442,22 +442,10 @@ function manage_datastores()
return 0 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() function main()
{ {
wait_true_retcode "Wait for oned to be started" "onecluster show 0 > /dev/null" wait_true_retcode "Wait for oned to be started" "onecluster show 0 > /dev/null"
if [ "$(CreoleGet activer_one_ha)" = "oui" ]; then if [ "$(CreoleGet activer_one_ha)" = "oui" ]; then
if [ "$(CreoleGet one_ha_server_index)" != "0" ]; then if [ "$(CreoleGet one_ha_server_index)" != "0" ]; then
return return
fi fi
@ -493,13 +481,8 @@ function main()
# Création des Datastores # Création des Datastores
# #
manage_datastores "${clst_name}" 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 main
exit 0

20
postservice/99-z-ha Executable file
View File

@ -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