Merge branch 'master' of ssh://gerrit.onlab.us:29418/onos-next
Showing
24 changed files
with
225 additions
and
179 deletions
1 | +package org.onlab.onos.cluster; | ||
2 | + | ||
3 | +import org.onlab.onos.net.DeviceId; | ||
4 | +import org.onlab.onos.net.MastershipRole; | ||
5 | + | ||
6 | +/** | ||
7 | + * Service for administering the inventory of device masterships. | ||
8 | + */ | ||
9 | +public interface MastershipAdminService { | ||
10 | + | ||
11 | + /** | ||
12 | + * Applies the current mastership role for the specified device. | ||
13 | + * | ||
14 | + * @param instance controller instance identifier | ||
15 | + * @param deviceId device identifier | ||
16 | + * @param role requested role | ||
17 | + */ | ||
18 | + void setRole(InstanceId instance, DeviceId deviceId, MastershipRole role); | ||
19 | + | ||
20 | +} |
... | @@ -4,7 +4,7 @@ import org.onlab.onos.event.AbstractEvent; | ... | @@ -4,7 +4,7 @@ import org.onlab.onos.event.AbstractEvent; |
4 | import org.onlab.onos.net.DeviceId; | 4 | import org.onlab.onos.net.DeviceId; |
5 | 5 | ||
6 | /** | 6 | /** |
7 | - * Describes infrastructure device event. | 7 | + * Describes a device mastership event. |
8 | */ | 8 | */ |
9 | public class MastershipEvent extends AbstractEvent<MastershipEvent.Type, DeviceId> { | 9 | public class MastershipEvent extends AbstractEvent<MastershipEvent.Type, DeviceId> { |
10 | 10 | ... | ... |
... | @@ -49,6 +49,6 @@ public interface MastershipService { | ... | @@ -49,6 +49,6 @@ public interface MastershipService { |
49 | * | 49 | * |
50 | * @param listener the mastership listener | 50 | * @param listener the mastership listener |
51 | */ | 51 | */ |
52 | - void removeListemer(MastershipListener listener); | 52 | + void removeListener(MastershipListener listener); |
53 | 53 | ||
54 | } | 54 | } | ... | ... |
1 | +package org.onlab.onos.cluster; | ||
2 | + | ||
3 | +import java.util.Set; | ||
4 | + | ||
5 | +import org.onlab.onos.net.DeviceId; | ||
6 | +import org.onlab.onos.net.MastershipRole; | ||
7 | + | ||
8 | +/** | ||
9 | + * Manages inventory of mastership roles for devices, across controller instances. | ||
10 | + */ | ||
11 | +public interface MastershipStore { | ||
12 | + | ||
13 | + // three things to map: InstanceId, DeviceId, MastershipRole | ||
14 | + | ||
15 | + /** | ||
16 | + * Sets a device's role for a specified controller instance. | ||
17 | + * | ||
18 | + * @param instance controller instance identifier | ||
19 | + * @param deviceId device identifier | ||
20 | + * @param role new role | ||
21 | + * @return a mastership event | ||
22 | + */ | ||
23 | + MastershipEvent setRole( | ||
24 | + InstanceId instance, DeviceId deviceId, MastershipRole role); | ||
25 | + | ||
26 | + /** | ||
27 | + * Adds or updates the mastership information for a device. | ||
28 | + * | ||
29 | + * @param instance controller instance identifier | ||
30 | + * @param deviceId device identifier | ||
31 | + * @param role new role | ||
32 | + * @return a mastership event | ||
33 | + */ | ||
34 | + MastershipEvent addOrUpdateDevice( | ||
35 | + InstanceId instance, DeviceId deviceId, MastershipRole role); | ||
36 | + | ||
37 | + /** | ||
38 | + * Returns the master for a device. | ||
39 | + * | ||
40 | + * @param deviceId the device identifier | ||
41 | + * @return the instance identifier of the master | ||
42 | + */ | ||
43 | + InstanceId getMaster(DeviceId deviceId); | ||
44 | + | ||
45 | + /** | ||
46 | + * Returns the devices that a controller instance is master of. | ||
47 | + * | ||
48 | + * @param instanceId the instance identifier | ||
49 | + * @return a set of device identifiers | ||
50 | + */ | ||
51 | + Set<DeviceId> getDevices(InstanceId instanceId); | ||
52 | + | ||
53 | + /** | ||
54 | + * Returns the role of a device for a specific controller instance. | ||
55 | + * | ||
56 | + * @param instanceId the instance identifier | ||
57 | + * @param deviceId the device identifiers | ||
58 | + * @return the role | ||
59 | + */ | ||
60 | + MastershipRole getRole(InstanceId instanceId, DeviceId deviceId); | ||
61 | +} |
... | @@ -13,7 +13,9 @@ public interface DeviceAdminService { | ... | @@ -13,7 +13,9 @@ public interface DeviceAdminService { |
13 | * | 13 | * |
14 | * @param deviceId device identifier | 14 | * @param deviceId device identifier |
15 | * @param role requested role | 15 | * @param role requested role |
16 | + * @deprecated Will be removed in favor of MastershipAdminService.setRole() | ||
16 | */ | 17 | */ |
18 | + @Deprecated | ||
17 | void setRole(DeviceId deviceId, MastershipRole role); | 19 | void setRole(DeviceId deviceId, MastershipRole role); |
18 | 20 | ||
19 | /** | 21 | /** | ... | ... |
1 | package org.onlab.onos.net.device.impl; | 1 | package org.onlab.onos.net.device.impl; |
2 | 2 | ||
3 | +import com.hazelcast.core.HazelcastInstance; | ||
3 | import org.junit.After; | 4 | import org.junit.After; |
4 | import org.junit.Before; | 5 | import org.junit.Before; |
5 | import org.junit.Test; | 6 | import org.junit.Test; |
... | @@ -23,6 +24,7 @@ import org.onlab.onos.net.device.PortDescription; | ... | @@ -23,6 +24,7 @@ import org.onlab.onos.net.device.PortDescription; |
23 | import org.onlab.onos.net.provider.AbstractProvider; | 24 | import org.onlab.onos.net.provider.AbstractProvider; |
24 | import org.onlab.onos.net.provider.ProviderId; | 25 | import org.onlab.onos.net.provider.ProviderId; |
25 | import org.onlab.onos.event.impl.TestEventDispatcher; | 26 | import org.onlab.onos.event.impl.TestEventDispatcher; |
27 | +import org.onlab.onos.store.StoreService; | ||
26 | import org.onlab.onos.store.device.impl.DistributedDeviceStore; | 28 | import org.onlab.onos.store.device.impl.DistributedDeviceStore; |
27 | 29 | ||
28 | import com.google.common.collect.Iterables; | 30 | import com.google.common.collect.Iterables; |
... | @@ -76,7 +78,6 @@ public class DistributedDeviceManagerTest { | ... | @@ -76,7 +78,6 @@ public class DistributedDeviceManagerTest { |
76 | service = mgr; | 78 | service = mgr; |
77 | admin = mgr; | 79 | admin = mgr; |
78 | registry = mgr; | 80 | registry = mgr; |
79 | - dstore = new DistributedDeviceStore(); | ||
80 | // FIXME should be reading the hazelcast.xml | 81 | // FIXME should be reading the hazelcast.xml |
81 | Config config = new Config(); | 82 | Config config = new Config(); |
82 | // avoid accidentally joining other cluster | 83 | // avoid accidentally joining other cluster |
... | @@ -88,7 +89,7 @@ public class DistributedDeviceManagerTest { | ... | @@ -88,7 +89,7 @@ public class DistributedDeviceManagerTest { |
88 | config.getNetworkConfig().getJoin() | 89 | config.getNetworkConfig().getJoin() |
89 | .getMulticastConfig() | 90 | .getMulticastConfig() |
90 | .setEnabled(false); | 91 | .setEnabled(false); |
91 | - dstore.theInstance = Hazelcast.newHazelcastInstance(config); | 92 | + dstore = new TestDistributedDeviceStore(Hazelcast.newHazelcastInstance(config)); |
92 | dstore.activate(); | 93 | dstore.activate(); |
93 | mgr.store = dstore; | 94 | mgr.store = dstore; |
94 | mgr.eventDispatcher = new TestEventDispatcher(); | 95 | mgr.eventDispatcher = new TestEventDispatcher(); |
... | @@ -280,4 +281,14 @@ public class DistributedDeviceManagerTest { | ... | @@ -280,4 +281,14 @@ public class DistributedDeviceManagerTest { |
280 | } | 281 | } |
281 | } | 282 | } |
282 | 283 | ||
284 | + private class TestDistributedDeviceStore extends DistributedDeviceStore { | ||
285 | + public TestDistributedDeviceStore(final HazelcastInstance hazelcastInstance) { | ||
286 | + storeService = new StoreService() { | ||
287 | + @Override | ||
288 | + public HazelcastInstance getHazelcastInstance() { | ||
289 | + return hazelcastInstance; | ||
290 | + } | ||
291 | + }; | ||
292 | + } | ||
293 | + } | ||
283 | } | 294 | } | ... | ... |
1 | +package org.onlab.onos.store; | ||
2 | + | ||
3 | +import com.hazelcast.core.HazelcastInstance; | ||
4 | + | ||
5 | +/** | ||
6 | + * Bootstrap service to get a handle on a share Hazelcast instance. | ||
7 | + */ | ||
8 | +public interface StoreService { | ||
9 | + | ||
10 | + /** | ||
11 | + * Returns the shared Hazelcast instance for use as a distributed store | ||
12 | + * backing. | ||
13 | + * | ||
14 | + * @return shared Hazelcast instance | ||
15 | + */ | ||
16 | + HazelcastInstance getHazelcastInstance(); | ||
17 | + | ||
18 | +} |
... | @@ -40,6 +40,7 @@ import org.onlab.onos.net.device.DeviceEvent; | ... | @@ -40,6 +40,7 @@ import org.onlab.onos.net.device.DeviceEvent; |
40 | import org.onlab.onos.net.device.DeviceStore; | 40 | import org.onlab.onos.net.device.DeviceStore; |
41 | import org.onlab.onos.net.device.PortDescription; | 41 | import org.onlab.onos.net.device.PortDescription; |
42 | import org.onlab.onos.net.provider.ProviderId; | 42 | import org.onlab.onos.net.provider.ProviderId; |
43 | +import org.onlab.onos.store.StoreService; | ||
43 | import org.onlab.util.KryoPool; | 44 | import org.onlab.util.KryoPool; |
44 | import org.slf4j.Logger; | 45 | import org.slf4j.Logger; |
45 | 46 | ||
... | @@ -187,12 +188,15 @@ public class DistributedDeviceStore implements DeviceStore { | ... | @@ -187,12 +188,15 @@ public class DistributedDeviceStore implements DeviceStore { |
187 | 188 | ||
188 | // FIXME change to protected once we remove DistributedDeviceManagerTest. | 189 | // FIXME change to protected once we remove DistributedDeviceManagerTest. |
189 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 190 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
191 | + protected StoreService storeService; | ||
192 | + | ||
190 | /*protected*/public HazelcastInstance theInstance; | 193 | /*protected*/public HazelcastInstance theInstance; |
191 | 194 | ||
192 | 195 | ||
193 | @Activate | 196 | @Activate |
194 | public void activate() { | 197 | public void activate() { |
195 | log.info("Started"); | 198 | log.info("Started"); |
199 | + theInstance = storeService.getHazelcastInstance(); | ||
196 | 200 | ||
197 | // IMap event handler needs value | 201 | // IMap event handler needs value |
198 | final boolean includeValue = true; | 202 | final boolean includeValue = true; | ... | ... |
1 | +package org.onlab.onos.store.impl; | ||
2 | + | ||
3 | +import com.hazelcast.core.Hazelcast; | ||
4 | +import com.hazelcast.core.HazelcastInstance; | ||
5 | +import org.apache.felix.scr.annotations.Activate; | ||
6 | +import org.apache.felix.scr.annotations.Component; | ||
7 | +import org.apache.felix.scr.annotations.Deactivate; | ||
8 | +import org.apache.felix.scr.annotations.Service; | ||
9 | +import org.onlab.onos.store.StoreService; | ||
10 | +import org.slf4j.Logger; | ||
11 | +import org.slf4j.LoggerFactory; | ||
12 | + | ||
13 | +/** | ||
14 | + * Auxiliary bootstrap of distributed store. | ||
15 | + */ | ||
16 | +@Component(immediate = true) | ||
17 | +@Service | ||
18 | +public class StoreManager implements StoreService { | ||
19 | + | ||
20 | + private final Logger log = LoggerFactory.getLogger(getClass()); | ||
21 | + | ||
22 | + protected HazelcastInstance instance; | ||
23 | + | ||
24 | + @Activate | ||
25 | + public void activate() { | ||
26 | + instance = Hazelcast.newHazelcastInstance(); | ||
27 | + log.info("Started"); | ||
28 | + } | ||
29 | + | ||
30 | + @Deactivate | ||
31 | + public void deactivate() { | ||
32 | + log.info("Stopped"); | ||
33 | + } | ||
34 | + | ||
35 | + @Override | ||
36 | + public HazelcastInstance getHazelcastInstance() { | ||
37 | + return instance; | ||
38 | + } | ||
39 | +} |
... | @@ -10,9 +10,13 @@ | ... | @@ -10,9 +10,13 @@ |
10 | <bundle>mvn:com.google.guava/guava/18.0</bundle> | 10 | <bundle>mvn:com.google.guava/guava/18.0</bundle> |
11 | <bundle>mvn:io.netty/netty/3.9.2.Final</bundle> | 11 | <bundle>mvn:io.netty/netty/3.9.2.Final</bundle> |
12 | 12 | ||
13 | + <bundle>mvn:com.hazelcast/hazelcast/3.3</bundle> | ||
14 | + <bundle>mvn:com.eclipsesource.minimal-json/minimal-json/0.9.1</bundle> | ||
15 | + | ||
13 | <bundle>mvn:com.esotericsoftware.kryo/kryo/2.24.0</bundle> | 16 | <bundle>mvn:com.esotericsoftware.kryo/kryo/2.24.0</bundle> |
14 | <bundle>mvn:com.esotericsoftware/minlog/1.3.0</bundle> | 17 | <bundle>mvn:com.esotericsoftware/minlog/1.3.0</bundle> |
15 | <bundle>mvn:org.objenesis/objenesis/2.1</bundle> | 18 | <bundle>mvn:org.objenesis/objenesis/2.1</bundle> |
19 | + <bundle>mvn:de.javakaffee/kryo-serializers/0.27</bundle> | ||
16 | </feature> | 20 | </feature> |
17 | 21 | ||
18 | <feature name="onos-thirdparty-web" version="1.0.0" | 22 | <feature name="onos-thirdparty-web" version="1.0.0" |
... | @@ -42,6 +46,13 @@ | ... | @@ -42,6 +46,13 @@ |
42 | description="ONOS core components"> | 46 | description="ONOS core components"> |
43 | <feature>onos-api</feature> | 47 | <feature>onos-api</feature> |
44 | <bundle>mvn:org.onlab.onos/onos-core-net/1.0.0-SNAPSHOT</bundle> | 48 | <bundle>mvn:org.onlab.onos/onos-core-net/1.0.0-SNAPSHOT</bundle> |
49 | + <bundle>mvn:org.onlab.onos/onos-core-store/1.0.0-SNAPSHOT</bundle> | ||
50 | + </feature> | ||
51 | + | ||
52 | + <feature name="onos-core-trivial" version="1.0.0" | ||
53 | + description="ONOS core components"> | ||
54 | + <feature>onos-api</feature> | ||
55 | + <bundle>mvn:org.onlab.onos/onos-core-net/1.0.0-SNAPSHOT</bundle> | ||
45 | <bundle>mvn:org.onlab.onos/onos-core-trivial/1.0.0-SNAPSHOT</bundle> | 56 | <bundle>mvn:org.onlab.onos/onos-core-trivial/1.0.0-SNAPSHOT</bundle> |
46 | </feature> | 57 | </feature> |
47 | 58 | ... | ... |
... | @@ -139,6 +139,11 @@ | ... | @@ -139,6 +139,11 @@ |
139 | <version>3.3</version> | 139 | <version>3.3</version> |
140 | </dependency> | 140 | </dependency> |
141 | <dependency> | 141 | <dependency> |
142 | + <groupId>com.eclipsesource.minimal-json</groupId> | ||
143 | + <artifactId>minimal-json</artifactId> | ||
144 | + <version>0.9.1</version> | ||
145 | + </dependency> | ||
146 | + <dependency> | ||
142 | <groupId>com.esotericsoftware.kryo</groupId> | 147 | <groupId>com.esotericsoftware.kryo</groupId> |
143 | <artifactId>kryo</artifactId> | 148 | <artifactId>kryo</artifactId> |
144 | <version>2.24.0</version> | 149 | <version>2.24.0</version> | ... | ... |
... | @@ -26,7 +26,7 @@ mkdir bin | ... | @@ -26,7 +26,7 @@ mkdir bin |
26 | 26 | ||
27 | # Stage the ONOS admin scripts and patch in Karaf service wrapper extras | 27 | # Stage the ONOS admin scripts and patch in Karaf service wrapper extras |
28 | cp -r $ONOS_ROOT/tools/package/bin . | 28 | cp -r $ONOS_ROOT/tools/package/bin . |
29 | -cp -r $ONOS_ROOT/tools/package/wrapper/* $KARAF_DIST | 29 | +cp -r $ONOS_ROOT/tools/package/debian $ONOS_STAGE/debian |
30 | cp -r $ONOS_ROOT/tools/package/etc/* $KARAF_DIST/etc | 30 | cp -r $ONOS_ROOT/tools/package/etc/* $KARAF_DIST/etc |
31 | 31 | ||
32 | # Stage the ONOS bundles | 32 | # Stage the ONOS bundles |
... | @@ -40,7 +40,7 @@ perl -pi.old -e "s|^(featuresRepositories=.*)|\1,mvn:org.apache.karaf.cellar/apa | ... | @@ -40,7 +40,7 @@ perl -pi.old -e "s|^(featuresRepositories=.*)|\1,mvn:org.apache.karaf.cellar/apa |
40 | $ONOS_STAGE/$KARAF_DIST/etc/org.apache.karaf.features.cfg | 40 | $ONOS_STAGE/$KARAF_DIST/etc/org.apache.karaf.features.cfg |
41 | 41 | ||
42 | # Patch the Apache Karaf distribution file to load ONOS features | 42 | # Patch the Apache Karaf distribution file to load ONOS features |
43 | -perl -pi.old -e 's|^(featuresBoot=.*)|\1,wrapper,cellar|' \ | 43 | +perl -pi.old -e 's|^(featuresBoot=.*)|\1,cellar|' \ |
44 | $ONOS_STAGE/$KARAF_DIST/etc/org.apache.karaf.features.cfg | 44 | $ONOS_STAGE/$KARAF_DIST/etc/org.apache.karaf.features.cfg |
45 | 45 | ||
46 | # ONOS Patching ---------------------------------------------------------------- | 46 | # ONOS Patching ---------------------------------------------------------------- |
... | @@ -49,15 +49,10 @@ perl -pi.old -e 's|^(featuresBoot=.*)|\1,wrapper,cellar|' \ | ... | @@ -49,15 +49,10 @@ perl -pi.old -e 's|^(featuresBoot=.*)|\1,wrapper,cellar|' \ |
49 | perl -pi.old -e "s|^(featuresRepositories=.*)|\1,mvn:org.onlab.onos/onos-features/$ONOS_VERSION/xml/features|" \ | 49 | perl -pi.old -e "s|^(featuresRepositories=.*)|\1,mvn:org.onlab.onos/onos-features/$ONOS_VERSION/xml/features|" \ |
50 | $ONOS_STAGE/$KARAF_DIST/etc/org.apache.karaf.features.cfg | 50 | $ONOS_STAGE/$KARAF_DIST/etc/org.apache.karaf.features.cfg |
51 | 51 | ||
52 | -# Patch the Apache Karaf distribution file to load ONOS features | ||
53 | -#perl -pi.old -e 's|^(featuresBoot=.*)|\1,onos-api,onos-core,onos-cli,onos-rest,onos-gui,onos-openflow,onos-app-tvue,onos-app-fwd|' \ | ||
54 | -# $ONOS_STAGE/$KARAF_DIST/etc/org.apache.karaf.features.cfg | ||
55 | - | ||
56 | # Patch the Apache Karaf distribution with ONOS branding bundle | 52 | # Patch the Apache Karaf distribution with ONOS branding bundle |
57 | cp $M2_REPO/org/onlab/onos/onos-branding/$ONOS_VERSION/onos-branding-*.jar \ | 53 | cp $M2_REPO/org/onlab/onos/onos-branding/$ONOS_VERSION/onos-branding-*.jar \ |
58 | $ONOS_STAGE/$KARAF_DIST/lib | 54 | $ONOS_STAGE/$KARAF_DIST/lib |
59 | 55 | ||
60 | - | ||
61 | # Now package up the ONOS tar file | 56 | # Now package up the ONOS tar file |
62 | cd $ONOS_STAGE_ROOT | 57 | cd $ONOS_STAGE_ROOT |
63 | COPYFILE_DISABLE=1 tar zcf $ONOS_TAR $ONOS_BITS | 58 | COPYFILE_DISABLE=1 tar zcf $ONOS_TAR $ONOS_BITS | ... | ... |
... | @@ -3,7 +3,7 @@ | ... | @@ -3,7 +3,7 @@ |
3 | # ONOS command-line client | 3 | # ONOS command-line client |
4 | #------------------------------------------------------------------------------- | 4 | #------------------------------------------------------------------------------- |
5 | 5 | ||
6 | -export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/ | 6 | +export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-7-openjdk-amd64/} |
7 | 7 | ||
8 | cd $(dirname $0)/../apache-karaf-*/bin | 8 | cd $(dirname $0)/../apache-karaf-*/bin |
9 | ./client -h localhost "$@" | 9 | ./client -h localhost "$@" | ... | ... |
... | @@ -3,8 +3,8 @@ | ... | @@ -3,8 +3,8 @@ |
3 | # Starts ONOS Apache Karaf container | 3 | # Starts ONOS Apache Karaf container |
4 | #------------------------------------------------------------------------------- | 4 | #------------------------------------------------------------------------------- |
5 | 5 | ||
6 | -export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/ | 6 | +export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-7-openjdk-amd64/} |
7 | 7 | ||
8 | -cd $(dirname $0)/../apache-karaf-*/bin | 8 | +cd /opt/onos |
9 | -./karaf "$@" | 9 | +/opt/onos/apache-karaf-3.0.1/bin/karaf "$@" |
10 | 10 | ... | ... |
tools/package/debian/onos.conf
0 → 100644
1 | +description "Open Networking Operating System" | ||
2 | +author "ON.Lab" | ||
3 | + | ||
4 | +start on (net-device-up | ||
5 | + and local-filesystems | ||
6 | + and runlevel [2345]) | ||
7 | +stop on runlevel [016] | ||
8 | + | ||
9 | +console output | ||
10 | +kill timeout 60 | ||
11 | +respawn | ||
12 | + | ||
13 | +env LANG=en_US.UTF-8 | ||
14 | +env JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 | ||
15 | + | ||
16 | +script | ||
17 | + [ -f /opt/onos/options ] && . /opt/onos/options | ||
18 | + start-stop-daemon --signal INT --start --chuid sdn \ | ||
19 | + --exec /opt/onos/bin/onos-ctl -- $ONOS_OPTS \ | ||
20 | + >/opt/onos/var/stdout.log 2>/opt/onos/var/stderr.log | ||
21 | +end script |
This diff is collapsed. Click to expand it.
No preview for this file type
1 | -# ------------------------------------------------------------------------ | ||
2 | -# Licensed to the Apache Software Foundation (ASF) under one or more | ||
3 | -# contributor license agreements. See the NOTICE file distributed with | ||
4 | -# this work for additional information regarding copyright ownership. | ||
5 | -# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
6 | -# (the "License"); you may not use this file except in compliance with | ||
7 | -# the License. You may obtain a copy of the License at | ||
8 | -# | ||
9 | -# http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | -# | ||
11 | -# Unless required by applicable law or agreed to in writing, software | ||
12 | -# distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | -# See the License for the specific language governing permissions and | ||
15 | -# limitations under the License. | ||
16 | -# ------------------------------------------------------------------------ | ||
17 | - | ||
18 | -#******************************************************************** | ||
19 | -# Wrapper Properties | ||
20 | -#******************************************************************** | ||
21 | -set.default.JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/ | ||
22 | -set.default.KARAF_HOME=/opt/onos/apache-karaf-3.0.1 | ||
23 | -set.default.KARAF_BASE=/opt/onos/apache-karaf-3.0.1 | ||
24 | -set.default.KARAF_DATA=/opt/onos/apache-karaf-3.0.1/data | ||
25 | -set.default.KARAF_ETC=/opt/onos/apache-karaf-3.0.1/etc | ||
26 | - | ||
27 | -# Java Application | ||
28 | -wrapper.working.dir=%KARAF_BASE% | ||
29 | -wrapper.java.command=%JAVA_HOME%/bin/java | ||
30 | -wrapper.java.mainclass=org.apache.karaf.wrapper.internal.Main | ||
31 | -wrapper.java.classpath.1=%KARAF_HOME%/lib/karaf-wrapper.jar | ||
32 | -wrapper.java.classpath.2=%KARAF_HOME%/lib/karaf.jar | ||
33 | -wrapper.java.classpath.3=%KARAF_HOME%/lib/karaf-jmx-boot.jar | ||
34 | -wrapper.java.classpath.4=%KARAF_HOME%/lib/karaf-jaas-boot.jar | ||
35 | -wrapper.java.classpath.5=%KARAF_HOME%/lib/karaf-wrapper-main.jar | ||
36 | -wrapper.java.classpath.6=%KARAF_HOME%/lib/karaf-org.osgi.core.jar | ||
37 | -wrapper.java.library.path.1=%KARAF_HOME%/lib/ | ||
38 | - | ||
39 | -# Application Parameters. Add parameters as needed starting from 1 | ||
40 | -#wrapper.app.parameter.1= | ||
41 | - | ||
42 | -# JVM Parameters | ||
43 | -# note that n is the parameter number starting from 1. | ||
44 | -wrapper.java.additional.1=-Dkaraf.home=%KARAF_HOME% | ||
45 | -wrapper.java.additional.2=-Dkaraf.base=%KARAF_BASE% | ||
46 | -wrapper.java.additional.3=-Dkaraf.data=%KARAF_DATA% | ||
47 | -wrapper.java.additional.4=-Dkaraf.etc=%KARAF_ETC% | ||
48 | -wrapper.java.additional.5=-Dcom.sun.management.jmxremote | ||
49 | -wrapper.java.additional.6=-Djavax.management.builder.initial=org.apache.karaf.management.boot.KarafMBeanServerBuilder | ||
50 | -wrapper.java.additional.7=-Dkaraf.startLocalConsole=false | ||
51 | -wrapper.java.additional.8=-Dkaraf.startRemoteShell=true | ||
52 | -wrapper.java.additional.9=-Djava.endorsed.dirs=%JAVA_HOME%/jre/lib/endorsed:%JAVA_HOME%/lib/endorsed:%KARAF_HOME%/lib/endorsed | ||
53 | -wrapper.java.additional.10=-Djava.ext.dirs=%JAVA_HOME%/jre/lib/ext:%JAVA_HOME%/lib/ext:%KARAF_HOME%/lib/ext | ||
54 | - | ||
55 | -# Uncomment to enable jmx | ||
56 | -#wrapper.java.additional.n=-Dcom.sun.management.jmxremote.port=1616 | ||
57 | -#wrapper.java.additional.n=-Dcom.sun.management.jmxremote.authenticate=false | ||
58 | -#wrapper.java.additional.n=-Dcom.sun.management.jmxremote.ssl=false | ||
59 | - | ||
60 | -# Uncomment to enable YourKit profiling | ||
61 | -#wrapper.java.additional.n=-Xrunyjpagent | ||
62 | - | ||
63 | -# Uncomment to enable remote debugging | ||
64 | -#wrapper.java.additional.n=-Xdebug -Xnoagent -Djava.compiler=NONE | ||
65 | -#wrapper.java.additional.n=-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 | ||
66 | - | ||
67 | -# Initial Java Heap Size (in MB) | ||
68 | -#wrapper.java.initmemory=3 | ||
69 | - | ||
70 | -# Maximum Java Heap Size (in MB) | ||
71 | -wrapper.java.maxmemory=512 | ||
72 | - | ||
73 | - | ||
74 | -#******************************************************************** | ||
75 | -# Wrapper Logging Properties | ||
76 | -#******************************************************************** | ||
77 | -# Format of output for the console. (See docs for formats) | ||
78 | -wrapper.console.format=PM | ||
79 | - | ||
80 | -# Log Level for console output. (See docs for log levels) | ||
81 | -wrapper.console.loglevel=INFO | ||
82 | - | ||
83 | -# Log file to use for wrapper output logging. | ||
84 | -wrapper.logfile=%KARAF_DATA%/log/wrapper.log | ||
85 | - | ||
86 | -# Format of output for the log file. (See docs for formats) | ||
87 | -wrapper.logfile.format=LPTM | ||
88 | - | ||
89 | -# Log Level for log file output. (See docs for log levels) | ||
90 | -wrapper.logfile.loglevel=INFO | ||
91 | - | ||
92 | -# Maximum size that the log file will be allowed to grow to before | ||
93 | -# the log is rolled. Size is specified in bytes. The default value | ||
94 | -# of 0, disables log rolling. May abbreviate with the 'k' (kb) or | ||
95 | -# 'm' (mb) suffix. For example: 10m = 10 megabytes. | ||
96 | -wrapper.logfile.maxsize=10m | ||
97 | - | ||
98 | -# Maximum number of rolled log files which will be allowed before old | ||
99 | -# files are deleted. The default value of 0 implies no limit. | ||
100 | -wrapper.logfile.maxfiles=5 | ||
101 | - | ||
102 | -# Log Level for sys/event log output. (See docs for log levels) | ||
103 | -wrapper.syslog.loglevel=NONE | ||
104 | - | ||
105 | -#******************************************************************** | ||
106 | -# Wrapper Windows Properties | ||
107 | -#******************************************************************** | ||
108 | -# Title to use when running as a console | ||
109 | -wrapper.console.title=onos | ||
110 | - | ||
111 | -#******************************************************************** | ||
112 | -# Wrapper Windows NT/2000/XP Service Properties | ||
113 | -#******************************************************************** | ||
114 | -# WARNING - Do not modify any of these properties when an application | ||
115 | -# using this configuration file has been installed as a service. | ||
116 | -# Please uninstall the service before modifying this section. The | ||
117 | -# service can then be reinstalled. | ||
118 | - | ||
119 | -# Name of the service | ||
120 | -wrapper.ntservice.name=onos | ||
121 | - | ||
122 | -# Display name of the service | ||
123 | -wrapper.ntservice.displayname=onos | ||
124 | - | ||
125 | -# Description of the service | ||
126 | -wrapper.ntservice.description=ONOS | ||
127 | - | ||
128 | -# Service dependencies. Add dependencies as needed starting from 1 | ||
129 | -wrapper.ntservice.dependency.1= | ||
130 | - | ||
131 | -# Mode in which the service is installed. AUTO_START or DEMAND_START | ||
132 | -wrapper.ntservice.starttype=AUTO_START | ||
133 | - | ||
134 | -# Allow the service to interact with the desktop. | ||
135 | -wrapper.ntservice.interactive=false |
No preview for this file type
No preview for this file type
... | @@ -12,9 +12,6 @@ LOG=$ONOS_INSTALL_DIR/config.log | ... | @@ -12,9 +12,6 @@ LOG=$ONOS_INSTALL_DIR/config.log |
12 | onos=$ONOS_INSTALL_DIR/bin/onos | 12 | onos=$ONOS_INSTALL_DIR/bin/onos |
13 | 13 | ||
14 | ssh $remote " | 14 | ssh $remote " |
15 | - echo 'Starting...' | ||
16 | - nohup $ONOS_INSTALL_DIR/bin/onos-ctl server </dev/null | 1>/opt/onos/svc.log 2>&1 & | ||
17 | - | ||
18 | # Wait until we reach the run-level 100 | 15 | # Wait until we reach the run-level 100 |
19 | echo 'Waiting for cluster bootstrap...' | 16 | echo 'Waiting for cluster bootstrap...' |
20 | running="" | 17 | running="" |
... | @@ -22,29 +19,13 @@ ssh $remote " | ... | @@ -22,29 +19,13 @@ ssh $remote " |
22 | $onos bundle:list 2>>$LOG | grep -q 'START LEVEL 100' && running=1 || sleep 2 | 19 | $onos bundle:list 2>>$LOG | grep -q 'START LEVEL 100' && running=1 || sleep 2 |
23 | done | 20 | done |
24 | 21 | ||
25 | - # Now create group onos and join it, while quitting the default one | 22 | + echo 'Installing ONOS bundles...' |
26 | - if ! $onos cluster:group-list 2>>$LOG | cut -d \\ -f3 | grep -q onos; then | 23 | + $onos cluster:feature-install default onos-api 1>>$LOG 2>&1 |
27 | - echo 'Creating ONOS group...' | 24 | + $onos cluster:feature-install default onos-core 1>>$LOG 2>&1 |
28 | - installRole=primary | 25 | + $onos cluster:feature-install default onos-openflow 1>>$LOG 2>&1 |
29 | - $onos cluster:group-create onos 1>>$LOG 2>&1 | 26 | + $onos cluster:feature-install default onos-cli 1>>$LOG 2>&1 |
30 | - fi | 27 | + # $onos cluster:feature-install default onos-gui 1>>$LOG 2>&1 |
31 | - | 28 | + # $onos cluster:feature-install default onos-rest 1>>$LOG 2>&1 |
32 | - echo 'Configuring group membership...' | 29 | + $onos cluster:feature-install default onos-app-tvue 1>>$LOG 2>&1 |
33 | - node=\$($onos cluster:node-list 2>>$LOG | grep '^x' | cut -d \\ -f3) | 30 | + $onos cluster:feature-install default onos-app-fwd 1>>$LOG 2>&1 |
34 | - $onos cluster:group-join onos \$node 1>>$LOG 2>&1 | ||
35 | - $onos cluster:group-quit default \$node 1>>$LOG 2>&1 | ||
36 | - | ||
37 | - if [ X\$installRole = Xprimary ]; then | ||
38 | - echo 'Installing ONOS bundles...' | ||
39 | - $onos cluster:feature-install onos onos-api 1>>$LOG 2>&1 | ||
40 | - $onos cluster:feature-install onos onos-core 1>>$LOG 2>&1 | ||
41 | - $onos cluster:feature-install onos onos-openflow 1>>$LOG 2>&1 | ||
42 | - $onos cluster:feature-install onos onos-cli 1>>$LOG 2>&1 | ||
43 | - # $onos cluster:feature-install onos onos-gui 1>>$LOG 2>&1 | ||
44 | - # $onos cluster:feature-install onos onos-rest 1>>$LOG 2>&1 | ||
45 | - $onos cluster:feature-install onos onos-app-tvue 1>>$LOG 2>&1 | ||
46 | - $onos cluster:feature-install onos onos-app-fwd 1>>$LOG 2>&1 | ||
47 | - fi | ||
48 | - | ||
49 | - echo 'Started...' | ||
50 | " | 31 | " | ... | ... |
... | @@ -20,6 +20,13 @@ ssh $remote " | ... | @@ -20,6 +20,13 @@ ssh $remote " |
20 | sudo mkdir -p $ONOS_INSTALL_DIR && sudo chown sdn:sdn $ONOS_INSTALL_DIR | 20 | sudo mkdir -p $ONOS_INSTALL_DIR && sudo chown sdn:sdn $ONOS_INSTALL_DIR |
21 | tar zxmf /tmp/$ONOS_BITS.tar.gz -C $ONOS_INSTALL_DIR --strip-components=1 | 21 | tar zxmf /tmp/$ONOS_BITS.tar.gz -C $ONOS_INSTALL_DIR --strip-components=1 |
22 | 22 | ||
23 | - # Make a link to the log file directory. | 23 | + # Make a link to the log file directory and make a home for auxiliaries |
24 | ln -s $ONOS_INSTALL_DIR/$KARAF_DIST/data/log /opt/onos/log | 24 | ln -s $ONOS_INSTALL_DIR/$KARAF_DIST/data/log /opt/onos/log |
25 | + mkdir $ONOS_INSTALL_DIR/var | ||
26 | + | ||
27 | + # Install the upstart configuration file. | ||
28 | + sudo cp $ONOS_INSTALL_DIR/debian/onos.conf /etc/init/onos.conf | ||
29 | + | ||
30 | + # Ignite the ONOS service. | ||
31 | + sudo service onos start | ||
25 | " | 32 | " | ... | ... |
... | @@ -9,6 +9,7 @@ | ... | @@ -9,6 +9,7 @@ |
9 | remote=$ONOS_USER@${1:-$OCI} | 9 | remote=$ONOS_USER@${1:-$OCI} |
10 | 10 | ||
11 | ssh $remote " | 11 | ssh $remote " |
12 | + sudo service onos stop 1>/dev/null 2>/dev/null | ||
12 | [ -f $ONOS_INSTALL_DIR/bin/onos ] && \ | 13 | [ -f $ONOS_INSTALL_DIR/bin/onos ] && \ |
13 | $ONOS_INSTALL_DIR/bin/onos halt 2>/dev/null | 14 | $ONOS_INSTALL_DIR/bin/onos halt 2>/dev/null |
14 | sudo rm -fr $ONOS_INSTALL_DIR | 15 | sudo rm -fr $ONOS_INSTALL_DIR | ... | ... |
... | @@ -35,6 +35,11 @@ | ... | @@ -35,6 +35,11 @@ |
35 | <artifactId>commons-lang3</artifactId> | 35 | <artifactId>commons-lang3</artifactId> |
36 | </dependency> | 36 | </dependency> |
37 | 37 | ||
38 | + <!-- TODO: do we still need this here? --> | ||
39 | + <dependency> | ||
40 | + <groupId>com.eclipsesource.minimal-json</groupId> | ||
41 | + <artifactId>minimal-json</artifactId> | ||
42 | + </dependency> | ||
38 | <dependency> | 43 | <dependency> |
39 | <groupId>com.esotericsoftware.kryo</groupId> | 44 | <groupId>com.esotericsoftware.kryo</groupId> |
40 | <artifactId>kryo</artifactId> | 45 | <artifactId>kryo</artifactId> | ... | ... |
-
Please register or login to post a comment