diskimage unmount
}
-# Provides an easy way of removing nodes from $NODE.
-create_node_null () {
- :
-}
-
hack_network_map_hooks=""
# Uses: CLUSTER, NAME, NETWORKS, FIRSTIP, ip_offset
# configuration modules register their hacks.
run_hooks hack_nodes_functions
- if [ -n "$NUMNODES" ] ; then
- # Attempt to respect NUMNODES. Reduce the number of CTDB
- # nodes to NUMNODES.
- local numnodes=$NUMNODES
-
- hack_filter ()
- {
- if [ "$ctdb_node" = 1 ] ; then
- if [ $numnodes -gt 0 ] ; then
- numnodes=$(($numnodes - 1))
- else
- node_type="null"
- ctdb_node=0
- fi
- fi
- }
-
- hack_all_nodes_with hack_filter
-
- [ $numnodes -gt 0 ] && \
- die "Can't not use NUMNODES to increase the number of nodes over that specified by NODES. You need to set NODES instead - please read the documentation."
- fi
-
# Check IP addresses for duplicates.
local ip_offsets=":"
# This function doesn't modify anything...
# Build /etc/hosts and hack the names of the ctdb nodes
hosts_line_hack_name ()
{
- # Ignore nodes without names (e.g. "null")
- [ "$node_type" != "null" -a -n "$name" ] || return 0
-
local sname=""
local hosts_line
local ip_addr="${NETWORK_PRIVATE_PREFIX}.$(($FIRSTIP + $ip_offset))"
nodes_file="tmp/nodes.$CLUSTER"
local num_nodes=0
hack_all_nodes_with ctdb_nodes_line >$nodes_file
- : "${NUMNODES:=${num_nodes}}" # Set $NUMNODES if necessary
# Build UUID map
uuid_map="tmp/uuid_map.$CLUSTER"