diff --git a/script/create_escheduler.sh b/script/create_escheduler.sh index dea3b07858..c88da7bb6d 100644 --- a/script/create_escheduler.sh +++ b/script/create_escheduler.sh @@ -1,6 +1,21 @@ #!/bin/bash -workDir=`dirname $0` -workDir=`cd ${workDir};pwd` -echo "$workDir/lib" -java -Xmx1G -cp "$workDir/../lib/*" cn.escheduler.dao.upgrade.shell.CreateEscheduler +BIN_DIR=`dirname $0` +BIN_DIR=`cd "$BIN_DIR"; pwd` +ESCHEDULER_HOME=$BIN_DIR/.. + +export JAVA_HOME=$JAVA_HOME + + +export ESCHEDULER_CONF_DIR=$ESCHEDULER_HOME/conf +export ESCHEDULER_LIB_JARS=$ESCHEDULER_HOME/lib/* + +export ESCHEDULER_OPTS="-server -Xmx1g -Xms1g -Xss512k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70" +export STOP_TIMEOUT=5 + +CLASS=cn.escheduler.dao.upgrade.shell.CreateEscheduler + +exec_command="$ESCHEDULER_OPTS -classpath $ESCHEDULER_CONF_DIR:$ESCHEDULER_LIB_JARS $CLASS" + +cd $ESCHEDULER_HOME +$JAVA_HOME/bin/java $exec_command diff --git a/script/upgrade_escheduler.sh b/script/upgrade_escheduler.sh index 343dc5f1db..6bd6439a58 100644 --- a/script/upgrade_escheduler.sh +++ b/script/upgrade_escheduler.sh @@ -1,6 +1,21 @@ #!/bin/bash -workDir=`dirname $0` -workDir=`cd ${workDir};pwd` -echo "$workDir/lib" -java -Xmx1G -cp "$workDir/../lib/*" cn.escheduler.dao.upgrade.shell.UpgradeEscheduler +BIN_DIR=`dirname $0` +BIN_DIR=`cd "$BIN_DIR"; pwd` +ESCHEDULER_HOME=$BIN_DIR/.. + +export JAVA_HOME=$JAVA_HOME + + +export ESCHEDULER_CONF_DIR=$ESCHEDULER_HOME/conf +export ESCHEDULER_LIB_JARS=$ESCHEDULER_HOME/lib/* + +export ESCHEDULER_OPTS="-server -Xmx1g -Xms1g -Xss512k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70" +export STOP_TIMEOUT=5 + +CLASS=cn.escheduler.dao.upgrade.shell.UpgradeEscheduler + +exec_command="$ESCHEDULER_OPTS -classpath $ESCHEDULER_CONF_DIR:$ESCHEDULER_LIB_JARS $CLASS" + +cd $ESCHEDULER_HOME +$JAVA_HOME/bin/java $exec_command