local node_count_sofs_storage=0
hack_filter ()
{
- hack_shareddisks ()
- {
- # Make it so that only SoFS nodes get shared disks.
- [ -n "$SOFS_SHAREDDISK_TEMPLATE" ] && return 0
- SOFS_SHAREDDISK_TEMPLATE="$SHAREDDISK_TEMPLATE"
- SHAREDDISK_TEMPLATE=""
- }
-
case "$node_type" in
sofs_front)
node_count_sofs_front=$(($node_count_sofs_front + 1))
name="${CLUSTER}front${node_count_sofs_front}"
ctdb_node=1
- hack_shareddisks
;;
sofs_storage)
node_count_sofs_storage=$(($node_count_sofs_storage + 1))
ctdb_node=0
local ld=$(echo $DOMAIN | tr 'A-Z' 'a-z')
NSD_SERVERS="${NSD_SERVERS}${NSD_SERVERS:+,}${name}.${ld}"
- hack_shareddisks
esac
}
hack_all_nodes_with hack_filter
echo "Creating SoFS front-end node $name"
- # Only configure shared disks If there are no sofs_storage nodes.
- [ "${NODES/sofs_storage:/}" = "$NODES" ] && \
- local SHAREDDISK_TEMPLATE="$SOFS_SHAREDDISK_TEMPLATE"
+ # Drop shared disks on this node if it shouldn't have them...
+ if have_dedicated_storage_nodes ; then
+ local SHAREDDISK_TEMPLATE=""
+ fi
create_node_COMMON "$name" "$ip_offset" "$type"
}
echo "Creating SoFS storage node $name"
- local SHAREDDISK_TEMPLATE="$SOFS_SHAREDDISK_TEMPLATE"
-
create_node_COMMON "$name" "$ip_offset" "$type"
}
+have_dedicated_storage_nodes ()
+{
+ # True if there are sofs_storage nodes
+ [ "${NODES/sofs_storage:/}" != "$NODES" ]
+}
+
shared_disk_iscsi_setup_base ()
{
# Do the iSCSI setup on this node if there are no sofs_storage nodes