diff options
author | Martin Schwenke <martin@meltin.net> | 2014-06-30 10:19:29 +1000 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2014-07-02 14:17:18 +1000 |
commit | c6870f20e2e30ec5dd971c324ba609e6888150fd (patch) | |
tree | 8b60635bf19203c52876db9cd79108cf7f68af0d /config.d | |
parent | f9e3e0cbbe931b1d4dcbfbf2607f2f1f5c8bdb75 (diff) | |
download | autocluster-c6870f20e2e30ec5dd971c324ba609e6888150fd.tar.gz autocluster-c6870f20e2e30ec5dd971c324ba609e6888150fd.tar.xz autocluster-c6870f20e2e30ec5dd971c324ba609e6888150fd.zip |
Simplify shared disk logic for sofs_front and sofs_storage nodes
Signed-off-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'config.d')
-rw-r--r-- | config.d/50sofs.defconf | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/config.d/50sofs.defconf b/config.d/50sofs.defconf index c83e558..38bb710 100644 --- a/config.d/50sofs.defconf +++ b/config.d/50sofs.defconf @@ -12,20 +12,11 @@ hack_nodes_sofs () 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)) @@ -33,7 +24,6 @@ hack_nodes_sofs () 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 @@ -48,9 +38,10 @@ create_node_sofs_front () 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" } @@ -63,11 +54,15 @@ create_node_sofs_storage () 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 |