summaryrefslogtreecommitdiffstats
path: root/extras/ganesha/ocf
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2015-04-14 08:17:10 -0400
committerKaleb KEITHLEY <kkeithle@redhat.com>2015-04-29 18:25:12 -0700
commitd28a99d6f20650e5d78accb1e16bd3721a2b6d02 (patch)
tree4fd1de4d028265d601cec7057b10ffe70e51e8d4 /extras/ganesha/ocf
parent5b5048670c34df3f9eab9a6a3ab8eec288bd9d74 (diff)
common-ha: delete-node implementation
omnibus patch consisting of: + completed implemenation of delete-node (BZ 1212823) + teardown leaves /var/lib/nfs symlink (BZ 1210712) + setup copy config, teardown clean /etc/cluster (BZ 1212823) setup for copy config, teardown clean /etc/cluster: 1. on one (primary) node in the cluster, run: `ssh-keygen -f /var/lib/glusterd/nfs/secret.pem` Press Enter twice to avoid passphrase. 2. deploy the pubkey ~root/.ssh/authorized keys on _all_ nodes, run: `ssh-copy-id -i /var/lib/glusterd/nfs/secret.pem.pub root@$node` 3. copy the keys to _all_ nodes in the cluster, run: `scp /var/lib/glusterd/nfs/secret.* $node:/var/lib/glusterd/nfs/` N.B. this allows setup, teardown, etc., to be run on any node Change-Id: I9fcd3a57073ead24cd2d0ef0ee7a67c524f3d4b0 BUG: 1213933 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/10234 Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: soumya k <skoduri@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'extras/ganesha/ocf')
-rw-r--r--extras/ganesha/ocf/ganesha_grace3
-rw-r--r--extras/ganesha/ocf/ganesha_nfsd63
2 files changed, 18 insertions, 48 deletions
diff --git a/extras/ganesha/ocf/ganesha_grace b/extras/ganesha/ocf/ganesha_grace
index 397b0abdeab..dceaccf5e77 100644
--- a/extras/ganesha/ocf/ganesha_grace
+++ b/extras/ganesha/ocf/ganesha_grace
@@ -135,6 +135,9 @@ ganesha_grace_stop()
ganesha_grace_monitor()
{
# logger "ganesha_grace_monitor()"
+ if [ ! -d /var/run/ganesha ]; then
+ mkdir -p /var/run/ganesha
+ fi
pcs status | grep dead_ip-1 | sort > /var/run/ganesha/pcs_status
return $OCF_SUCCESS
}
diff --git a/extras/ganesha/ocf/ganesha_nfsd b/extras/ganesha/ocf/ganesha_nfsd
index 2c0b32c7817..d69b9f4ad47 100644
--- a/extras/ganesha/ocf/ganesha_nfsd
+++ b/extras/ganesha/ocf/ganesha_nfsd
@@ -51,23 +51,11 @@ resource agent for nfs-ganesha.
<shortdesc lang="en">Manages the user-space nfs-ganesha NFS server</shortdesc>
<parameters>
-<parameter name="ha_vol_name">
-<longdesc lang="en">HA State Volume Name</longdesc>
-<shortdesc lang="en">HA_State Volume Name</shortdesc>
-<content type="string" default="" />
-</parameter>
-
<parameter name="ha_vol_mnt">
<longdesc lang="en">HA State Volume Mount Point</longdesc>
<shortdesc lang="en">HA_State Volume Mount Point</shortdesc>
<content type="string" default="" />
</parameter>
-
-<parameter name="ha_vol_server">
-<longdesc lang="en">HA State Volume Server</longdesc>
-<shortdesc lang="en">HA_State Volume Server</shortdesc>
-<content type="string" default="" />
-</parameter>
</parameters>
<actions>
@@ -106,34 +94,16 @@ ganesha_nfsd_start()
ganesha_nfsd_stop()
{
- local mounted=""
- local mntptinuse=""
- local instance_host=""
- local short_host=""
- local resource_prefix=${OCF_RESOURCE_INSTANCE:0:9}
+ local short_host=$(hostname -s)
+ local long_host=""
- if [ "X${resource_prefix}X" = "Xnfs_startX" ]; then
+ if [ "X${OCF_RESOURCE_INSTANCE:0:9}X" = "Xnfs_startX" ]; then
- mounted=$(mount | grep $OCF_RESKEY_ha_vol_name)
- mntptinuse=$(mount | grep -o $OCF_RESKEY_ha_vol_mnt)
- short_host=$(hostname -s)
+ # if this is any nfs_start, go ahead. worst case we
+ # find the link already exists and do nothing
long_host=$(hostname)
- if [[ ! ${mounted} ]]; then
-
- if [ -d $OCF_RESKEY_ha_vol_mnt ]; then
- if [[ ${mntptinuse} ]]; then
- return $OCF_ERR_GENERIC
- fi
- else
- mkdir ${mntpt}
- fi
-
- mount -t glusterfs $OCF_RESKEY_ha_vol_server:$OCF_RESKEY_ha_vol_name $OCF_RESKEY_ha_vol_mnt
- if [ $? -ne 0 ]; then
- logger "warning: mount -t glusterfs $OCF_RESKEY_ha_vol_server:$OCF_RESKEY_ha_vol_name $OCF_RESKEY_ha_vol_mnt failed"
- fi
-
+ if [ -d /var/lib/nfs ]; then
mv /var/lib/nfs /var/lib/nfs.backup
ln -s $OCF_RESKEY_ha_vol_mnt/${long_host}/nfs /var/lib/nfs
if [ $? -ne 0 ]; then
@@ -141,20 +111,17 @@ ganesha_nfsd_stop()
fi
fi
-
- service nfs-ganesha start
- if [ $? -ne 0 ]; then
- logger "warning: service nfs-ganesha start failed"
- fi
else
- umount $OCF_RESKEY_ha_vol_mnt
- if [ $? -ne 0 ]; then
- logger "warning: umount $OCF_RESKEY_ha_vol_mnt failed"
- fi
- service nfs-ganesha stop
- if [ $? -ne 0 ]; then
- logger "warning: service nfs-ganesha stop failed"
+ # if this is a clone resource or is specific to this node
+ # remove the symlink and restore /var/lib/nfs
+
+ if [ "X${OCF_RESOURCE_INSTANCE}X" = "Xnfs_stopX" ] ||
+ [ "X${OCF_RESOURCE_INSTANCE}X" = "Xnfs_stop-${short_host}X" ]; then
+ if [ -L /var/lib/nfs -a -d /var/lib/nfs.backup ]; then
+ rm -f /var/lib/nfs
+ mv /var/lib/nfs.backup /var/lib/nfs
+ fi
fi
fi