1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

ctdb-scripts: Add config options for use by clustered NFS

Add CTDB_NFS_STATE_FS_TYPE and CTDB_NFS_STATE_MNT config options, show use in
nfs-ganesha-callout. Since the callout script is only an example, we
officially don't have default values for these.

Signed-off-by: Jose A. Rivera <jarrpa@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Jose A. Rivera 2016-04-28 21:18:05 -05:00 committed by Martin Schwenke
parent c7dbf720d8
commit 8b59705252
3 changed files with 37 additions and 21 deletions

View File

@ -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"

View File

@ -1061,19 +1061,6 @@ CTDB_PER_IP_ROUTING_TABLE_ID_HIGH=9000
<variablelist>
<varlistentry>
<term>CTDB_CLUSTER_FILESYSTEM_TYPE=gpfs</term>
<listitem>
<para>
The type of cluster filesystem to use with NFS-ganesha.
Currently only "gpfs" is supported.
</para>
<para>
Default is "gpfs".
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>CTDB_MANAGES_NFS=yes|no</term>
<listitem>
@ -1148,6 +1135,26 @@ CTDB_PER_IP_ROUTING_TABLE_ID_HIGH=9000
</listitem>
</varlistentry>
<varlistentry>
<term>CTDB_NFS_STATE_FS_TYPE=<parameter>TYPE</parameter></term>
<listitem>
<para>
The type of filesystem used for a clustered NFS' shared
state. No default.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>CTDB_NFS_STATE_MNT=<parameter>DIR</parameter></term>
<listitem>
<para>
The directory where a clustered NFS' shared state will be
located. No default.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect2>

View File

@ -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}')