-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
104 additions
and
9 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<hosts> | ||
<host> | ||
<ip>127.0.0.1:50000</ip> | ||
<ip>127.0.0.1:50001</ip> | ||
<ip>127.0.0.1:50002</ip> | ||
</host> | ||
</hosts> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<hosts> | ||
<host> | ||
<ip>127.0.0.1:50000</ip> | ||
<ip>127.0.0.1:50001</ip> | ||
<ip>127.0.0.1:50002</ip> | ||
</host> | ||
<KVServerPort>30000</KVServerPort> | ||
<KVSharding>0</KVSharding> | ||
</hosts> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<hosts> | ||
<host> | ||
<ip>127.0.0.1:50000</ip> | ||
<ip>127.0.0.1:50001</ip> | ||
<ip>127.0.0.1:50002</ip> | ||
</host> | ||
<KVServerPort>30001</KVServerPort> | ||
<KVSharding>1</KVSharding> | ||
</hosts> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<host> | ||
<ip>127.0.0.1:50000</ip> | ||
<clusterSize>3</clusterSize> | ||
</host> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<host> | ||
<ip>127.0.0.1:50001</ip> | ||
<clusterSize>3</clusterSize> | ||
</host> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
|
||
trap 'onCtrlC' INT | ||
function onCtrlC () { | ||
for id in ${proc_id_RaftServer[*]} | ||
do | ||
kill -9 ${id} | ||
echo "kill Raft Server pid "${id} | ||
done | ||
|
||
for id in ${proc_id_KVServer[*]} | ||
do | ||
kill -9 ${id} | ||
echo "kill KV Server pid "${id} | ||
done | ||
exit 0 | ||
} | ||
|
||
nohup java -jar RaftServer.jar RaftServer2.xml 1>/dev/null 2>/dev/null & | ||
echo "init Raft Server1 port:50000" | ||
sleep 4s | ||
nohup java -jar RaftServer.jar RaftServer1.xml 1>/dev/null 2>/dev/null & | ||
echo "init Raft Server2 port:50001" | ||
sleep 4s | ||
nohup java -jar KVServer.jar KVServer1.xml 1>/dev/null 2>/dev/null & | ||
echo "init KV Server1 port:30000 shard 0" | ||
sleep 2s | ||
nohup java -jar KVServer.jar KVServer2.xml 1>/dev/null 2>/dev/null & | ||
echo "init KV Server2 port:30001 shard 1" | ||
sleep 2s | ||
|
||
proc_name="RaftServer.jar" | ||
proc_name2="KVServer.jar" | ||
|
||
name_suffixx="\>" | ||
|
||
proc_id_RaftServer=`ps -ef|grep -i ${proc_name}${name_suffixx}|grep -v "grep"|awk '{print $2}'` | ||
proc_id_KVServer=`ps -ef|grep -i ${proc_name2}${name_suffixx}|grep -v "grep"|awk '{print $2}'` | ||
|
||
|
||
java -jar KVClient.jar KVClient.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters