Sponsored Content
Top Forums Shell Programming and Scripting Bash script to add multiple resources to NFS pacemaker cluster Post 303037215 by hburnswell on Friday 26th of July 2019 12:12:51 AM
Old 07-26-2019
Thank you for the reply. Actually, I believe I described the desired command output poorly. In the snippet I posted, the 'exports' array would define the resources that I'd want to define:

Code:
declare -A exports
exports[${nfsenv}-${dirs[0]}-10.1]=${cs101}
exports[${nfsenv}-${dirs[1]}-10.91]=${cs1091}
exports[${nfsenv}-${dirs[2]}-10.1]=${cs101}
exports[${nfsenv}-${dirs[2]}-10.91]=${cs1091}

So the commands I'd want to run would be:

Code:
pcs resource create nfs-b2b-hg-media-10.1 exportfs clientspec=10.1.0.0/255.255.0.0 options=rw,sync,no_root_squash directory=/nfs/exports/media fsid=1 --group nfsgroup
pcs resource create nfs-b2b-hg-hotdrive-10.91 exportfs clientspec=10.91.0.0/255.255.0.0 options=rw,sync,no_root_squash directory=/nfs/exports/hotdrive fsid=2 --group nfsgroup
pcs resource create nfs-b2b-hg-images-10.1 exportfs clientspec=10.1.0.0/255.255.0.0 options=rw,sync,no_root_squash directory=/nfs/exports/images fsid=3 --group nfsgroup
pcs resource create nfs-b2b-hg-images-10.91 exportfs clientspec=10.91.0.0/255.255.0.0 options=rw,sync,no_root_squash directory=/nfs/exports/images fsid=3 --group nfsgroup

Notice the need to increment the 'fsid' based upon the exported directory (media=1, hotdrive=2, images=3). If a given directory is exported to multiple subnets, it will maintain the same 'fsid'.

I will test further and welcome any suggestions.

Thanks,

HB
 

8 More Discussions You Might Find Interesting

1. High Performance Computing

cluster setup and nfs

hello, During the cluster installation, we are required to enter a cluster name. When this name is used? I have a shared disk between those 2 nodes. To test NFS failover, what should I do? PS: I am using VCS 5 thanks (5 Replies)
Discussion started by: melanie_pfefer
5 Replies

2. Shell Programming and Scripting

bash script to rename multiple directories

Hello I have a directory structure with year in format 4 digits, e.g 2009, below which is month format 1 or 2 digits, e.g 1 or 12, blow which is day format 1 or 2 digits, e.g 1 or 31. I want to change the names of lots of directories to the be Year - 4 digits , e.g 2009 - No change here... (4 Replies)
Discussion started by: garethsays
4 Replies

3. Shell Programming and Scripting

Multiple Variables for BASH script

Hello, I am new to the whole "scripting" thing. Below is the script that I have so far and where i need the Variables to go (VAR#) #!/bin/bash #Sample Script VAR1= echo "Choose an option: 1) Create a file. 2) Delete a file. 3) Move a file." read VAR1 case $VAR1 in 1) echo "Pick... (4 Replies)
Discussion started by: eclerget
4 Replies

4. Shell Programming and Scripting

Bash script to copy timestamps of multiple files

Hi, I have a bunch of media files in a directory that have been converted (from MTS to MOV format), so my directory contains something like this: clip1.mts clip1.mov clip2.mts clip2.mov The problem is that the .mov files that have been created have the timestamps of the conversion task,... (2 Replies)
Discussion started by: Krakus
2 Replies

5. Homework & Coursework Questions

NFS service not started in Redhat Cluster

Hi All, Need your help to resolve below error in cluter. Sep 9 05:37:30 node2 rgmanager: Starting disabled service service:Prod_Service Sep 9 05:37:30 node2 rgmanager: HA LVM: Improper setup detected Sep 9 05:37:30 node2 rgmanager: * initrd image needs to be newer than lvm.conf... (3 Replies)
Discussion started by: nitinredekar
3 Replies

6. Shell Programming and Scripting

Mount NFS Share On NFS Client via bash script.

I need a help of good people with effective bash script to mount nfs shared, By the way I did the searches, since i haven't found that someone wrote a script like this in the past, I'm sure it will serve more people. The scenario as follow: An NFS Client with Daily CRON , running bash script... (4 Replies)
Discussion started by: Brian.t
4 Replies

7. Shell Programming and Scripting

Loop through multiple files in bash script

Hi Everybody, I'm a newbie to shell scripting, and I'd appreciate some help. I have a bunch of .txt files that have some unwanted content. I want to remove lines 1-3 and 1028-1098. #!/bin/bash for '*.txt' in <path to folder> do sed '1,3 d' "$f"; sed '1028,1098 d' "$f"; done I... (2 Replies)
Discussion started by: BabyNuke
2 Replies

8. Red Hat

PaceMaker Cluster Fence Device

I have 2 VM's setup with a shared VMware disk running RHEL 7.1 (just updated to 7.2 with yum update), and would like to know what is the easiest Fence device to implement for testing purposes. Apparently, I need a fence device before my IP resources will come online. I have the cluster... (1 Reply)
Discussion started by: mrmurdock
1 Replies
PACEMAKER(8)						  System Administration Utilities					      PACEMAKER(8)

NAME
Pacemaker - Part of the Pacemaker cluster resource manager SYNOPSIS
crm_shadow (query|command) [modifiers] DESCRIPTION
crm_shadow - Perform configuration changes in a sandbox before updating the live cluster. Sets up an environment in which configuration tools (cibadmin, crm_resource, etc) work offline instead of against a live cluster, allowing changes to be previewed and tested for side-effects. OPTIONS
-?, --help This text -$, --version Version information -V, --verbose Increase debug output Queries: -w, --which Indicate the active shadow copy -p, --display Display the contents of the active shadow copy -E, --edit Edit the contents of the active shadow copy with your favorite $EDITOR -d, --diff Display the changes in the active shadow copy -F, --file Display the location of the active shadow copy file Commands: -c, --create=value Create the named shadow copy of the active cluster configuration -e, --create-empty=value Create the named shadow copy with an empty cluster configuration -C, --commit=value Upload the contents of the named shadow copy to the cluster -D, --delete=value Delete the contents of the named shadow copy -r, --reset=value Recreate the named shadow copy from the active cluster configuration -s, --switch=value (Advanced) Switch to the named shadow copy Additional Options: -f, --force (Advanced) Force the action to be performed -b, --batch (Advanced) Don't spawn a new shell -a, --all (Advanced) Upload the entire CIB, including status, with --commit EXAMPLES
Create a blank shadow configuration: # crm_shadow --create-empty myShadow Create a shadow configuration from the running cluster: # crm_shadow --create myShadow Display the current shadow configuration: # crm_shadow --display Discard the current shadow configuration (named myShadow): # crm_shadow --delete myShadow Upload the current shadow configuration (named myShadow) to the running cluster: # crm_shadow --commit myShadow AUTHOR
Written by Andrew Beekhof REPORTING BUGS
Report bugs to pacemaker@oss.clusterlabs.org Pacemaker 1.1.7 April 2012 PACEMAKER(8)
All times are GMT -4. The time now is 12:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy