点击(此处)折叠或打开
- #!/bin/bash
- cd `dirname $0`
- BIN_DIR=`pwd`
- #cd ..
- DEPLOY_DIR=`pwd`
- CONF_DIR=$DEPLOY_DIR/conf
- STDOUT_FILE=logs/test.log
- LIB_DIR=$DEPLOY_DIR/lib
- #echo "LIB_DIR is :$LIB_DIR"
- LIB_JARS=`ls $LIB_DIR|grep .jar|awk '{print "'$LIB_DIR'/"$0}'|tr "\n" ":"`
- JAVA_OPTS=" -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true "
- JAVA_DEBUG_OPTS=""
- if [ "$1" = "debug" ]; then
- JAVA_DEBUG_OPTS=" -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n "
- fi
- JAVA_JMX_OPTS=""
- if [ "$1" = "jmx" ]; then
- JAVA_JMX_OPTS=" -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false "
- fi
- JAVA_MEM_OPTS=""
- BITS=`java -version 2>&1 | grep -i 64-bit`
- if [ -n "$BITS" ]; then
- JAVA_MEM_OPTS=" -server -Xmx1g -Xms1g -Xmn512m -XX:PermSize=128m -Xss256k -verbose:gc -Xloggc:/data/logs/t-sc-uc-gc.log -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 "
- else
- JAVA_MEM_OPTS=" -server -Xms1g -Xmx1g -XX:PermSize=128m -XX:SurvivorRatio=2 -XX:+UseParallelGC "
- fi
- export gc_output_file_nam=server_gc.txt
- echo "gc ouput file name: $gc_output_file_nam"
- echo -e "Starting the $SERVER_NAME ...\c"
- echo ""
- #nohup java $JAVA_OPTS $JAVA_MEM_OPTS $JAVA_DEBUG_OPTS $JAVA_JMX_OPTS -classpath $CONF_DIR:$LIB_JARS Rhetoric.RhetoricManager > $STDOUT_FILE 2>&1 &
- echo java $JAVA_OPTS $JAVA_MEM_OPTS $JAVA_DEBUG_OPTS $JAVA_JMX_OPTS -Xloggc:$gc_output_file_nam -classpath $CONF_DIR:$LIB_JARS server.HelloServer
- #java $JAVA_OPTS $JAVA_MEM_OPTS $JAVA_DEBUG_OPTS $JAVA_JMX_OPTS -Xloggc:$gc_output_file_nam -classpath $CONF_DIR:$LIB_JARS server.HelloServer
- java $JAVA_OPTS $JAVA_MEM_OPTS $JAVA_DEBUG_OPTS $JAVA_JMX_OPTS -Xloggc:$gc_output_file_nam -classpath $CONF_DIR:$LIB_JARS cluster_client.Main
- #java -jar bin/DiagnosticEngine.jar ./conf/article_diagnostic_engine.conf
- #echo "OK!"
- PIDS=`ps -f | grep java | grep "$DEPLOY_DIR" | awk '{print $2}'`
- #echo "PID: $PIDS"
- #echo "STDOUT: $STDOUT_FILE"