From 8c28ae6e6bc4406b76d424bfab45d6eaabb9689a Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Thu, 21 Feb 2019 13:59:39 +0100 Subject: [PATCH] fusion one_followers_domain et one_nodes --- dicos/29_one-master.xml | 58 +++++++++++++++++++++++----- dicos/30_one-master-ha.xml | 78 -------------------------------------- postservice/30-one-mng | 4 +- posttemplate/90-one-db | 2 +- scripts/onehost_create_all | 4 +- tmpl/oned-ha-mysql.conf | 2 +- tmpl/oned.conf | 6 +-- tmpl/sched.conf | 2 +- 8 files changed, 57 insertions(+), 99 deletions(-) delete mode 100644 dicos/30_one-master-ha.xml diff --git a/dicos/29_one-master.xml b/dicos/29_one-master.xml index 560e048..04f2ead 100644 --- a/dicos/29_one-master.xml +++ b/dicos/29_one-master.xml @@ -23,6 +23,14 @@ port_sunstone vnc_proxy_port_sunstone + + + 2633 + + + + one_nodes + @@ -53,7 +61,7 @@ one - 50 + 50 @@ -135,7 +146,7 @@ Configuration de la base de données Configuration des réseaux de l'orchestrateur Configuration de l'orchestrateur - Configuration des nœuds de virtualisation + Configuration des nœuds de virtualisation @@ -194,8 +205,36 @@ non one_nodes - node_ip + + activer_one_ha + + + oui + activer_multinode + + + + non + one_ha_server_index + one_vip + one_vip_mask + sunstone_xmlrpc + + + + adresse_netmask_eth0 + + + + one_vip + + + one_vip + + + one_vip + vnet_range_start @@ -215,10 +254,6 @@ l2_vnet_vlan_trunk - - node_ip - - ['internet','admin','pedago','dmzpub','dmzpriv','wifi'] False @@ -326,5 +361,8 @@ Version de l'ISO EOLE à télécharger lors de l'initialisation Réseau de type IPv4 (niveau 3 du modèle OSI) Réseau de type ethernet (niveau 2 du modèle OSI) + Le leader à l'index 0, les followers commencent à 1 + Active la possibilité d'intégrer Hâpy dans une grappe de haute disponibilité OpenNebula + Adresse IP virtuelle (VIP) utilisée pour joindre le "Leader" de la grappe, les usagés utiliseront cette IP pour contacter la grappe diff --git a/dicos/30_one-master-ha.xml b/dicos/30_one-master-ha.xml deleted file mode 100644 index d1330f9..0000000 --- a/dicos/30_one-master-ha.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - 2633 - - - - one_followers_domain - - - - - - non - - - - - - - - - - - Rôle du nœud de virtualisation - Configuration de la VIP - - - - - - ['leader','follower'] - - - - non - Haute disponibilité - sunstone_xmlrpc - - - follower - one_vip - one_vip_mask - - - - leader - one_server_index - - - leader - one_ha_role - 0 - None - - - adresse_netmask_eth0 - - - one_vip - - - one_vip - - - one_vip - - - - - Active la possibilité d'intégrer Hâpy dans une grappe de haute disponibilité OpenNebula - Configuration du comportement du noeud dans la grappe - Rôle initial du noeud dans la grappe, permet de déterminer comment le serveur commence sa vie dans la grappe - Adresse IP virtuelle (VIP) utilisée pour joindre le "Leader" de la grappe, les clients utiliseront cette IP pour contacter la grappe - Masque de sous réseau du réseau de la VIP au format CIDR (ex: 24 pour 255.255.255.0) - - diff --git a/postservice/30-one-mng b/postservice/30-one-mng index 757afb5..55bfa4c 100755 --- a/postservice/30-one-mng +++ b/postservice/30-one-mng @@ -446,7 +446,7 @@ 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_followers_domain) + FOLLOWER=$(CreoleGet one_nodes) for follower in $FOLLOWER; do onezone server-add 0 --name $follower --rpc http://$follower:2633/RPC2 done @@ -456,7 +456,7 @@ function init_ha() { function main() { wait_true_retcode "Wait for oned to be started" "onecluster show 0 > /dev/null" - if [ "$(CreoleGet one_ha_role none)" = "leader" ]; then + if [ "$(CreoleGet one_ha_server_index)" = "0" ]; then init_ha fi # diff --git a/posttemplate/90-one-db b/posttemplate/90-one-db index 7f0f2d7..f3e3891 100644 --- a/posttemplate/90-one-db +++ b/posttemplate/90-one-db @@ -43,7 +43,7 @@ function updateDB() } function to_mysql() { - if [ "$script" = 'instance' ] && [ $(CreoleGet one_database_type) = "mysql" ] && [ $(CreoleGet one_ha_role leader) = "leader" ]; then + if [ "$script" = 'instance' ] && [ $(CreoleGet one_database_type) = "mysql" ] && [ $(CreoleGet one_ha_server_index 0) = "0" ]; then Question_ouinon "Voulez-vous migrer de SQLite à Mysql ?" "True" "oui" "warn" rep=$(echo "$?") if [ "$rep" == "0" ]; then diff --git a/scripts/onehost_create_all b/scripts/onehost_create_all index 44961d6..a06fa83 100755 --- a/scripts/onehost_create_all +++ b/scripts/onehost_create_all @@ -90,10 +90,8 @@ then exit 1 fi declare -a HAPY_SLV=('') -declare -a HAPY_SLV_IP=('') ONEUSER=$(CreoleGet virt_user) HAPY_SLV=$(echo $(CreoleGet one_nodes) | sed -e "s/\n/ /g") -HAPY_SLV_IP=$(echo $(CreoleGet node_ip) | sed -e "s/\n/ /g") echo -e "\n" EchoBleu "Vous allez inscrire un noeud dans une grappe Hâpy" @@ -112,7 +110,7 @@ do echo EchoVert " * Gestion des clés SSH" echo - copy_ssh_id ${HAPY_SLV_IP[${i}]} + copy_ssh_id ${HAPY_SLV[${i}]} [[ ${?} -ne 0 ]] && EchoRouge "Erreur lors de l'échange de clés SSH avec le noeud ${HAPY_SLV[${i}]}}" EchoVert " * Enregistrement du noeud" diff --git a/tmpl/oned-ha-mysql.conf b/tmpl/oned-ha-mysql.conf index 9094c89..17b618c 100644 --- a/tmpl/oned-ha-mysql.conf +++ b/tmpl/oned-ha-mysql.conf @@ -1,2 +1,2 @@ -%set global %%enable_one_ha='non' +%set global %%activer_one_ha='non' %include '/var/lib/creole/oned.conf' diff --git a/tmpl/oned.conf b/tmpl/oned.conf index bf606a6..e66d89c 100644 --- a/tmpl/oned.conf +++ b/tmpl/oned.conf @@ -78,7 +78,7 @@ SCRIPTS_REMOTE_DIR=/var/tmp/one PORT = 2633 -%if %%enable_one_ha == 'non' +%if %%activer_one_ha == 'non' LISTEN_ADDRESS = "127.0.0.1" %end if @@ -155,7 +155,7 @@ VNC_PORTS = [ FEDERATION = [ MODE = "STANDALONE", ZONE_ID = 0, -%if %%enable_one_ha == 'oui' +%if %%activer_one_ha == 'oui' SERVER_ID = %%one_server_index, %else SERVER_ID = -1, @@ -172,7 +172,7 @@ RAFT = [ XMLRPC_TIMEOUT_MS = 450 ] -%if %%enable_one_ha == 'oui' and %%one_ha_role == 'leader' +%if %%activer_one_ha == 'oui' and %%one_ha_server_index == 0 # Executed when a server transits from follower->leader RAFT_LEADER_HOOK = [ COMMAND = "raft/vip.sh", diff --git a/tmpl/sched.conf b/tmpl/sched.conf index 184b663..938e044 100644 --- a/tmpl/sched.conf +++ b/tmpl/sched.conf @@ -75,7 +75,7 @@ MESSAGE_SIZE = 1073741824 TIMEOUT = 60 -%if %%enable_one_ha == 'oui' +%if %%activer_one_ha == 'oui' ONE_XMLRPC = "http://%%adresse_ip_eth0:2633/RPC2" %else ONE_XMLRPC = "http://localhost:2633/RPC2"