onos-package now patches the hazelcast.xml with proper interface for use by the test VMs.
Showing
4 changed files
with
240 additions
and
0 deletions
... | @@ -27,6 +27,7 @@ mkdir bin | ... | @@ -27,6 +27,7 @@ mkdir bin |
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/wrapper/* $KARAF_DIST |
30 | +cp -r $ONOS_ROOT/tools/package/etc/* $KARAF_DIST/etc | ||
30 | 31 | ||
31 | # Stage the ONOS bundles | 32 | # Stage the ONOS bundles |
32 | mkdir -p $KARAF_DIST/system/org/onlab | 33 | mkdir -p $KARAF_DIST/system/org/onlab | ... | ... |
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | # ONOS developer BASH profile conveniences | 2 | # ONOS developer BASH profile conveniences |
3 | +# Simply include in your own .bash_aliases or .bash_profile | ||
3 | 4 | ||
4 | # Root of the ONOS source tree | 5 | # Root of the ONOS source tree |
5 | export ONOS_ROOT=${ONOS_ROOT:-~/onos-next} | 6 | export ONOS_ROOT=${ONOS_ROOT:-~/onos-next} |
... | @@ -42,6 +43,23 @@ alias docs='open $ONOS_ROOT/target/site/apidocs/index.html' | ... | @@ -42,6 +43,23 @@ alias docs='open $ONOS_ROOT/target/site/apidocs/index.html' |
42 | alias gui='open http://localhost:8181/onos/tvue' | 43 | alias gui='open http://localhost:8181/onos/tvue' |
43 | 44 | ||
44 | 45 | ||
46 | +# Test related conveniences | ||
47 | + | ||
48 | +# Default virtual box ONOS instances 1,2 & 3 | ||
49 | +export OC1="192.168.56.101" | ||
50 | +export OC2="192.168.56.102" | ||
51 | +export OC3="192.168.56.103" | ||
52 | + | ||
53 | +# Default instance is #1 | ||
54 | +export OCI="$OC1" | ||
55 | + | ||
56 | +# SSH to a specified ONOS instance | ||
57 | +function sshctl { | ||
58 | + [ -n "$1" ] && OCI=$1 && shift | ||
59 | + ssh -Y sdn@$OCI "$@" | ||
60 | +} | ||
61 | + | ||
62 | + | ||
45 | # Miscellaneous | 63 | # Miscellaneous |
46 | function spy { | 64 | function spy { |
47 | ps -ef | egrep "$@" | grep -v egrep | 65 | ps -ef | egrep "$@" | grep -v egrep | ... | ... |
tools/package/etc/hazelcast.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.2.xsd" | ||
3 | + xmlns="http://www.hazelcast.com/schema/config" | ||
4 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
5 | + <group> | ||
6 | + <name>onos</name> | ||
7 | + <password>rocks</password> | ||
8 | + </group> | ||
9 | + <management-center enabled="false">http://localhost:8080/mancenter</management-center> | ||
10 | + <network> | ||
11 | + <port auto-increment="true" port-count="100">5701</port> | ||
12 | + <outbound-ports> | ||
13 | + <!-- | ||
14 | + Allowed port range when connecting to other nodes. | ||
15 | + 0 or * means use system provided port. | ||
16 | + --> | ||
17 | + <ports>0</ports> | ||
18 | + </outbound-ports> | ||
19 | + <join> | ||
20 | + <multicast enabled="true"> | ||
21 | + <multicast-group>224.2.2.3</multicast-group> | ||
22 | + <multicast-port>54327</multicast-port> | ||
23 | + </multicast> | ||
24 | + <tcp-ip enabled="false"> | ||
25 | + <interface>127.0.0.1</interface> | ||
26 | + </tcp-ip> | ||
27 | + <aws enabled="false"> | ||
28 | + <access-key>my-access-key</access-key> | ||
29 | + <secret-key>my-secret-key</secret-key> | ||
30 | + <!--optional, default is us-east-1 --> | ||
31 | + <region>us-west-1</region> | ||
32 | + <!--optional, default is ec2.amazonaws.com. If set, region shouldn't be set as it will override this property --> | ||
33 | + <host-header>ec2.amazonaws.com</host-header> | ||
34 | + <!-- optional, only instances belonging to this group will be discovered, default will try all running instances --> | ||
35 | + <security-group-name>hazelcast-sg</security-group-name> | ||
36 | + <tag-key>type</tag-key> | ||
37 | + <tag-value>hz-nodes</tag-value> | ||
38 | + </aws> | ||
39 | + </join> | ||
40 | + <interfaces enabled="true"> | ||
41 | + <interface>10.1.9.*</interface> | ||
42 | + </interfaces> | ||
43 | + <ssl enabled="false"/> | ||
44 | + <socket-interceptor enabled="false"/> | ||
45 | + <symmetric-encryption enabled="false"> | ||
46 | + <!-- | ||
47 | + encryption algorithm such as | ||
48 | + DES/ECB/PKCS5Padding, | ||
49 | + PBEWithMD5AndDES, | ||
50 | + AES/CBC/PKCS5Padding, | ||
51 | + Blowfish, | ||
52 | + DESede | ||
53 | + --> | ||
54 | + <algorithm>PBEWithMD5AndDES</algorithm> | ||
55 | + <!-- salt value to use when generating the secret key --> | ||
56 | + <salt>thesalt</salt> | ||
57 | + <!-- pass phrase to use when generating the secret key --> | ||
58 | + <password>thepass</password> | ||
59 | + <!-- iteration count to use when generating the secret key --> | ||
60 | + <iteration-count>19</iteration-count> | ||
61 | + </symmetric-encryption> | ||
62 | + </network> | ||
63 | + <partition-group enabled="false"/> | ||
64 | + <executor-service> | ||
65 | + <pool-size>16</pool-size> | ||
66 | + <!-- Queue capacity. 0 means Integer.MAX_VALUE --> | ||
67 | + <queue-capacity>0</queue-capacity> | ||
68 | + </executor-service> | ||
69 | + <queue name="default"> | ||
70 | + <!-- | ||
71 | + Maximum size of the queue. When a JVM's local queue size reaches the maximum, | ||
72 | + all put/offer operations will get blocked until the queue size | ||
73 | + of the JVM goes down below the maximum. | ||
74 | + Any integer between 0 and Integer.MAX_VALUE. 0 means | ||
75 | + Integer.MAX_VALUE. Default is 0. | ||
76 | + --> | ||
77 | + <max-size>0</max-size> | ||
78 | + <!-- | ||
79 | + Number of backups. If 1 is set as the backup-count for example, | ||
80 | + then all entries of the map will be copied to another JVM for | ||
81 | + fail-safety. 0 means no backup. | ||
82 | + --> | ||
83 | + <backup-count>1</backup-count> | ||
84 | + <!-- | ||
85 | + Number of async backups. 0 means no backup. | ||
86 | + --> | ||
87 | + <async-backup-count>0</async-backup-count> | ||
88 | + <empty-queue-ttl>-1</empty-queue-ttl> | ||
89 | + </queue> | ||
90 | + | ||
91 | + <map name="default"> | ||
92 | + <!-- | ||
93 | + Data type that will be used for storing recordMap. | ||
94 | + Possible values: | ||
95 | + BINARY (default): keys and values will be stored as binary data | ||
96 | + OBJECT : values will be stored in their object forms | ||
97 | + OFFHEAP : values will be stored in non-heap region of JVM | ||
98 | + --> | ||
99 | + <in-memory-format>BINARY</in-memory-format> | ||
100 | + <!-- | ||
101 | + Number of backups. If 1 is set as the backup-count for example, | ||
102 | + then all entries of the map will be copied to another JVM for | ||
103 | + fail-safety. 0 means no backup. | ||
104 | + --> | ||
105 | + <backup-count>1</backup-count> | ||
106 | + <!-- | ||
107 | + Number of async backups. 0 means no backup. | ||
108 | + --> | ||
109 | + <async-backup-count>0</async-backup-count> | ||
110 | + <!-- | ||
111 | + Maximum number of seconds for each entry to stay in the map. Entries that are | ||
112 | + older than <time-to-live-seconds> and not updated for <time-to-live-seconds> | ||
113 | + will get automatically evicted from the map. | ||
114 | + Any integer between 0 and Integer.MAX_VALUE. 0 means infinite. Default is 0. | ||
115 | + --> | ||
116 | + <time-to-live-seconds>0</time-to-live-seconds> | ||
117 | + <!-- | ||
118 | + Maximum number of seconds for each entry to stay idle in the map. Entries that are | ||
119 | + idle(not touched) for more than <max-idle-seconds> will get | ||
120 | + automatically evicted from the map. Entry is touched if get, put or containsKey is called. | ||
121 | + Any integer between 0 and Integer.MAX_VALUE. 0 means infinite. Default is 0. | ||
122 | + --> | ||
123 | + <max-idle-seconds>0</max-idle-seconds> | ||
124 | + <!-- | ||
125 | + Valid values are: | ||
126 | + NONE (no eviction), | ||
127 | + LRU (Least Recently Used), | ||
128 | + LFU (Least Frequently Used). | ||
129 | + NONE is the default. | ||
130 | + --> | ||
131 | + <eviction-policy>NONE</eviction-policy> | ||
132 | + <!-- | ||
133 | + Maximum size of the map. When max size is reached, | ||
134 | + map is evicted based on the policy defined. | ||
135 | + Any integer between 0 and Integer.MAX_VALUE. 0 means | ||
136 | + Integer.MAX_VALUE. Default is 0. | ||
137 | + --> | ||
138 | + <max-size policy="PER_NODE">0</max-size> | ||
139 | + <!-- | ||
140 | + When max. size is reached, specified percentage of | ||
141 | + the map will be evicted. Any integer between 0 and 100. | ||
142 | + If 25 is set for example, 25% of the entries will | ||
143 | + get evicted. | ||
144 | + --> | ||
145 | + <eviction-percentage>25</eviction-percentage> | ||
146 | + <!-- | ||
147 | + While recovering from split-brain (network partitioning), | ||
148 | + map entries in the small cluster will merge into the bigger cluster | ||
149 | + based on the policy set here. When an entry merge into the | ||
150 | + cluster, there might an existing entry with the same key already. | ||
151 | + Values of these entries might be different for that same key. | ||
152 | + Which value should be set for the key? Conflict is resolved by | ||
153 | + the policy set here. Default policy is PutIfAbsentMapMergePolicy | ||
154 | + | ||
155 | + There are built-in merge policies such as | ||
156 | + com.hazelcast.map.merge.PassThroughMergePolicy; entry will be added if there is no existing entry for the key. | ||
157 | + com.hazelcast.map.merge.PutIfAbsentMapMergePolicy ; entry will be added if the merging entry doesn't exist in the cluster. | ||
158 | + com.hazelcast.map.merge.HigherHitsMapMergePolicy ; entry with the higher hits wins. | ||
159 | + com.hazelcast.map.merge.LatestUpdateMapMergePolicy ; entry with the latest update wins. | ||
160 | + --> | ||
161 | + <merge-policy>com.hazelcast.map.merge.PassThroughMergePolicy</merge-policy> | ||
162 | + </map> | ||
163 | + | ||
164 | + <multimap name="default"> | ||
165 | + <backup-count>1</backup-count> | ||
166 | + <value-collection-type>SET</value-collection-type> | ||
167 | + </multimap> | ||
168 | + | ||
169 | + <multimap name="default"> | ||
170 | + <backup-count>1</backup-count> | ||
171 | + <value-collection-type>SET</value-collection-type> | ||
172 | + </multimap> | ||
173 | + | ||
174 | + <list name="default"> | ||
175 | + <backup-count>1</backup-count> | ||
176 | + </list> | ||
177 | + | ||
178 | + <set name="default"> | ||
179 | + <backup-count>1</backup-count> | ||
180 | + </set> | ||
181 | + | ||
182 | + <jobtracker name="default"> | ||
183 | + <max-thread-size>0</max-thread-size> | ||
184 | + <!-- Queue size 0 means number of partitions * 2 --> | ||
185 | + <queue-size>0</queue-size> | ||
186 | + <retry-count>0</retry-count> | ||
187 | + <chunk-size>1000</chunk-size> | ||
188 | + <communicate-stats>true</communicate-stats> | ||
189 | + <topology-changed-strategy>CANCEL_RUNNING_OPERATION</topology-changed-strategy> | ||
190 | + </jobtracker> | ||
191 | + | ||
192 | + <semaphore name="default"> | ||
193 | + <initial-permits>0</initial-permits> | ||
194 | + <backup-count>1</backup-count> | ||
195 | + <async-backup-count>0</async-backup-count> | ||
196 | + </semaphore> | ||
197 | + | ||
198 | + <serialization> | ||
199 | + <portable-version>0</portable-version> | ||
200 | + </serialization> | ||
201 | + | ||
202 | + <services enable-defaults="true" /> | ||
203 | +</hazelcast> |
tools/test/bin/onos-log
0 → 100755
1 | +#!/bin/bash | ||
2 | +#------------------------------------------------------------------------------- | ||
3 | +# Monitors remote ONOS log file. | ||
4 | +#------------------------------------------------------------------------------- | ||
5 | + | ||
6 | +[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 | ||
7 | +. $ONOS_ROOT/tools/build/envDefaults | ||
8 | + | ||
9 | +remote=$ONOS_USER@${1:-$OCI} | ||
10 | + | ||
11 | +LOG=$ONOS_INSTALL_DIR/log/karaf.log | ||
12 | + | ||
13 | +ssh $remote " | ||
14 | + while true; do | ||
15 | + [ ! -f $LOG ] && sleep 2 && continue | ||
16 | + tail -n 512 --follow=name $LOG --sleep-interval 2 | ||
17 | + done | ||
18 | +" |
-
Please register or login to post a comment