Madan Jampani
Committed by Brian O'Connor

Ensure cluster metadata is setup as part of onos-run-karaf

Change-Id: I88e61459cec6af8a2762a439ece6fc4d33d87ee4
......@@ -25,6 +25,19 @@ export ONOS_HOME=$PWD
# FIXME: for now we're running using the karaf client; later use raw SSH
unset ONOS_USE_SSH
# Create config/cluster.json (cluster metadata)
ONOS_IP=${ONOS_IP:-127.0.0.1}
IP="${1:-$ONOS_IP}"
echo "Creating local cluster configs for IP $IP..."
[ -d $ONOS_HOME/config ] || mkdir -p $ONOS_HOME/config
cat > $ONOS_HOME/config/cluster.json <<EOF
{
"name": "default",
"nodes": [ {"id": "$IP", "ip": "$IP", "port": 9876 } ],
"partitions": [ { "id": 1, "members": [ "$IP" ] } ]
}
EOF
# Start ONOS as a server, but include any specified options
./bin/onos-service server "$@" &>onos.log &
echo "$!" > /tmp/onos.pid
......@@ -41,4 +54,5 @@ until [ $RETRY_COUNT -le 0 ]; do
RETRY_COUNT=$[$RETRY_COUNT-1]
sleep 1
done
echo "Fail to open karaf.log"
\ No newline at end of file
echo "Fail to open karaf.log"
......