diff options
author | Martin Schwenke <martin@meltin.net> | 2014-06-30 12:48:18 +1000 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2014-07-02 14:17:18 +1000 |
commit | f23154c98ce721207ca483a9a732cd64a3c88beb (patch) | |
tree | 87c67a2f11c35f31c2fc7aa9b640cf31c829a281 | |
parent | 9e181625af37233acd4ac6c1094bb4171d98e903 (diff) | |
download | autocluster-f23154c98ce721207ca483a9a732cd64a3c88beb.tar.gz autocluster-f23154c98ce721207ca483a9a732cd64a3c88beb.tar.xz autocluster-f23154c98ce721207ca483a9a732cd64a3c88beb.zip |
Split hack_nodes_sofs()
... into hack_nodes_sofs_front() and hack_nodes_sofs_storage(). This
allows 50.sofs.defconf to be split
Signed-off-by: Martin Schwenke <martin@meltin.net>
-rw-r--r-- | config.d/50sofs.defconf | 72 |
1 files changed, 40 insertions, 32 deletions
diff --git a/config.d/50sofs.defconf b/config.d/50sofs.defconf index 2976848..d951977 100644 --- a/config.d/50sofs.defconf +++ b/config.d/50sofs.defconf @@ -1,35 +1,21 @@ # Hey Emacs, this is a -*- shell-script -*- !!! -register_hook hack_nodes_functions hack_nodes_sofs - -NSD_SERVERS= - -hack_nodes_sofs () +hack_nodes_sofs_front () { - if [ "${NODES/sofs_*:/}" != "$NODES" ] ; then - # We have sofs_* nodes so name and tag them. - local node_count_sofs_front=0 - local node_count_sofs_storage=0 - hack_filter () - { - 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 - ;; - sofs_storage) - 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}" - esac - } - hack_all_nodes_with hack_filter - fi + local node_count_sofs_front=0 + hack_filter () + { + if [ "$node_type" = "sofs_front" ] ; then + node_count_sofs_front=$(($node_count_sofs_front + 1)) + name="${CLUSTER}front${node_count_sofs_front}" + ctdb_node=1 + fi + } + hack_all_nodes_with hack_filter } +register_hook hack_nodes_functions hack_nodes_sofs_front + create_node_sofs_front () { local ip_offset="$1" @@ -41,6 +27,33 @@ create_node_sofs_front () create_node_COMMON "$name" "$ip_offset" "$type" } +node_has_shared_disks_sofs_front () +{ + ! 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" @@ -52,11 +65,6 @@ create_node_sofs_storage () create_node_COMMON "$name" "$ip_offset" "$type" } -node_has_shared_disks_sofs_front () -{ - ! have_dedicated_storage_nodes -} - node_has_shared_disks_sofs_storage () { true |