From 873ad190fb2067ee5118e4c8945fef4dc21ec763 Mon Sep 17 00:00:00 2001 From: Min-Su Shin Date: Fri, 11 Aug 2023 13:54:27 +0900 Subject: [PATCH] New scripts to mount and umount file systems. --- .../tool_setup_nas_as_nfs_client_all_nodes.sh | 26 +++++++++++++++++++ lice/tool_umount_fs.sh | 21 +++++++++++++++ 2 files changed, 47 insertions(+) create mode 100755 lice/tool_setup_nas_as_nfs_client_all_nodes.sh create mode 100755 lice/tool_umount_fs.sh diff --git a/lice/tool_setup_nas_as_nfs_client_all_nodes.sh b/lice/tool_setup_nas_as_nfs_client_all_nodes.sh new file mode 100755 index 0000000..600c4d6 --- /dev/null +++ b/lice/tool_setup_nas_as_nfs_client_all_nodes.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# This script mounts the NAS directory with the NFS protocol. + +# Name of the cluster which defines the clients' names +CLUSTERNAME="lice" +# Last integer index of the minions in the cluster +MINIONLASTIND="14" +# IP of the Gluster server +NASIP="" +# Directory name which corresponds to the source directory in the NAS +NASDIR="/kvn" +# Directory name which is a mount point on clients +TARGETDIR="/mnt/nas-input" + +RUNCMD="apt -y install nfs-common; mkdir ${TARGETDIR}; mount -t nfs ${NASIP}:${NASDIR} ${TARGETDIR}" + +echo "... setuping on ${CLUSTERNAME}-master" +echo $RUNCMD | bash + +for ind in $(seq 0 ${MINIONLASTIND}) +do + echo "... setuping on ${CLUSTERNAME}-minion-${ind}" + ssh ${CLUSTERNAME}-minion-${ind} "${RUNCMD}" + done + diff --git a/lice/tool_umount_fs.sh b/lice/tool_umount_fs.sh new file mode 100755 index 0000000..bef673d --- /dev/null +++ b/lice/tool_umount_fs.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Name of the cluster which defines the clients' names +CLUSTERNAME="lice" +# Last integer index of the minions in the cluster +MINIONLASTIND="14" +# Directory name which is a mount point on clients +TARGETDIR="/mnt/nas-input" + +# Rest of tasks +RUNCMD="umount ${TARGETDIR}" +# ... Master +echo "... unmounting on ${CLUSTERNAME}-master" +echo $RUNCMD | bash +# ... Minion +for ind in $(seq 0 ${MINIONLASTIND}) +do + echo "... unmounting on ${CLUSTERNAME}-minion-${ind}" + ssh ${CLUSTERNAME}-minion-${ind} "${RUNCMD}" +done + -- GitLab