Thomas Vachuska
Committed by Gerrit Code Review

Adding onos-form-cluster & onos-config to the packaged runtime tools to allow in…

…stallation and cluster configuration w/o any of the test or dev tools.

Change-Id: I84a9b0b82c623e17d43e053ca98c90937f532a63
......@@ -40,6 +40,9 @@ cp -r $ONOS_ROOT/tools/package/etc/* $ONOS_STAGE/$KARAF_DIST/etc
# Stage all builtin ONOS apps for factory install
onos-stage-apps $ONOS_STAGE/apps $ONOS_STAGE/$KARAF_DIST/system
# Mark the org.onosproject.drivers app active by default
touch $ONOS_STAGE/apps/org.onosproject.drivers/active
# Patch-in proper Karaf version into the startup script
sed "s/\$KARAF_VERSION/$KARAF_VERSION/g" \
$ONOS_ROOT/tools/package/bin/onos-service > bin/onos-service
......
#!/bin/bash
# -----------------------------------------------------------------------------
# Configures ONOS to multicast on the specified IP prefix/subnet.
# -----------------------------------------------------------------------------
[ $# -lt 2 ] && echo "usage: $(basename $0) name ipPrefix" && exit 1
name=$1
ipPrefix=$2
hzXml=$(dirname $0)/../apache-karaf-*/etc/hazelcast.xml
perl -pi.bak -e "s/^ <interface>[^<]*/ <interface>$ipPrefix/g" $hzXml
perl -pi -e "s/ <name>[^<]*/ <name>$name/g" $hzXml
#!/bin/bash
# -----------------------------------------------------------------------------
# Forms ONOS cluster using REST API of each separate instance.
# -----------------------------------------------------------------------------
[ $# -lt 2 ] && echo "usage: $(basename $0) ip1 ip2..." && exit 1
ip=$1
shift
nodes=$*
ipPrefix=${ip%.*}
aux=/tmp/${ipPrefix}.cluster.json
trap "rm -f $aux" EXIT
echo "{ \"nodes\": [ { \"ip\": \"$ip\" }" > $aux
for node in $nodes; do
echo ", { \"ip\": \"$node\" }" >> $aux
done
echo "], \"ipPrefix\": \"$ipPrefix.*\" }" >> $aux
for node in $ip $nodes; do
echo "Forming cluster on $node..."
curl -X POST http://$node:8181/onos/v1/cluster/configuration -d @$aux
done
\ No newline at end of file