316
|
1 #!/bin/bash
|
|
2 if [ $# -ne 2 ]; then
|
348
|
3 echo "Usage: ./keeparive.sh NODENUM CHILDLENNUM"
|
316
|
4 exit 1
|
|
5 fi
|
|
6 max=$1
|
|
7 child_num=$2
|
|
8 if [ ! -e $java ]; then
|
|
9 echo "$java not found."
|
|
10 exit 1
|
|
11 fi
|
|
12
|
348
|
13 jar_path=../build/libs/Alice.jar
|
|
14
|
316
|
15 ruby ./topology/treen.rb $1 $2 > ./topology/tree.dot
|
|
16 dot -Tpng ./topology/tree.dot > ./topology/tree.png
|
|
17 #open ./topology/tree.png
|
348
|
18 java -version
|
|
19 java -cp $jar_path alice.topology.manager.TopologyManager -p 10000 -conf ./topology/tree.dot -log ./output/manager.log -level debug > ./output/std_manager.log &
|
316
|
20
|
|
21 cnt=0
|
|
22 while [ $cnt -lt $max ]
|
|
23 do
|
348
|
24 java -cp $jar_path alice.topology.manager.keeparive.KeepAlive -host `hostname` -port 10000 -p `expr 20000 + $cnt` -level debug > ./output/std_keepalive${cnt}.log &
|
316
|
25 cnt=`expr $cnt + 1`
|
|
26 done
|
|
27 wait
|