-
Notifications
You must be signed in to change notification settings - Fork 4
/
cluster-test.sh
executable file
·58 lines (51 loc) · 2.25 KB
/
cluster-test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
IOTDB_PATH=/data/liurui/incubator-iotdb/iotdb/iotdb
IKR_PATH=/home/ubuntu/first-rest-test/iotdb-kairosdb
BENCH_PATH=/home/ubuntu/first-rest-test/iotdb-benchmark
MONITOR_PATH=/home/ubuntu/first-rest-test/monitor/iotdb-benchmark
for i in {2..16}
do
ssh [email protected].$i "rm -rf /home/ubuntu/first-rest-test"
scp -r ikr/ [email protected].$i:/home/ubuntu/first-rest-test
scp -r iotdb-benchmark/ [email protected].$i:/home/ubuntu/first-rest-test
scp -r monitor/ [email protected].$i:/home/ubuntu/first-rest-test
ssh [email protected].$i "sed -i \"s/^DB_URL.*$/DB_URL=http:\/\/192.168.8.${i}:6666/g\" $BENCH_PATH/conf/config.properties"
ssh [email protected].$i "$IKR_PATH/stop-rest-service-daemon.sh"
done
###初始化及启动16上的iotdb
echo "start monitoring on 192.168.8.16"
ssh [email protected] "$MONITOR_PATH/ser-benchmark.sh > /dev/null 2>&1 &"
echo "stopping IoTDB server..."
ssh [email protected] "sh $IOTDB_PATH/bin/stop-server.sh"
sleep 2
ssh [email protected] "rm -rf $IOTDB_PATH/data"
sleep 5
ssh [email protected] "$IOTDB_PATH/bin/start-server.sh > /dev/null 2>&1 &"
echo "wait 10 seconds for re-starting IoTDB"
sleep 10
###先启动一个写入数据一段时间,使系统初始化完毕
echo "start local monitoring"
ssh [email protected] "$MONITOR_PATH/ser-benchmark.sh > /dev/null 2>&1 &"
echo "wait 10 seconds for starting local IKR"
ssh [email protected] "$IKR_PATH/start-rest-service-daemon.sh"
sleep 10
ssh [email protected] "$BENCH_PATH/benchmark.sh > /dev/null 2>&1 &"
echo "wait 30 seconds for initializing new metric"
sleep 30
###再启动3~16号机器上的数据写入
for i in {3..15}
do
echo "start monitoring on 192.168.8.${i}"
ssh [email protected].$i "$MONITOR_PATH/ser-benchmark.sh > /dev/null 2>&1 &"
echo "starting IKR on 192.168.8.${i} ..."
ssh [email protected].$i "$IKR_PATH/start-rest-service-daemon.sh"
sleep 10
echo "starting ingestion test on 192.168.8.${i} ..."
ssh [email protected].$i "$BENCH_PATH/benchmark.sh > /dev/null 2>&1 &"
done
echo "starting IKR on 192.168.8.16 ..."
ssh [email protected] "$IKR_PATH/start-rest-service-daemon.sh"
sleep 10
echo "starting ingestion test on 192.168.8.16 ..."
ssh [email protected] "$BENCH_PATH/benchmark.sh > /dev/null 2>&1 &"
echo "ingestion tests on all nodes have started"