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
Showing
3 changed files
with
43 additions
and
0 deletions
... | @@ -40,6 +40,9 @@ cp -r $ONOS_ROOT/tools/package/etc/* $ONOS_STAGE/$KARAF_DIST/etc | ... | @@ -40,6 +40,9 @@ cp -r $ONOS_ROOT/tools/package/etc/* $ONOS_STAGE/$KARAF_DIST/etc |
40 | # Stage all builtin ONOS apps for factory install | 40 | # Stage all builtin ONOS apps for factory install |
41 | onos-stage-apps $ONOS_STAGE/apps $ONOS_STAGE/$KARAF_DIST/system | 41 | onos-stage-apps $ONOS_STAGE/apps $ONOS_STAGE/$KARAF_DIST/system |
42 | 42 | ||
43 | +# Mark the org.onosproject.drivers app active by default | ||
44 | +touch $ONOS_STAGE/apps/org.onosproject.drivers/active | ||
45 | + | ||
43 | # Patch-in proper Karaf version into the startup script | 46 | # Patch-in proper Karaf version into the startup script |
44 | sed "s/\$KARAF_VERSION/$KARAF_VERSION/g" \ | 47 | sed "s/\$KARAF_VERSION/$KARAF_VERSION/g" \ |
45 | $ONOS_ROOT/tools/package/bin/onos-service > bin/onos-service | 48 | $ONOS_ROOT/tools/package/bin/onos-service > bin/onos-service | ... | ... |
tools/package/bin/onos-config
0 → 100755
1 | +#!/bin/bash | ||
2 | +# ----------------------------------------------------------------------------- | ||
3 | +# Configures ONOS to multicast on the specified IP prefix/subnet. | ||
4 | +# ----------------------------------------------------------------------------- | ||
5 | + | ||
6 | +[ $# -lt 2 ] && echo "usage: $(basename $0) name ipPrefix" && exit 1 | ||
7 | + | ||
8 | +name=$1 | ||
9 | +ipPrefix=$2 | ||
10 | + | ||
11 | +hzXml=$(dirname $0)/../apache-karaf-*/etc/hazelcast.xml | ||
12 | + | ||
13 | +perl -pi.bak -e "s/^ <interface>[^<]*/ <interface>$ipPrefix/g" $hzXml | ||
14 | +perl -pi -e "s/ <name>[^<]*/ <name>$name/g" $hzXml |
tools/package/bin/onos-form-cluster
0 → 100755
1 | +#!/bin/bash | ||
2 | +# ----------------------------------------------------------------------------- | ||
3 | +# Forms ONOS cluster using REST API of each separate instance. | ||
4 | +# ----------------------------------------------------------------------------- | ||
5 | + | ||
6 | +[ $# -lt 2 ] && echo "usage: $(basename $0) ip1 ip2..." && exit 1 | ||
7 | + | ||
8 | +ip=$1 | ||
9 | +shift | ||
10 | +nodes=$* | ||
11 | + | ||
12 | +ipPrefix=${ip%.*} | ||
13 | + | ||
14 | +aux=/tmp/${ipPrefix}.cluster.json | ||
15 | +trap "rm -f $aux" EXIT | ||
16 | + | ||
17 | +echo "{ \"nodes\": [ { \"ip\": \"$ip\" }" > $aux | ||
18 | +for node in $nodes; do | ||
19 | + echo ", { \"ip\": \"$node\" }" >> $aux | ||
20 | +done | ||
21 | +echo "], \"ipPrefix\": \"$ipPrefix.*\" }" >> $aux | ||
22 | + | ||
23 | +for node in $ip $nodes; do | ||
24 | + echo "Forming cluster on $node..." | ||
25 | + curl -X POST http://$node:8181/onos/v1/cluster/configuration -d @$aux | ||
26 | +done | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or login to post a comment