summaryrefslogtreecommitdiffstats
path: root/extras
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2015-08-05 11:16:34 -0400
committerKaleb KEITHLEY <kkeithle@redhat.com>2016-03-14 21:22:18 -0700
commit4bf4bab995307a87487abf3cb0808f81bf198ecd (patch)
tree88ad810954f37fe76c6fb697c63eefe72fe3ad64 /extras
parent64cba025b13aad7fb3020a04930cfa22fbfcb859 (diff)
common-ha: delete virt-IP entry of deleted node
Avoid accumulating invalid/defunct virtual IP entries in the HA config file. use correct 'clean' name when adding a node and its virtual IP Also fix a nit in the sample HA config file BUG: 1250601 Change-Id: I0e6a251334e854d0003d5930ca804f972900b624 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/11841 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Meghana M <mmadhusu@redhat.com> Reviewed-by: soumya k <skoduri@redhat.com> Reviewed-on: http://review.gluster.org/13717 Smoke: Gluster Build System <jenkins@build.gluster.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'extras')
-rw-r--r--extras/ganesha/config/ganesha-ha.conf.sample4
-rw-r--r--extras/ganesha/scripts/ganesha-ha.sh17
2 files changed, 16 insertions, 5 deletions
diff --git a/extras/ganesha/config/ganesha-ha.conf.sample b/extras/ganesha/config/ganesha-ha.conf.sample
index 24054abfdff..2077800d255 100644
--- a/extras/ganesha/config/ganesha-ha.conf.sample
+++ b/extras/ganesha/config/ganesha-ha.conf.sample
@@ -18,5 +18,5 @@ HA_CLUSTER_NODES="server1,server2,..."
# Virtual IPs for each of the nodes specified above.
VIP_server1="10.0.2.1"
VIP_server2="10.0.2.2"
-#VIP_server1.lab.redhat.com="10.0.2.1"
-#VIP_server2.lab.redhat.com="10.0.2.2"
+#VIP_server1_lab_redhat_com="10.0.2.1"
+#VIP_server2_lab_redhat_com="10.0.2.2"
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
index f17582b727a..7fac2cee881 100644
--- a/extras/ganesha/scripts/ganesha-ha.sh
+++ b/extras/ganesha/scripts/ganesha-ha.sh
@@ -107,6 +107,7 @@ ${SECRET_PEM} root@${new_node} "$SERVICE_MAN nfs-ganesha ${action}"
fi
}
+
check_cluster_exists()
{
local name=${1}
@@ -794,6 +795,16 @@ deletenode_delete_resources()
}
+deletenode_update_haconfig()
+{
+ local name="VIP_${1}"
+ local clean_name=${name//[-.]/_}
+
+ ha_servers=$(echo ${HA_SERVERS} | sed -e "s/ /,/")
+ sed -i -e "s/^HA_CLUSTER_NODES=.*$/HA_CLUSTER_NODES=\"${ha_servers// /,}\"/" -e "s/^${clean_name}=.*$//" -e "/^$/d" ${HA_CONFDIR}/ganesha-ha.conf
+}
+
+
setup_state_volume()
{
local mnt=${HA_VOL_MNT}
@@ -951,7 +962,8 @@ main()
#from the entries in the ganesha-ha.conf file. Adding the
#newly added node to the file so that the resources specfic
#to this node is correctly recreated in the future.
- echo "VIP_$node=\"$vip\"" >> ${HA_CONFDIR}/ganesha-ha.conf
+ clean_node=${node//[-.]/_}
+ echo "VIP_$clean_node=\"${vip}\"" >> ${HA_CONFDIR}/ganesha-ha.conf
NEW_NODES="$HA_CLUSTER_NODES,$node"
@@ -976,8 +988,7 @@ $HA_CONFDIR/ganesha-ha.conf
logger "warning: pcs cluster node remove ${node} failed"
fi
- ha_servers=$(echo ${HA_SERVERS} | sed -e "s/ /,/")
- sed -i "s/^HA_CLUSTER_NODES=.*$/HA_CLUSTER_NODES=\"${ha_servers// /,}\"/" ${HA_CONFDIR}/ganesha-ha.conf
+ deletenode_update_haconfig ${node}
setup_copy_config ${HA_SERVERS}