Browse code

initial commit of multi-node lxc

Anthony Young authored on 2011/09/16 12:37:29
Showing 1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,25 @@
0
+#!/usr/bin/env bash
1
+# Head node host, which runs glance, api, keystone
2
+HEAD_HOST=${HEAD_HOST:-192.168.1.52}
3
+COMPUTE_HOSTS=${COMPUTE_HOSTS:-192.168.1.53,192.168.1.54}
4
+
5
+# Networking params
6
+NAMESERVER=${NAMESERVER:-192.168.2.1}
7
+GATEWAY=${GATEWAY:-192.168.1.1}
8
+
9
+# Helper to launch containers
10
+function run_lxc {
11
+    # For some reason container names with periods can cause issues :/
12
+    container_name=`echo $1 | sed 's/\./_/g'`
13
+    CONTAINER=$container_name CONTAINER_IP=$1 CONTAINER_GATEWAY=$GATEWAY NAMESERVER=$NAMESERVER STACKSH_PARAMS="$2" ./build_lxc.sh
14
+}
15
+
16
+# Variables common amongst all hosts in the cluster
17
+COMMON_VARS="MYSQL_HOST=$HEAD_HOST RABBIT_HOST=$HEAD_HOST GLANCE_HOSTPORT=$HEAD_HOST:9292 NET_MAN=FlatDHCPManager FLAT_INTERFACE=eth0"
18
+
19
+# Launch the head node
20
+run_lxc $HEAD_HOST "$COMMON_VARS ENABLED_SERVICES=g-api,g-reg,key,n-api,n-sch,n-vnc,dash,mysql,rabbit"
21
+for compute_host in ${COMPUTE_HOSTS//,/ }; do
22
+    # Launch the compute hosts
23
+    run_lxc $compute_host "$COMMON_VARS ENABLED_SERVICES=n-cpu,n-net,n-api"
24
+done