Modified cluster script to output text during start/stop.
Modified cluster script to redirect stderr of onos.sh to stdout.
Fixed wrong keywords in onos-cluster.conf.
Change-Id: Iee2cd2259cc09b0e1be1184badbc02e65e5fd239
diff --git a/cluster-mgmt/conf/onos-cluster.conf b/cluster-mgmt/conf/onos-cluster.conf
index 09e6da2..d36dd35 100644
--- a/cluster-mgmt/conf/onos-cluster.conf
+++ b/cluster-mgmt/conf/onos-cluster.conf
@@ -27,7 +27,7 @@
#cluster.onosdev1.ip = 192.168.56.11
# Role of host
-cluster.onosdev1.role = rc-coord-and-server
+cluster.onosdev1.role = coord-and-server-node
# IP address or hostname of host used for ZooKeeper communication (cluster.onosdev1.ip by default)
#cluster.onosdev1.zk.host = 192.168.56.11
@@ -46,9 +46,9 @@
#cluster.onosdev1.hazelcast.ip = 192.168.56.11
# At least role must be specified for all hosts
-cluster.onosdev2.role = rc-server
-cluster.onosdev3.role = rc-server
-cluster.onosdev4.role = rc-server
+cluster.onosdev2.role = server-node
+cluster.onosdev3.role = server-node
+cluster.onosdev4.role = server-node
### SSH settings used for delivering config files ###
diff --git a/cluster-mgmt/onos-cluster.sh b/cluster-mgmt/onos-cluster.sh
index 2c8ee9b..e34fe16 100755
--- a/cluster-mgmt/onos-cluster.sh
+++ b/cluster-mgmt/onos-cluster.sh
@@ -121,6 +121,8 @@
function create-pssh-conf {
local tempfile=`begin-conf-creation ${PSSH_CONF}`
+ local filename=`basename ${PSSH_CONF}`
+ echo -n "Creating ${filename} ... "
# creation of pssh config file
for host in ${CLUSTER_HOSTS}; do
local user=$(read-conf ${CLUSTER_CONF} remote.${host}.ssh.user)
@@ -137,6 +139,7 @@
done
end-conf-creation ${PSSH_CONF}
+ echo "DONE"
}
# create-onos-conf {hostname}
@@ -151,6 +154,8 @@
local onos_conf="${CLUSTER_CONF_DIR}/onos_node.${host_name}.conf"
local tempfile=`begin-conf-creation ${onos_conf}`
+ local filename=`basename ${onos_conf}`
+ echo -n "Creating ${filename} ... "
cp ${ONOS_CONF_TEMPLATE} ${tempfile}
@@ -198,6 +203,8 @@
fi
end-conf-creation ${onos_conf}
+
+ echo "DONE"
}
# setup -f : force overwrite existing files
@@ -245,7 +252,11 @@
# falling back to common setting
user=$(read-conf ${CLUSTER_CONF} "remote.common.ssh.user")
fi
-
+
+ if [ -z "${user}" ]; then
+ user=`whoami`
+ fi
+
${SCP} ${conf} ${user}@${host}:${REMOTE_ONOS_CONF_DIR}
${SSH} ${user}@${host} "cd ${REMOTE_ONOS_HOME}; ./onos.sh setup -f"
done
@@ -267,7 +278,8 @@
exit 1
fi
- ${PSSH} -i -h ${PSSH_CONF} "cd ${REMOTE_ONOS_HOME}; ./onos.sh start"
+ echo "Starting ONOS cluster"
+ ${PSSH} -i -h ${PSSH_CONF} "cd ${REMOTE_ONOS_HOME}; ./onos.sh start 2>&1"
}
############################################
@@ -283,7 +295,8 @@
exit 1
fi
- ${PSSH} -i -h ${PSSH_CONF} "cd ${REMOTE_ONOS_HOME}; ./onos.sh stop"
+ echo "Stopping ONOS cluster"
+ ${PSSH} -i -h ${PSSH_CONF} "cd ${REMOTE_ONOS_HOME}; ./onos.sh stop 2>&1"
}
############################################
@@ -299,7 +312,7 @@
exit 1
fi
- ${PSSH} -i -h ${PSSH_CONF} "cd ${REMOTE_ONOS_HOME}; ./onos.sh status"
+ ${PSSH} -i -h ${PSSH_CONF} "cd ${REMOTE_ONOS_HOME}; ./onos.sh status 2>&1"
}
############################################