Moved template files to separate directory.
Modified onos.sh and onos_node.conf to be able to config hazelcast.xml.
Modified some of onos.sh parameters to use default value.
Modified ZooKeeper's log dir to be configurable.
Refactored onos.sh.
- Aggregated parameters' default value to declaration point.
- Segregate common routines to functions.
Change-Id: Ia1e83fc9666c58b8897d4e2daef0326c400f48bd
diff --git a/conf/onos_node.conf b/conf/onos_node.conf
index acc74a0..499283b 100644
--- a/conf/onos_node.conf
+++ b/conf/onos_node.conf
@@ -1,5 +1,5 @@
# Name of this host (`hostname` by default)
-host.name = onosdev1
+#host.name = onosdev1
# IP address of this host used for ONOS communication
host.ip = 127.0.0.1
@@ -14,9 +14,8 @@
host.backend = hazelcast
#host.backend = ramcloud
-# List of host name/IPs that constitute ZooKeeper cluster
+# List of host name/IPs that constitute ZooKeeper cluster (only current host by default)
# myid will be assigned incrementally according to order of list
-zookeeper.hosts = onosdev1
#zookeeper.hosts = onosdev1,onosdev2,onosdev3,onosdev4
# Protocol used by RAMCloud coordinator (fast+udp by default)
@@ -36,3 +35,15 @@
# Port number of RAMCloud server (12242 by default)
#ramcloud.server.port = 12242
+
+# List of hostname/ip[:port] which forms Hazelcast grid
+# If this value is empty, Hazelcast will be set to muticast mode.
+# Inversely, if this value is set, multicast settings will be ignored.
+#hazelcast.tcp-ip.members = 192.168.56.11, 192.168.56.12, 192.168.56.13, 192.168.56.14
+
+# Multicast address used by Hazelcast. (224.2.2.3 by default)
+#hazelcast.multicast.group = 224.2.2.3
+
+# Multicast port used by Hazelcast. (54327 by default)
+#hazelcast.multicast.port = 54327
+
diff --git a/conf/template/hazelcast.xml.template b/conf/template/hazelcast.xml.template
new file mode 100644
index 0000000..77db87c
--- /dev/null
+++ b/conf/template/hazelcast.xml.template
@@ -0,0 +1,104 @@
+<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config
+ http://www.hazelcast.com/schema/config/hazelcast-config-3.0.xsd"
+ xmlns="http://www.hazelcast.com/schema/config"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <!-- Configuration of maps used as a data store. -->
+ <map name="datastore://*">
+ <!-- must use 'sync' backup to imitate other data store -->
+ <backup-count>3</backup-count>
+ <async-backup-count>0</async-backup-count>
+ <!-- must be false for strong consistency -->
+ <read-backup-data>false</read-backup-data>
+ <!-- near cache must not be used -->
+ </map>
+
+ <map name="*">
+
+ <!--
+ Number of sync-backups. If 1 is set as the backup-count for example,
+ then all entries of the map will be copied to another JVM for
+ ail-safety. Valid numbers are 0 (no backup), 1, 2, 3.
+ -->
+ <backup-count>0</backup-count>
+
+ <!--
+ Number of async-backups. If 1 is set as the backup-count for example,
+ then all entries of the map will be copied to another JVM for
+ fail-safety. Valid numbers are 0 (no backup), 1, 2, 3.
+ -->
+ <async-backup-count>3</async-backup-count>
+
+ <!--
+ Can we read the local backup entries? Default value is false for
+ strong consistency. Being able to read backup data will give you
+ greater performance.
+ -->
+ <read-backup-data>true</read-backup-data>
+
+ <near-cache>
+ <!--
+ Maximum size of the near cache. When max size is reached,
+ cache is evicted based on the policy defined.
+ Any integer between 0 and Integer.MAX_VALUE. 0 means
+ Integer.MAX_VALUE. Default is 0.
+ -->
+ <max-size>0</max-size>
+ <!--
+ Maximum number of seconds for each entry to stay in the near cache.
+ Entries that are older than <time-to-live-seconds> will get
+ automatically evicted from the near cache.
+ Any integer between 0 and Integer.MAX_VALUE. 0 means infinite.
+ Default is 0.
+ -->
+ <time-to-live-seconds>0</time-to-live-seconds>
+
+ <!--
+ Maximum number of seconds each entry can stay in the near cache as
+ untouched (not-read).
+ Entries that are not read (touched) more than <max-idle-seconds>
+ value will get removed from the near cache.
+ Any integer between 0 and Integer.MAX_VALUE. 0 means
+ Integer.MAX_VALUE. Default is 0.
+ -->
+ <max-idle-seconds>0</max-idle-seconds>
+
+ <!--
+ Valid values are:
+ NONE (no extra eviction, <time-to-live-seconds> may still apply),
+ LRU (Least Recently Used),
+ LFU (Least Frequently Used).
+ LRU is the default.
+ Regardless of the eviction policy used, <time-to-live-seconds> will
+ still apply.
+ -->
+ <eviction-policy>NONE</eviction-policy>
+
+ <!--
+ Should the cached entries get evicted if the entries are changed
+ (updated or removed).
+ true of false. Default is true.
+ -->
+ <invalidate-on-change>true</invalidate-on-change>
+
+ </near-cache>
+ </map>
+
+ <topic name="*">
+ <global-ordering-enabled>false</global-ordering-enabled>
+ </topic>
+
+ <network>
+ <port auto-increment="true">5701</port>
+ <join>
+__HC_NETWORK__
+ <aws enabled="false">
+ </aws>
+ </join>
+ </network>
+
+ <properties>
+ <property name="hazelcast.logging.type">slf4j</property>
+ <property name="hazelcast.version.check.enabled">false</property>
+ </properties>
+</hazelcast>
diff --git a/conf/logback.xml.template b/conf/template/logback.xml.template
similarity index 100%
rename from conf/logback.xml.template
rename to conf/template/logback.xml.template
diff --git a/conf/zoo.cfg.template b/conf/template/zoo.cfg.template
similarity index 100%
rename from conf/zoo.cfg.template
rename to conf/template/zoo.cfg.template