summaryrefslogtreecommitdiffstats
path: root/autocluster
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2014-11-24 19:39:04 +1100
committerMartin Schwenke <martin@meltin.net>2014-11-25 11:25:54 +1100
commit31236814d989bbf6ed9e6488eb7867196ce95a48 (patch)
treee810fdbe7c6ca42e5118cd074ab877523162da07 /autocluster
parentd2b95463295b21fce7636a1373abca5282d14fa8 (diff)
downloadautocluster-31236814d989bbf6ed9e6488eb7867196ce95a48.tar.gz
autocluster-31236814d989bbf6ed9e6488eb7867196ce95a48.tar.xz
autocluster-31236814d989bbf6ed9e6488eb7867196ce95a48.zip
Create IPv4 and IPv6 nodes files
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'autocluster')
-rwxr-xr-xautocluster23
1 files changed, 22 insertions, 1 deletions
diff --git a/autocluster b/autocluster
index 0ae0f12..60d2e97 100755
--- a/autocluster
+++ b/autocluster
@@ -489,6 +489,17 @@ cluster_nodelist_hacking ()
local num_nodes=0
hack_all_nodes_with ctdb_nodes_line >$nodes_file
+ # Build /etc/ctdb/nodes.ipv6
+ ctdb_nodes_line_ipv6 ()
+ {
+ [ "$ctdb_node" = 1 ] || return 0
+ echo "fc00:${NETWORK_PRIVATE_PREFIX//./:}::$(($FIRSTIP + $ip_offset))"
+ num_nodes=$(($num_nodes + 1))
+ }
+ nodes_file_ipv6="tmp/nodes.$CLUSTER.ipv6"
+ local num_nodes=0
+ hack_all_nodes_with ctdb_nodes_line_ipv6 >$nodes_file_ipv6
+
# Build UUID map
uuid_map="tmp/uuid_map.$CLUSTER"
uuid_map_line ()
@@ -991,7 +1002,17 @@ setup_network()
echo "Setting up /etc/ctdb/nodes"
diskimage mkdir_p "/etc/ctdb"
- diskimage put "$nodes_file" "/etc/ctdb/nodes"
+ if [ "$NETWORK_STACK" = "ipv4" ] ; then
+ diskimage put "$nodes_file" "/etc/ctdb/nodes"
+ elif [ "$NETWORK_STACK" = "ipv6" ] ; then
+ diskimage put "$nodes_file_ipv6" "/etc/ctdb/nodes"
+ elif [ "$NETWORK_STACK" = "dual" ] ; then
+ diskimage put "$nodes_file" "/etc/ctdb/nodes.ipv4"
+ diskimage put "$nodes_file_ipv6" "/etc/ctdb/nodes.ipv6"
+ diskimage put "$nodes_file" "/etc/ctdb/nodes"
+ else
+ die "Error: Invalid NETWORK_STACK value \"$NETWORK_STACK\"."
+ fi
[ "$WEBPROXY" = "" ] || {
diskimage append_text "export http_proxy=$WEBPROXY" "/etc/bashrc"