|
|
3604df |
From ed81e2ab50d4c7c0e473cede975dfa6a1d0dc19b Mon Sep 17 00:00:00 2001
|
|
|
3604df |
From: Soumya Koduri <skoduri@redhat.com>
|
|
|
3604df |
Date: Fri, 8 Jul 2016 12:30:25 +0530
|
|
|
3604df |
Subject: [PATCH 160/162] commn-HA: Add portblock RA to tickle packets post failover(/back)
|
|
|
3604df |
|
|
|
3604df |
Portblock resource-agents are used to send tickle ACKs so as to
|
|
|
3604df |
reset the oustanding tcp connections. This can be used to reduce
|
|
|
3604df |
the time taken by the NFS clients to reconnect post IP
|
|
|
3604df |
failover/failback.
|
|
|
3604df |
|
|
|
3604df |
Two new resource agents (nfs_block and nfs_unblock) of type
|
|
|
3604df |
ocf:portblock with action block & unblock are created for each
|
|
|
3604df |
Virtual-IP (cluster_ip-1). These resource agents along with cluster_ip-1
|
|
|
3604df |
RA are grouped in the order of block->IP->unblock and also the entire
|
|
|
3604df |
group maintains same colocation rules so that they reside on the same
|
|
|
3604df |
node at any given point of time.
|
|
|
3604df |
|
|
|
3604df |
The contents of tickle_dir are of the following format -
|
|
|
3604df |
* A file is created for each of the VIPs used in the ganesha cluster.
|
|
|
3604df |
* Each of those files contain entries about clients connected
|
|
|
3604df |
as below:
|
|
|
3604df |
SourceIP:port_num DestinationIP:port_num
|
|
|
3604df |
|
|
|
3604df |
Hence when one server failsover, connections of the clients connected
|
|
|
3604df |
to other VIPs are not affected.
|
|
|
3604df |
|
|
|
3604df |
Note: During testing I observed that tickle ACKs are sent during
|
|
|
3604df |
failback but not during failover, though I/O successfully
|
|
|
3604df |
resumed post failover.
|
|
|
3604df |
|
|
|
3604df |
Also added a dependency on portblock RA for glusterfs-ganesha package
|
|
|
3604df |
as it may not be available (as part of resource-agents package) in
|
|
|
3604df |
all the distributions.
|
|
|
3604df |
|
|
|
3604df |
This is backport of the below mainline bug -
|
|
|
3604df |
http://review.gluster.org/14878
|
|
|
3604df |
|
|
|
3604df |
> Change-Id: Icad6169449535f210d9abe302c2a6971a0a96d6f
|
|
|
3604df |
> BUG: 1354439
|
|
|
3604df |
> Signed-off-by: Soumya Koduri <skoduri@redhat.com>
|
|
|
3604df |
> Reviewed-on: http://review.gluster.org/14878
|
|
|
3604df |
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
|
|
|
3604df |
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
|
|
3604df |
> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
|
|
|
3604df |
> Smoke: Gluster Build System <jenkins@build.gluster.org>
|
|
|
3604df |
> Reviewed-by: Niels de Vos <ndevos@redhat.com>
|
|
|
3604df |
|
|
|
3604df |
BUG: 1278336
|
|
|
3604df |
Change-Id: Ia9f05b5fc6b6bf1ebf08d6402e9840b044c8c795
|
|
|
3604df |
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
|
|
|
3604df |
Reviewed-on: https://code.engineering.redhat.com/gerrit/89512
|
|
|
3604df |
Reviewed-by: Milind Changire <mchangir@redhat.com>
|
|
|
3604df |
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
3604df |
---
|
|
|
3604df |
extras/ganesha/scripts/ganesha-ha.sh | 38 +++++++++++++++++++++++++---------
|
|
|
3604df |
glusterfs.spec.in | 5 ++++
|
|
|
3604df |
2 files changed, 33 insertions(+), 10 deletions(-)
|
|
|
3604df |
|
|
|
3604df |
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
|
|
|
3604df |
index de7c425..5162eb5 100644
|
|
|
3604df |
--- a/extras/ganesha/scripts/ganesha-ha.sh
|
|
|
3604df |
+++ b/extras/ganesha/scripts/ganesha-ha.sh
|
|
|
3604df |
@@ -364,17 +364,17 @@ do_create_virt_ip_constraints()
|
|
|
3604df |
|
|
|
3604df |
# first a constraint location rule that says the VIP must be where
|
|
|
3604df |
# there's a ganesha.nfsd running
|
|
|
3604df |
- pcs -f ${cibfile} constraint location ${primary}-cluster_ip-1 rule score=-INFINITY ganesha-active ne 1
|
|
|
3604df |
+ pcs -f ${cibfile} constraint location ${primary}-group rule score=-INFINITY ganesha-active ne 1
|
|
|
3604df |
if [ $? -ne 0 ]; then
|
|
|
3604df |
- logger "warning: pcs constraint location ${primary}-cluster_ip-1 rule score=-INFINITY ganesha-active ne 1 failed"
|
|
|
3604df |
+ logger "warning: pcs constraint location ${primary}-group rule score=-INFINITY ganesha-active ne 1 failed"
|
|
|
3604df |
fi
|
|
|
3604df |
|
|
|
3604df |
# then a set of constraint location prefers to set the prefered order
|
|
|
3604df |
# for where a VIP should move
|
|
|
3604df |
while [[ ${1} ]]; do
|
|
|
3604df |
- pcs -f ${cibfile} constraint location ${primary}-cluster_ip-1 prefers ${1}=${weight}
|
|
|
3604df |
+ pcs -f ${cibfile} constraint location ${primary}-group prefers ${1}=${weight}
|
|
|
3604df |
if [ $? -ne 0 ]; then
|
|
|
3604df |
- logger "warning: pcs constraint location ${primary}-cluster_ip-1 prefers ${1}=${weight} failed"
|
|
|
3604df |
+ logger "warning: pcs constraint location ${primary}-group prefers ${1}=${weight} failed"
|
|
|
3604df |
fi
|
|
|
3604df |
weight=$(expr ${weight} + 1000)
|
|
|
3604df |
shift
|
|
|
3604df |
@@ -384,9 +384,9 @@ do_create_virt_ip_constraints()
|
|
|
3604df |
# on Fedora setting appears to be additive, so to get the desired
|
|
|
3604df |
# value we adjust the weight
|
|
|
3604df |
# weight=$(expr ${weight} - 100)
|
|
|
3604df |
- pcs -f ${cibfile} constraint location ${primary}-cluster_ip-1 prefers ${primary}=${weight}
|
|
|
3604df |
+ pcs -f ${cibfile} constraint location ${primary}-group prefers ${primary}=${weight}
|
|
|
3604df |
if [ $? -ne 0 ]; then
|
|
|
3604df |
- logger "warning: pcs constraint location ${primary}-cluster_ip-1 prefers ${primary}=${weight} failed"
|
|
|
3604df |
+ logger "warning: pcs constraint location ${primary}-group prefers ${primary}=${weight} failed"
|
|
|
3604df |
fi
|
|
|
3604df |
}
|
|
|
3604df |
|
|
|
3604df |
@@ -481,9 +481,16 @@ setup_create_resources()
|
|
|
3604df |
eval tmp_ipaddr=\$${clean_name}
|
|
|
3604df |
ipaddr=${tmp_ipaddr//_/.}
|
|
|
3604df |
|
|
|
3604df |
- pcs -f ${cibfile} resource create ${1}-cluster_ip-1 ocf:heartbeat:IPaddr ip=${ipaddr} cidr_netmask=32 op monitor interval=15s
|
|
|
3604df |
+ pcs -f ${cibfile} resource create ${1}-nfs_block ocf:heartbeat:portblock protocol=tcp \
|
|
|
3604df |
+ portno=2049 action=block ip=${ipaddr} --group ${1}-group
|
|
|
3604df |
+ if [ $? -ne 0 ]; then
|
|
|
3604df |
+ logger "warning pcs resource create ${1}-nfs_block failed"
|
|
|
3604df |
+ fi
|
|
|
3604df |
+ pcs -f ${cibfile} resource create ${1}-cluster_ip-1 ocf:heartbeat:IPaddr ip=${ipaddr} \
|
|
|
3604df |
+ cidr_netmask=32 op monitor interval=15s --group ${1}-group --after ${1}-nfs_block
|
|
|
3604df |
if [ $? -ne 0 ]; then
|
|
|
3604df |
- logger "warning pcs resource create ${1}-cluster_ip-1 ocf:heartbeat:IPaddr ip=${ipaddr} cidr_netmask=32 op monitor interval=15s failed"
|
|
|
3604df |
+ logger "warning pcs resource create ${1}-cluster_ip-1 ocf:heartbeat:IPaddr ip=${ipaddr} \
|
|
|
3604df |
+ cidr_netmask=32 op monitor interval=15s failed"
|
|
|
3604df |
fi
|
|
|
3604df |
|
|
|
3604df |
pcs -f ${cibfile} constraint order nfs-grace-clone then ${1}-cluster_ip-1
|
|
|
3604df |
@@ -491,6 +498,14 @@ setup_create_resources()
|
|
|
3604df |
logger "warning: pcs constraint order nfs-grace-clone then ${1}-cluster_ip-1 failed"
|
|
|
3604df |
fi
|
|
|
3604df |
|
|
|
3604df |
+ pcs -f ${cibfile} resource create ${1}-nfs_unblock ocf:heartbeat:portblock protocol=tcp \
|
|
|
3604df |
+ portno=2049 action=unblock ip=${ipaddr} reset_local_on_unblock_stop=true \
|
|
|
3604df |
+ tickle_dir=${HA_VOL_MNT}/nfs-ganesha/tickle_dir/ --group ${1}-group --after ${1}-cluster_ip-1
|
|
|
3604df |
+ if [ $? -ne 0 ]; then
|
|
|
3604df |
+ logger "warning pcs resource create ${1}-nfs_unblock failed"
|
|
|
3604df |
+ fi
|
|
|
3604df |
+
|
|
|
3604df |
+
|
|
|
3604df |
shift
|
|
|
3604df |
done
|
|
|
3604df |
|
|
|
3604df |
@@ -529,9 +544,9 @@ teardown_resources()
|
|
|
3604df |
fi
|
|
|
3604df |
|
|
|
3604df |
while [[ ${1} ]]; do
|
|
|
3604df |
- pcs resource delete ${1}-cluster_ip-1
|
|
|
3604df |
+ pcs resource delete ${1}-group
|
|
|
3604df |
if [ $? -ne 0 ]; then
|
|
|
3604df |
- logger "warning: pcs resource delete ${1}-cluster_ip-1 failed"
|
|
|
3604df |
+ logger "warning: pcs resource delete ${1}-group failed"
|
|
|
3604df |
fi
|
|
|
3604df |
shift
|
|
|
3604df |
done
|
|
|
3604df |
@@ -697,6 +712,9 @@ setup_state_volume()
|
|
|
3604df |
fi
|
|
|
3604df |
|
|
|
3604df |
|
|
|
3604df |
+ if [ ! -d ${mnt}/nfs-ganesha/tickle_dir ]; then
|
|
|
3604df |
+ mkdir ${mnt}/nfs-ganesha/tickle_dir
|
|
|
3604df |
+ fi
|
|
|
3604df |
if [ ! -d ${mnt}/nfs-ganesha/${dirname} ]; then
|
|
|
3604df |
mkdir ${mnt}/nfs-ganesha/${dirname}
|
|
|
3604df |
fi
|
|
|
3604df |
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
|
|
|
3604df |
index 28517b9..29cc7ba 100644
|
|
|
3604df |
--- a/glusterfs.spec.in
|
|
|
3604df |
+++ b/glusterfs.spec.in
|
|
|
3604df |
@@ -397,6 +397,8 @@ Requires: nfs-ganesha-gluster, pcs, dbus
|
|
|
3604df |
%if ( 0%{?rhel} && 0%{?rhel} == 6 )
|
|
|
3604df |
Requires: cman, pacemaker, corosync
|
|
|
3604df |
%endif
|
|
|
3604df |
+# we need portblock resource-agent
|
|
|
3604df |
+Requires: %{_prefix}/lib/ocf/resource.d/portblock
|
|
|
3604df |
|
|
|
3604df |
%description ganesha
|
|
|
3604df |
GlusterFS is a distributed file-system capable of scaling to several
|
|
|
3604df |
@@ -2041,6 +2043,9 @@ end
|
|
|
3604df |
%endif
|
|
|
3604df |
|
|
|
3604df |
%changelog
|
|
|
3604df |
+* Fri Nov 11 2016 Soumya Koduri <skoduri@redhat.com>
|
|
|
3604df |
+- Add dependency on portblock resource agent for ganesha package (#1278336)
|
|
|
3604df |
+
|
|
|
3604df |
* Fri Oct 14 2016 Milind Changire <mchangir@redhat.com>
|
|
|
3604df |
- Changed pretrans scripts to use os.tmpname() for enhanced security
|
|
|
3604df |
for server builds only (#1362044)
|
|
|
3604df |
--
|
|
|
3604df |
1.7.1
|
|
|
3604df |
|