tom

Enhanced a number of the test scripts and replaced hazelcast.xml with a mildly a…

…ugmented version of the 3.3 one.
package org.onlab.onos.cluster;
import org.onlab.onos.net.MastershipRole;
import org.onlab.onos.net.provider.Provider;
/**
......
package org.onlab.onos.store.impl;
import com.hazelcast.config.Config;
import com.hazelcast.config.FileSystemXmlConfig;
import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance;
import de.javakaffee.kryoserializers.URISerializer;
......@@ -25,6 +27,7 @@ import org.onlab.util.KryoPool;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.FileNotFoundException;
import java.net.URI;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -36,6 +39,8 @@ import java.util.HashMap;
@Service
public class StoreManager implements StoreService {
private static final String HAZELCAST_XML_FILE = "etc/hazelcast.xml";
private final Logger log = LoggerFactory.getLogger(getClass());
protected HazelcastInstance instance;
......@@ -44,9 +49,14 @@ public class StoreManager implements StoreService {
@Activate
public void activate() {
instance = Hazelcast.newHazelcastInstance();
setupKryoPool();
log.info("Started");
try {
Config config = new FileSystemXmlConfig(HAZELCAST_XML_FILE);
instance = Hazelcast.newHazelcastInstance(config);
setupKryoPool();
log.info("Started");
} catch (FileNotFoundException e) {
log.error("Unable to configure Hazelcast", e);
}
}
/**
......
......@@ -41,7 +41,7 @@ alias pp='python -m json.tool'
# Short-hand to launch API docs and sample topology viewer GUI
alias docs='open $ONOS_ROOT/target/site/apidocs/index.html'
alias gui='open http://localhost:8181/onos/tvue'
alias gui='onos-gui'
# Test related conveniences
......
......@@ -16,6 +16,6 @@ env JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
script
[ -f /opt/onos/options ] && . /opt/onos/options
start-stop-daemon --signal INT --start --chuid sdn \
--exec /opt/onos/bin/onos-ctl -- $ONOS_OPTS \
--exec /opt/onos/bin/onos-service -- $ONOS_OPTS \
>/opt/onos/var/stdout.log 2>/opt/onos/var/stderr.log
end script
......
<?xml version="1.0" encoding="UTF-8"?>
<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.2.xsd"
<!--
~ Copyright (c) 2008-2013, Hazelcast, Inc. All Rights Reserved.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<!--
The default Hazelcast configuration. This is used when:
- no hazelcast.xml if present
-->
<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.3.xsd"
xmlns="http://www.hazelcast.com/schema/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<group>
......@@ -11,8 +33,8 @@
<port auto-increment="true" port-count="100">5701</port>
<outbound-ports>
<!--
Allowed port range when connecting to other nodes.
0 or * means use system provided port.
Allowed port range when connecting to other nodes.
0 or * means use system provided port.
-->
<ports>0</ports>
</outbound-ports>
......@@ -24,18 +46,6 @@
<tcp-ip enabled="false">
<interface>127.0.0.1</interface>
</tcp-ip>
<aws enabled="false">
<access-key>my-access-key</access-key>
<secret-key>my-secret-key</secret-key>
<!--optional, default is us-east-1 -->
<region>us-west-1</region>
<!--optional, default is ec2.amazonaws.com. If set, region shouldn't be set as it will override this property -->
<host-header>ec2.amazonaws.com</host-header>
<!-- optional, only instances belonging to this group will be discovered, default will try all running instances -->
<security-group-name>hazelcast-sg</security-group-name>
<tag-key>type</tag-key>
<tag-value>hz-nodes</tag-value>
</aws>
</join>
<interfaces enabled="true">
<interface>192.168.56.*</interface>
......@@ -61,9 +71,9 @@
</symmetric-encryption>
</network>
<partition-group enabled="false"/>
<executor-service>
<executor-service name="default">
<pool-size>16</pool-size>
<!-- Queue capacity. 0 means Integer.MAX_VALUE -->
<!--Queue capacity. 0 means Integer.MAX_VALUE.-->
<queue-capacity>0</queue-capacity>
</executor-service>
<queue name="default">
......@@ -81,22 +91,24 @@
fail-safety. 0 means no backup.
-->
<backup-count>1</backup-count>
<!--
Number of async backups. 0 means no backup.
-->
<async-backup-count>0</async-backup-count>
<empty-queue-ttl>-1</empty-queue-ttl>
</queue>
<map name="default">
<!--
Data type that will be used for storing recordMap.
Possible values:
BINARY (default): keys and values will be stored as binary data
OBJECT : values will be stored in their object forms
OFFHEAP : values will be stored in non-heap region of JVM
Data type that will be used for storing recordMap.
Possible values:
BINARY (default): keys and values will be stored as binary data
OBJECT : values will be stored in their object forms
OFFHEAP : values will be stored in non-heap region of JVM
-->
<in-memory-format>BINARY</in-memory-format>
<!--
Number of backups. If 1 is set as the backup-count for example,
then all entries of the map will be copied to another JVM for
......@@ -144,6 +156,12 @@
-->
<eviction-percentage>25</eviction-percentage>
<!--
Minimum time in milliseconds which should pass before checking
if a partition of this map is evictable or not.
Default value is 100 millis.
-->
<min-eviction-check-millis>100</min-eviction-check-millis>
<!--
While recovering from split-brain (network partitioning),
map entries in the small cluster will merge into the bigger cluster
based on the policy set here. When an entry merge into the
......@@ -159,6 +177,7 @@
com.hazelcast.map.merge.LatestUpdateMapMergePolicy ; entry with the latest update wins.
-->
<merge-policy>com.hazelcast.map.merge.PassThroughMergePolicy</merge-policy>
</map>
<multimap name="default">
......@@ -199,5 +218,6 @@
<portable-version>0</portable-version>
</serialization>
<services enable-defaults="true" />
<services enable-defaults="true"/>
</hazelcast>
......
#!/bin/bash
#-------------------------------------------------------------------------------
# ONOS remote command-line client
# ONOS remote command-line client.
#-------------------------------------------------------------------------------
[ -n "$1" ] && OCI=$1 && shift
......
#!/bin/bash
#-------------------------------------------------------------------------------
# Launches ONOS GUI on the specified node.
#-------------------------------------------------------------------------------
host=${1:-$OCI}
host=${host:-localhost}
open http://$host:8181/onos/tvue
\ No newline at end of file
#!/bin/bash
#-------------------------------------------------------------------------------
# Remotely pushes bits to a remote machine and installs ONOS.
# Remotely pushes bits to a remote node and installs ONOS on it.
#-------------------------------------------------------------------------------
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
......
#!/bin/bash
#-------------------------------------------------------------------------------
# Monitors remote ONOS log file.
# Monitors remote ONOS log file on the specified node.
#-------------------------------------------------------------------------------
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
......
#!/bin/bash
#-------------------------------------------------------------------------------
# Pushes the local id_rsa.pub to the remote ONOS host authorized_keys.
# Pushes the local id_rsa.pub to the authorized_keys on a remote ONOS node.
#-------------------------------------------------------------------------------
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
......
#!/bin/bash
#-------------------------------------------------------------------------------
# Remotely administers the ONOS service on the specified node.
#-------------------------------------------------------------------------------
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
. $ONOS_ROOT/tools/build/envDefaults
ssh $ONOS_USER@${1:-$OCI} "sudo service onos ${2:-status}"
\ No newline at end of file
#!/bin/bash
#-------------------------------------------------------------------------------
# Logs in to the remote ONOS instance.
# Logs in to the remote ONOS node.
#-------------------------------------------------------------------------------
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
......
......@@ -9,5 +9,5 @@
nodes=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2)
onos-package
for node in $nodes; do onos-install -f $node; done
for node in $nodes; do printf "%s: " $node; onos-install -f $node; done
for node in $nodes; do onos-wait-for-start $node; done
......
#!/bin/bash
#-------------------------------------------------------------------------------
# Remotely stops & uninstalls ONOS.
# Remotely stops & uninstalls ONOS on the specified node.
#-------------------------------------------------------------------------------
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
......
#!/bin/bash
#-------------------------------------------------------------------------------
# Waits for ONOS to reach run-level 100.
# Waits for ONOS to reach run-level 100 on the specified remote node.
#-------------------------------------------------------------------------------
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
......