forked from wenweihu86/raft-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_cluster.sh
38 lines (33 loc) · 1.09 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
#!/usr/bin/env bash
EXAMPLE_TAR=raft-java-example.tar
ROOT_DIR=./.env
if [ -d "$ROOT_DIR" ]; then rm -Rf $ROOT_DIR; fi
mkdir -p $ROOT_DIR
cd $ROOT_DIR
mkdir example1
cd example1
cp -f ../../raft-java-example/build/distributions/$EXAMPLE_TAR .
tar --strip-components=1 -xvf $EXAMPLE_TAR
chmod +x ./bin/*.sh
nohup ./bin/run_server.sh ./data "127.0.0.1:8051:1,127.0.0.1:8052:2,127.0.0.1:8053:3" "127.0.0.1:8051:1" &
cd -
mkdir example2
cd example2
cp -f ../../raft-java-example/build/distributions/$EXAMPLE_TAR .
tar --strip-components=1 -xvf $EXAMPLE_TAR
chmod +x ./bin/*.sh
nohup ./bin/run_server.sh ./data "127.0.0.1:8051:1,127.0.0.1:8052:2,127.0.0.1:8053:3" "127.0.0.1:8052:2" &
cd -
mkdir example3
cd example3
cp -f ../../raft-java-example/build/distributions/$EXAMPLE_TAR .
tar --strip-components=1 -xvf $EXAMPLE_TAR
chmod +x ./bin/*.sh
nohup ./bin/run_server.sh ./data "127.0.0.1:8051:1,127.0.0.1:8052:2,127.0.0.1:8053:3" "127.0.0.1:8053:3" &
cd -
mkdir client
cd client
cp -f ../../raft-java-example/build/distributions/$EXAMPLE_TAR .
tar --strip-components=1 -xvf $EXAMPLE_TAR
chmod +x ./bin/*.sh
cd -