gpfs_num_nsds="@@GPFS_DEFAULT_NSDS@@"
cluster_name="@@CLUSTER@@"
mountpoint="@@CLUSTERFS_DEFAULT_MOUNTPOINT@@"
-nsd_servers="@@NSD_SERVERS@@"
+nodes_storage_gpfs="@@NODES_STORAGE_GPFS@@"
dir=$(dirname "$0")
##################################################
-# If there are sofs_storage nodes in the cluster (meaning that
-# other sofs_* nodes will not have direct-attached storage) then
+# If there are "storage_gpfs" nodes in the cluster (meaning that
+# other "sofs_front" nodes will not have direct-attached storage) then
# scripts that include this snippet must be run on one of the
# storage nodes. Therefore, in the case, this snippet tries to
-# determine if it is running on the 1st NSD server and, if not,
+# determine if it is running on the 1st GPFS storage node and, if not,
# attempts to run the script there.
-if [ -n "$nsd_servers" -a \
- "${HOSTNAME%%.*}" != "${nsd_servers%%[.,]*}" ] ; then
+if [ -n "$nodes_storage_gpfs" -a \
+ "${HOSTNAME%%.*}" != "${nodes_storage_gpfs%%[.,]*}" ] ; then
if [ "${0#/}" != "$0" ] ; then
script="$0"
else
script="${PWD}/${0}"
fi
- re_exec_node="${nsd_servers%%[.,]*}"
+ re_exec_node="${nodes_storage_gpfs%%[.,]*}"
echo
echo "Creating NSDs on node \"${re_exec_node}\""
exec ssh "$re_exec_node" "$script" "$@"
_first="${_nodes%% *}"
- # Determine primary and secondary nodes. Give preference to NSD
- # servers, falling back to regular nodes if there aren't any or
- # aren't enough.
- if [ -n "$nsd_servers" ] ; then
- _primary="${nsd_servers%%,*}"
- _rest="${nsd_servers#*,}"
+ # Determine primary and secondary nodes. Give preference to GPFS
+ # storage nodes, falling back to regular nodes if there aren't any
+ # or aren't enough.
+ if [ -n "$nodes_storage_gpfs" ] ; then
+ _primary="${nodes_storage_gpfs%%,*}"
+ _rest="${nodes_storage_gpfs#*,}"
_secondary="${_rest%%,*}"
fi
if [ -z "$_primary" ] ; then
for _n in $_nodes ; do
if [ "$_n" = "$_first" ] ; then
echo "${_n}:manager-quorum:"
- elif [ -n "$nsd_servers" ] ; then
+ elif [ -n "$nodes_storage_gpfs" ] ; then
echo "${_n}:manager:"
else
echo "${_n}:manager-quorum:"
fi
done
- for _n in $(echo "$nsd_servers" | sed -e 's@,@ @g') ; do
+ for _n in $(echo "$nodes_storage_gpfs" | sed -e 's@,@ @g') ; do
echo "${_n}:manager-quorum:"
done
} >"$_nodefile"
nsdfile="${dir}/gpfs_nsds_all.${cluster_name}"
-# Uses: nsd_servers
+# Uses: nodes_storage_gpfs
# Sets: nsdfile
gpfs_mknsd ()
{
sed -r -n -e "s@^[^[:space:]]+[[:space:]]+\(($pat)\)[[:space:]](dm-[^[:space:]]+).*@\1 \2@p" |
while read _name _disk ; do
_name=$(echo "$_name" | tr -d -c '[:alnum:]')
- echo "${_disk}:${nsd_servers}::dataAndMetadata:1:${_name}:"
+ echo "${_disk}:${nodes_storage_gpfs}::dataAndMetadata:1:${_name}:"
done >"$nsdfile"
mmcrnsd -F "$nsdfile"
{
! have_dedicated_storage_nodes
}
-
-######################################################################
-
-NSD_SERVERS=
-
-hack_nodes_sofs_storage ()
-{
- local node_count_sofs_storage=0
- hack_filter ()
- {
- if [ "$node_type" = "sofs_storage" ] ; then
- node_count_sofs_storage=$(($node_count_sofs_storage + 1))
- name="${CLUSTER}storage${node_count_sofs_storage}"
- ctdb_node=0
- local ld=$(echo $DOMAIN | tr 'A-Z' 'a-z')
- NSD_SERVERS="${NSD_SERVERS}${NSD_SERVERS:+,}${name}.${ld}"
- fi
- }
- hack_all_nodes_with hack_filter
-}
-
-register_hook hack_nodes_functions hack_nodes_sofs_storage
-
-create_node_sofs_storage ()
-{
- local ip_offset="$1"
- local name="$2"
- local ctdb_node="$3"
-
- echo "Creating SoFS storage node $name"
-
- create_node_COMMON "$name" "$ip_offset" "$type"
-}
-
-node_has_shared_disks_sofs_storage ()
-{
- true
-}
-
-is_dedicated_storage_node_sofs_storage ()
-{
- true
-}
--- /dev/null
+# Hey Emacs, this is a -*- shell-script -*- !!!
+
+NODES_STORAGE_GPFS=
+
+hack_nodes_storage_gpfs ()
+{
+ local node_count_storage_gpfs=0
+ hack_filter ()
+ {
+ if [ "$node_type" = "storage_gpfs" ] ; then
+ node_count_storage_gpfs=$(($node_count_storage_gpfs + 1))
+ name="${CLUSTER}storage${node_count_storage_gpfs}"
+ ctdb_node=0
+ local ld=$(echo $DOMAIN | tr 'A-Z' 'a-z')
+ NODES_STORAGE_GPFS="${NODES_STORAGE_GPFS}${NODES_STORAGE_GPFS:+,}${name}.${ld}"
+ fi
+ }
+ hack_all_nodes_with hack_filter
+}
+
+register_hook hack_nodes_functions hack_nodes_storage_gpfs
+
+create_node_storage_gpfs ()
+{
+ local ip_offset="$1"
+ local name="$2"
+ local ctdb_node="$3"
+
+ echo "Creating GPFS storage node $name"
+
+ create_node_COMMON "$name" "$ip_offset" "$type"
+}
+
+node_has_shared_disks_storage_gpfs ()
+{
+ true
+}
+
+is_dedicated_storage_node_storage_gpfs ()
+{
+ true
+}