diff --git a/ctdb/config/events.d/60.nfs b/ctdb/config/events.d/60.nfs index c25b73e0cd3..57cfbffa2e9 100755 --- a/ctdb/config/events.d/60.nfs +++ b/ctdb/config/events.d/60.nfs @@ -21,6 +21,14 @@ export CTDB_NFS_CALLOUT # If the callout wants to use this then it must create it export CTDB_NFS_CALLOUT_STATE_DIR="${service_state_dir}/callout-state" +# Export, if set, for use by clustered NFS callouts +if [ -n "$CTDB_NFS_STATE_FS_TYPE" ] ; then + export CTDB_NFS_STATE_FS_TYPE +fi +if [ -n "$CTDB_NFS_STATE_MNT" ] ; then + export CTDB_NFS_STATE_MNT +fi + nfs_callout_cache="${service_state_dir}/nfs_callout_cache" nfs_callout_cache_callout="${nfs_callout_cache}/CTDB_NFS_CALLOUT" nfs_callout_cache_ops="${nfs_callout_cache}/ops" diff --git a/ctdb/doc/ctdbd.conf.5.xml b/ctdb/doc/ctdbd.conf.5.xml index a364c9f0fc1..f69f705c6e1 100644 --- a/ctdb/doc/ctdbd.conf.5.xml +++ b/ctdb/doc/ctdbd.conf.5.xml @@ -1061,19 +1061,6 @@ CTDB_PER_IP_ROUTING_TABLE_ID_HIGH=9000 - - CTDB_CLUSTER_FILESYSTEM_TYPE=gpfs - - - The type of cluster filesystem to use with NFS-ganesha. - Currently only "gpfs" is supported. - - - Default is "gpfs". - - - - CTDB_MANAGES_NFS=yes|no @@ -1148,6 +1135,26 @@ CTDB_PER_IP_ROUTING_TABLE_ID_HIGH=9000 + + CTDB_NFS_STATE_FS_TYPE=TYPE + + + The type of filesystem used for a clustered NFS' shared + state. No default. + + + + + + CTDB_NFS_STATE_MNT=DIR + + + The directory where a clustered NFS' shared state will be + located. No default. + + + + diff --git a/ctdb/doc/examples/nfs-ganesha-callout b/ctdb/doc/examples/nfs-ganesha-callout index 80bba898f17..06d08ad00e3 100755 --- a/ctdb/doc/examples/nfs-ganesha-callout +++ b/ctdb/doc/examples/nfs-ganesha-callout @@ -39,6 +39,11 @@ # Exit on 1st error set -e +# Filesystem type and mount point for the (typically clustered) +# volume that will contain the NFS-Ganesha state. +state_fs="${CTDB_NFS_STATE_FS_TYPE:-gpfs}" +state_dir="${CTDB_NFS_STATE_MNT}" # No sane default. + # To change the following, edit the default values below. Do not set # these - they aren't configuration variables, just hooks for testing. nfs_exports_file="${CTDB_NFS_EXPORTS_FILE:-/etc/ganesha/ganesha.conf}" @@ -46,10 +51,6 @@ nfs_service="${CTDB_NFS_SERVICE:-nfs-ganesha}" ganesha_rec_subdir=${CTDB_GANESHA_REC_SUBDIR:-.ganesha} procfs=${PROCFS_PATH:-/proc} -if [ -z "$CTDB_CLUSTER_FILESYSTEM_TYPE" ] ; then - CTDB_CLUSTER_FILESYSTEM_TYPE="gpfs" -fi - ################################################## @@ -151,12 +152,12 @@ check_ln () # Return 'active' if the shared filesystem is accessible. get_cluster_fs_state () { - case $CTDB_CLUSTER_FILESYSTEM_TYPE in + case $state_fs in gpfs) /usr/lpp/mmfs/bin/mmgetstate | awk 'NR == 4 { print $3 }' ;; *) - echo "File system $CTDB_CLUSTER_FILESYSTEM_TYPE not supported" + echo "File system $state_fs not supported" exit 1 ;; esac @@ -164,9 +165,9 @@ get_cluster_fs_state () create_ganesha_recdirs () { - _mounts=$(mount -t $CTDB_CLUSTER_FILESYSTEM_TYPE) + _mounts=$(mount -t $state_fs) if [ -z "$_mounts" ]; then - echo "startup $CTDB_CLUSTER_FILESYSTEM_TYPE not ready" + echo "startup $state_fs not ready" exit 0 fi _mntpt=$(echo "$_mounts" | sort | awk 'NR == 1 {print $3}')