summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-07-15 21:17:59 +1000
committerAndrew Tridgell <tridge@samba.org>2008-07-15 21:17:59 +1000
commit4dba26ab308502db2a4fa74b5924d69a2ccc7a33 (patch)
treea09899394def105bfff99dc964c4b90f159f69a6
parent3929d9a0d8385f05094d4c22c6e5d3d008d705ad (diff)
auto-create hosts file
-rwxr-xr-xautocluster15
-rw-r--r--functions2
2 files changed, 15 insertions, 2 deletions
diff --git a/autocluster b/autocluster
index 2e5de91..59a866a 100755
--- a/autocluster
+++ b/autocluster
@@ -176,6 +176,19 @@ create_cluster() {
echo "Creating TSM server node"
create_tsm "$CLUSTER"
+
+ echo "# autocluster $CLUSTER" > hosts.$CLUSTER
+ echo "$IPBASE.0.$FIRSTIP ${CLUSTER}tsm.$DOMAIN ${CLUSTER}tsm" >> hosts.$CLUSTER
+ for i in `seq 1 $NUMNODES`; do
+ echo "$IPBASE.0.`expr $FIRSTIP + $i` ${CLUSTER}n$i.$DOMAIN ${CLUSTER}n$i" >> hosts.$CLUSTER
+ done
+ echo >> hosts.$CLUSTER
+
+ echo "Cluster $CLUSTER created"
+ echo "You may want to add this to your /etc/hosts file:"
+ cat hosts.$CLUSTER
+
+ echo
}
###################
@@ -239,7 +252,7 @@ EOF
echo "Failed to create base image $DISK"
exit 1
fi
-
+
ls -l $DISK
cat <<EOF
diff --git a/functions b/functions
index cb00034..9cc2c8d 100644
--- a/functions
+++ b/functions
@@ -98,7 +98,7 @@ setup_network() {
echo "Setting up networks"
for i in `seq 1 $NUMNODES`; do
- echo "$IPBASE.0.`expr $FIRSTIP + $i` ${CLUSTER}n$i.vsofs1.com ${CLUSTER}n$i" >> mnt/etc/hosts
+ echo "$IPBASE.0.`expr $FIRSTIP + $i` ${CLUSTER}n$i.$DOMAIN ${CLUSTER}n$i" >> mnt/etc/hosts
done
echo "Setting up /etc/ctdb/nodes"