From 406faff53d38596f5df8a49412b9d7d295c4f105 Mon Sep 17 00:00:00 2001 From: Matt Kereczman Date: Fri, 22 Jun 2018 08:22:13 -0700 Subject: [PATCH] Added persistent port assignments for NFS setup_nfs_ha.sh: Added static port assignments to NFS to allow access through a loadbalancer. Ports 111 (TCP/UDP), 2049 (TCP/UDP), 2000 (TCP/UDP), 2001 (TCP), and 2002 (UDP) are the ports required. --- scripts/setup_nfs_ha.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/setup_nfs_ha.sh b/scripts/setup_nfs_ha.sh index ca8e1c2d..f0110ece 100644 --- a/scripts/setup_nfs_ha.sh +++ b/scripts/setup_nfs_ha.sh @@ -27,6 +27,13 @@ function setup_required_packages systemctl stop nfs-kernel-server systemctl disable nfs-kernel-server + # Setup static port assignments for mountd, nlm (tcp), and nlm (udp) respectively: + sed -i 's/^\(RPCMOUNTDOPTS="--manage-gids\)"/\1 -p 2000"/g' /etc/default/nfs-kernel-server + cat < /etc/sysctl.d/30-nfs-ports.conf +fs.nfs.nlm_tcpport = 2001 +fs.nfs.nlm_udpport = 2002 +EOF + # We need to install the "azure-lb" command separately if the resource-agents package didn't have it. pushd /usr/lib/ocf/resource.d/heartbeat if [ ! -e azure-lb ]; then @@ -226,4 +233,4 @@ NFS_EXPORT_PATH=${DRBD_MOUNT_POINT}/moodle # TODO Allow different export dir na setup_corosync_and_pacemaker_for_nfs $NODE1IP $NODE2IP $DRBD_RESOURCE_NAME $DRBD_DEVICE_PATH $DRBD_MOUNT_POINT $NFS_EXPORT_PATH "$NFS_CLIENTS_IP_RANGE" -echo "NFS-HA setup succeeded. NFS_EXPORT_PATH=${NFS_EXPORT_PATH}, NFS_CLIENT_SPEC=${NFS_CLIENT_SPEC}" \ No newline at end of file +echo "NFS-HA setup succeeded. NFS_EXPORT_PATH=${NFS_EXPORT_PATH}, NFS_CLIENT_SPEC=${NFS_CLIENT_SPEC}"