-
Notifications
You must be signed in to change notification settings - Fork 405
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
1 parent
19c285f
commit 3cf5d9e
Showing
5 changed files
with
210 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<assembly xmlns="http:https://maven.apache.org/ASSEMBLY/2.0.0" | ||
xmlns:xsi="http:https://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http:https://maven.apache.org/ASSEMBLY/2.0.0 | ||
http:https://maven.apache.org/xsd/assembly-2.0.0.xsd"> | ||
<id>deploy</id> | ||
<formats> | ||
<format>zip</format> | ||
</formats> | ||
<includeBaseDirectory>false</includeBaseDirectory> | ||
<fileSets> | ||
<!-- app bin --> | ||
<fileSet> | ||
<directory>src/main/assembly/bin</directory> | ||
<outputDirectory>bin</outputDirectory> | ||
<includes> | ||
<include>./**/*.sh</include> | ||
</includes> | ||
<fileMode>0755</fileMode> | ||
</fileSet> | ||
<!-- app main conf --> | ||
<fileSet> | ||
<directory>target/conf</directory> | ||
<outputDirectory>conf</outputDirectory> | ||
<includes> | ||
<include>./**/*.xml</include> | ||
<include>./**/*.properties</include> | ||
<include>./**/*.toml</include> | ||
</includes> | ||
<fileMode>0644</fileMode> | ||
</fileSet> | ||
</fileSets> | ||
<dependencySets> | ||
<dependencySet> | ||
<outputDirectory>lib</outputDirectory> | ||
</dependencySet> | ||
</dependencySets> | ||
</assembly> |
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,35 @@ | ||
#!/bin/bash | ||
|
||
if [ $# -lt 2 ]; then | ||
echo "Usage: ./run_server.sh CLUSTER KEY [VALUE]" | ||
exit | ||
fi | ||
|
||
JMX_PORT=18101 | ||
GC_LOG=./logs/gc.log | ||
#jvm config | ||
JAVA_BASE_OPTS=" -Djava.awt.headless=true -Dfile.encoding=UTF-8 " | ||
|
||
#JAVA_JMX_OPTS=" -Dcom.sun.management.jmxremote \ | ||
#-Dcom.sun.management.jmxremote.port=$JMX_PORT \ | ||
#-Dcom.sun.management.jmxremote.ssl=false \ | ||
#-Dcom.sun.management.jmxremote.authenticate=false " | ||
JAVA_JMX_OPTS="" | ||
|
||
JAVA_MEM_OPTS=" -server -Xms2g -Xmx2g -Xmn600m -XX:PermSize=128m \ | ||
-XX:MaxPermSize=128m -Xss256K \ | ||
-XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled \ | ||
-XX:+UseCMSCompactAtFullCollection -XX:LargePageSizeInBytes=128m \ | ||
-XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly \ | ||
-XX:CMSInitiatingOccupancyFraction=70 " | ||
|
||
JAVA_GC_OPTS=" -verbose:gc -Xloggc:$GC_LOG \ | ||
-XX:+PrintGCDetails -XX:+PrintGCDateStamps " | ||
|
||
JAVA_CP=" -cp conf:lib/* " | ||
|
||
JAVA_OPTS=" $JAVA_BASE_OPTS $JAVA_MEM_OPTS $JAVA_JMX_OPTS $JAVA_GC_OPTS $JAVA_CP" | ||
|
||
RUNJAVA="$JAVA_HOME/bin/java" | ||
MAIN_CLASS=com.github.wenweihu86.raft.example.client.ClientMain | ||
$RUNJAVA $JAVA_CP $MAIN_CLASS "$@" |
36 changes: 36 additions & 0 deletions
36
raft-java-example/src/main/assembly/bin/run_concurrent_client.sh
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,36 @@ | ||
#!/bin/bash | ||
|
||
if [ $# -ne 1 ]; then | ||
echo "Usage: ./run_concurrent_client.sh THREAD_NUM" | ||
exit | ||
fi | ||
THREAD_NUM=$1 | ||
|
||
JMX_PORT=18101 | ||
GC_LOG=./logs/gc.log | ||
#jvm config | ||
JAVA_BASE_OPTS=" -Djava.awt.headless=true -Dfile.encoding=UTF-8 " | ||
|
||
#JAVA_JMX_OPTS=" -Dcom.sun.management.jmxremote \ | ||
#-Dcom.sun.management.jmxremote.port=$JMX_PORT \ | ||
#-Dcom.sun.management.jmxremote.ssl=false \ | ||
#-Dcom.sun.management.jmxremote.authenticate=false " | ||
JAVA_JMX_OPTS="" | ||
|
||
JAVA_MEM_OPTS=" -server -Xms2g -Xmx2g -Xmn600m -XX:PermSize=128m \ | ||
-XX:MaxPermSize=128m -Xss256K \ | ||
-XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled \ | ||
-XX:+UseCMSCompactAtFullCollection -XX:LargePageSizeInBytes=128m \ | ||
-XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly \ | ||
-XX:CMSInitiatingOccupancyFraction=70 " | ||
|
||
JAVA_GC_OPTS=" -verbose:gc -Xloggc:$GC_LOG \ | ||
-XX:+PrintGCDetails -XX:+PrintGCDateStamps " | ||
|
||
JAVA_CP=" -cp conf:lib/* " | ||
|
||
JAVA_OPTS=" $JAVA_BASE_OPTS $JAVA_MEM_OPTS $JAVA_JMX_OPTS $JAVA_GC_OPTS $JAVA_CP" | ||
|
||
RUNJAVA="$JAVA_HOME/bin/java" | ||
MAIN_CLASS=com.github.wenweihu86.raft.example.client.ConcurrentClientMain | ||
$RUNJAVA $JAVA_CP $MAIN_CLASS $THREAD_NUM |
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,39 @@ | ||
#!/bin/bash | ||
|
||
if [ $# -ne 3 ]; then | ||
echo "Usage: ./run_server.sh DATA_PATH CLUSTER CURRENT_NODE" | ||
exit | ||
fi | ||
|
||
DATA_PATH=$1 | ||
CLUSTER=$2 | ||
CURRENT_NODE=$3 | ||
|
||
JMX_PORT=18101 | ||
GC_LOG=./logs/gc.log | ||
#jvm config | ||
JAVA_BASE_OPTS=" -Djava.awt.headless=true -Dfile.encoding=UTF-8 " | ||
|
||
#JAVA_JMX_OPTS=" -Dcom.sun.management.jmxremote \ | ||
#-Dcom.sun.management.jmxremote.port=$JMX_PORT \ | ||
#-Dcom.sun.management.jmxremote.ssl=false \ | ||
#-Dcom.sun.management.jmxremote.authenticate=false " | ||
JAVA_JMX_OPTS="" | ||
|
||
JAVA_MEM_OPTS=" -server -Xms2g -Xmx2g -Xmn600m -XX:PermSize=128m \ | ||
-XX:MaxPermSize=128m -Xss256K \ | ||
-XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled \ | ||
-XX:+UseCMSCompactAtFullCollection -XX:LargePageSizeInBytes=128m \ | ||
-XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly \ | ||
-XX:CMSInitiatingOccupancyFraction=70 " | ||
|
||
JAVA_GC_OPTS=" -verbose:gc -Xloggc:$GC_LOG \ | ||
-XX:+PrintGCDetails -XX:+PrintGCDateStamps " | ||
|
||
JAVA_CP=" -cp conf:lib/* " | ||
|
||
JAVA_OPTS=" $JAVA_BASE_OPTS $JAVA_MEM_OPTS $JAVA_JMX_OPTS $JAVA_GC_OPTS $JAVA_CP" | ||
|
||
RUNJAVA="$JAVA_HOME/bin/java" | ||
MAIN_CLASS=com.github.wenweihu86.raft.example.server.ServerMain | ||
$RUNJAVA $JAVA_CP $MAIN_CLASS $DATA_PATH $CLUSTER $CURRENT_NODE |