forked from cnosdb/cnosdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_cluster.sh
executable file
·44 lines (33 loc) · 1.01 KB
/
run_cluster.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
#!/bin/sh
kill() {
if [ "$(uname)" = "Darwin" ]; then
SERVICE='cnosdb'
if pgrep -xq -- "${SERVICE}"; then
pkill -f "${SERVICE}"
fi
else
set +e # killall will error if finds no process to kill
killall cnosdb
set -e
fi
}
mkdir -p /tmp/cnosdb/logs
echo "*** run meta cluster ......"
./meta/cluster.sh
kill
sleep 1
rm -rf /tmp/cnosdb/1001
rm -rf /tmp/cnosdb/2001
rm -rf /tmp/cnosdb/meta/
rm -rf ~/.cnosdb/query
echo "*** build cnosdb ......"
cargo build --package main --bin cnosdb
echo "*** build cnosdb-cli ......"
cargo build --package client --bin cnosdb-cli
echo "*** start CnosDB server 8902......"
nohup ./target/debug/cnosdb run --config ./config/config_8902.toml > /tmp/cnosdb/logs/data_node.1001.log 2>&1 &
sleep 1
echo "*** start CnosDB server 8912......"
nohup ./target/debug/cnosdb run --config ./config/config_8912.toml > /tmp/cnosdb/logs/data_node.2001.log 2>&1 &
echo "\n*** CnosDB Data Server Cluster is running ......"
sleep 1000000000