You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by th...@apache.org on 2014/10/13 22:08:07 UTC
svn commit: r1631528 - in /lucene/dev/branches/lucene_solr_4_10/solr:
CHANGES.txt bin/oom_solr.sh bin/solr bin/solr.cmd bin/solr.in.cmd
bin/solr.in.sh
Author: thelabdude
Date: Mon Oct 13 20:08:07 2014
New Revision: 1631528
URL: http://svn.apache.org/r1631528
Log:
SOLR-6509, SOLR-6486, SOLR-6549, SOLR-6529: backport recent fixes / improvements to the bin/solr scripts for inclusion in 4.10.2 release.
Modified:
lucene/dev/branches/lucene_solr_4_10/solr/CHANGES.txt
lucene/dev/branches/lucene_solr_4_10/solr/bin/oom_solr.sh (props changed)
lucene/dev/branches/lucene_solr_4_10/solr/bin/solr (contents, props changed)
lucene/dev/branches/lucene_solr_4_10/solr/bin/solr.cmd
lucene/dev/branches/lucene_solr_4_10/solr/bin/solr.in.cmd
lucene/dev/branches/lucene_solr_4_10/solr/bin/solr.in.sh
Modified: lucene/dev/branches/lucene_solr_4_10/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_10/solr/CHANGES.txt?rev=1631528&r1=1631527&r2=1631528&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_10/solr/CHANGES.txt (original)
+++ lucene/dev/branches/lucene_solr_4_10/solr/CHANGES.txt Mon Oct 13 20:08:07 2014
@@ -22,6 +22,8 @@ See the tutorial at http://lucene.apache
Bug Fixes
----------------------
+* SOLR-6509: Solr start scripts interactive mode doesn't honor -z argument (Timothy Potter)
+
* SOLR-6511: Fencepost error in LeaderInitiatedRecoveryThread (Timothy Potter)
@@ -31,6 +33,15 @@ Other Changes
* SOLR-6550: Provide simple mechanism for passing additional metadata / context about a server-side
SolrException back to the client-side (Timothy Potter)
+* SOLR-6486: solr start script can have a debug flag option; use -a to set arbitrary options
+ (Noble Paul, Timothy Potter)
+
+* SOLR-6549: bin/solr script should support a -s option to set the -Dsolr.solr.home property.
+ (Timothy Potter)
+
+* SOLR-6529: Stop command in the start scripts should only stop the instance that it had started.
+ (Varun Thacker, Timothy Potter)
+
================== 4.10.1 ==================
Bug Fixes
Modified: lucene/dev/branches/lucene_solr_4_10/solr/bin/solr
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_10/solr/bin/solr?rev=1631528&r1=1631527&r2=1631528&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_10/solr/bin/solr (original)
+++ lucene/dev/branches/lucene_solr_4_10/solr/bin/solr Mon Oct 13 20:08:07 2014
@@ -48,6 +48,7 @@ SOLR_SCRIPT="$0"
verbose=false
THIS_OS=`uname -s`
hasLsof=$(which lsof)
+stop_all=false
# for now, we don't support running this script from cygwin due to problems
# like not having lsof, ps waux, curl, and awkward directory handling
@@ -79,6 +80,23 @@ else
DEFAULT_SERVER_DIR=$SOLR_TIP/example
fi
+# If an include wasn't specified in the environment, then search for one...
+if [ "x$SOLR_INCLUDE" == "x" ]; then
+ # Locations (in order) to use when searching for an include file.
+ for include in "`dirname "$0"`/solr.in.sh" \
+ "$HOME/.solr.in.sh" \
+ /usr/share/solr/solr.in.sh \
+ /usr/local/share/solr/solr.in.sh \
+ /opt/solr/solr.in.sh; do
+ if [ -r "$include" ]; then
+ . "$include"
+ break
+ fi
+ done
+elif [ -r "$SOLR_INCLUDE" ]; then
+ . "$SOLR_INCLUDE"
+fi
+
if [ "$SOLR_JAVA_HOME" != "" ]; then
JAVA=$SOLR_JAVA_HOME/bin/java
elif [ -n "$JAVA_HOME" ]; then
@@ -108,16 +126,20 @@ function print_usage() {
echo "Usage: solr COMMAND OPTIONS"
echo " where COMMAND is one of: start, stop, restart, healthcheck"
echo ""
- echo " Example: Start Solr running in the background on port 8984:"
+ echo " Standalone server example (start Solr running in the background on port 8984):"
echo ""
echo " ./solr start -p 8984"
echo ""
+ echo " SolrCloud example (start Solr running in SolrCloud mode using localhost:2181 to connect to ZooKeeper, with 1g max heap size and remote Java debug options enabled):"
+ echo ""
+ echo " ./solr start -c -m 1g -z localhost:2181 -a \"-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044\""
+ echo ""
echo "Pass -help after any COMMAND to see command-specific usage information,"
- echo " such as: ./solr start -help"
+ echo " such as: ./solr start -help or ./solr stop -help"
echo ""
elif [[ "$CMD" == "start" || "$CMD" == "restart" ]]; then
echo ""
- echo "Usage: solr $CMD [-f] [-c] [-h hostname] [-p port] [-d directory] [-z zkHost] [-m memory] [-e example] [-V]"
+ echo "Usage: solr $CMD [-f] [-c] [-h hostname] [-p port] [-d directory] [-z zkHost] [-m memory] [-e example] [-s solr.solr.home] [-a \"additional-options\"] [-V]"
echo ""
echo " -f Start Solr in foreground; default starts Solr in the background"
echo " and sends stdout / stderr to solr-PORT-console.log"
@@ -137,6 +159,13 @@ function print_usage() {
echo " -m <memory> Sets the min (-Xms) and max (-Xmx) heap size for the JVM, such as: -m 4g"
echo " results in: -Xms4g -Xmx4g; by default, this script sets the heap size to 512m"
echo ""
+ echo " -s <dir> Sets the solr.solr.home system property; Solr will create core directories under"
+ echo " this directory. This allows you to run multiple Solr instances on the same host"
+ echo " while reusing the same server directory set using the -d parameter. If set, the"
+ echo " specified directory should contain a solr.xml file. The default value is example/solr."
+ echo " This parameter is ignored when running examples (-e), as the solr.solr.home depends"
+ echo " on which example is run."
+ echo ""
echo " -e <example> Name of the example to run; available examples:"
echo " cloud: SolrCloud example"
echo " default: Solr default example"
@@ -144,18 +173,25 @@ function print_usage() {
echo " schemaless: Schema-less example"
echo " multicore: Multicore"
echo ""
+ echo " -a Additional parameters to pass to the JVM when starting Solr, such as to setup"
+ echo " Java debug options. For example, to enable a Java debugger to attach to the Solr JVM"
+ echo " you could pass: -a \"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=18983\""
+ echo " In most cases, you should wrap the additional parameters in double quotes."
+ echo ""
echo " -noprompt Don't prompt for input; accept all defaults when running examples that accept user input"
echo ""
echo " -V Verbose messages from this script"
echo ""
elif [ "$CMD" == "stop" ]; then
echo ""
- echo "Usage: solr stop [-k key] [-p port]"
+ echo "Usage: solr stop [-k key] [-p port] [-V]"
echo ""
echo " -k <key> Stop key; default is solrrocks"
echo ""
echo " -p <port> Specify the port the Solr HTTP listener is bound to; default is 8983"
echo ""
+ echo " -all Find and stop all running Solr servers on this host"
+ echo ""
echo " -V Verbose messages from this script"
echo ""
echo "NOTE: If port is not specified, then all running Solr servers are stopped."
@@ -187,6 +223,19 @@ spinner()
printf " \b\b\b\b"
}
+# given a port, find the pid for a Solr process
+function solr_pid_by_port() {
+ THE_PORT="$1"
+ if [ -e "$SOLR_TIP/bin/solr-$THE_PORT.pid" ]; then
+ PID=`cat $SOLR_TIP/bin/solr-$THE_PORT.pid`
+ CHECK_PID=`ps waux | awk '{print $2}' | grep $PID | sort -r | tr -d ' '`
+ if [ "$CHECK_PID" != "" ]; then
+ local solrPID=$PID
+ fi
+ fi
+ echo "$solrPID"
+}
+
# extract the value of the -Djetty.port parameter from a running Solr process
function jetty_port() {
SOLR_PID="$1"
@@ -208,7 +257,7 @@ function jetty_port() {
function run_tool() {
# Extract the solr.war if it hasn't been done already (so we can access the SolrCLI class)
- if [ ! -d "$DEFAULT_SERVER_DIR/solr-webapp/webapp" ]; then
+ if [[ -e $DEFAULT_SERVER_DIR/webapps/solr.war && ! -d "$DEFAULT_SERVER_DIR/solr-webapp/webapp" ]]; then
(mkdir -p $DEFAULT_SERVER_DIR/solr-webapp/webapp && cd $DEFAULT_SERVER_DIR/solr-webapp/webapp && jar xf $DEFAULT_SERVER_DIR/webapps/solr.war)
fi
@@ -221,11 +270,12 @@ function run_tool() {
# get information about any Solr nodes running on this host
function get_info() {
# first, see if Solr is running
- numSolrs=`ps waux | grep java | grep start.jar | wc -l | sed -e 's/^[ \t]*//'`
+ numSolrs=`find $SOLR_TIP/bin -name "solr-*.pid" -type f | wc -l | tr -d ' '`
if [ "$numSolrs" != "0" ]; then
echo -e "\nFound $numSolrs Solr nodes: "
- for ID in `ps waux | grep java | grep start.jar | awk '{print $2}' | sort -r`
+ for PIDF in `find $SOLR_TIP/bin -name "solr-*.pid" -type f`
do
+ ID=`cat $PIDF`
port=`jetty_port "$ID"`
if [ "$port" != "" ]; then
echo ""
@@ -235,7 +285,23 @@ function get_info() {
fi
done
else
- echo -e "\nNo Solr nodes are running.\n"
+ # no pid files but check using ps just to be sure
+ numSolrs=`ps waux | grep java | grep start.jar | wc -l | sed -e 's/^[ \t]*//'`
+ if [ "$numSolrs" != "0" ]; then
+ echo -e "\nFound $numSolrs Solr nodes: "
+ for ID in `ps waux | grep java | grep start.jar | awk '{print $2}' | sort -r`
+ do
+ port=`jetty_port "$ID"`
+ if [ "$port" != "" ]; then
+ echo ""
+ echo "Found Solr process $ID running on port $port"
+ run_tool status -solr http://localhost:$port/solr
+ echo ""
+ fi
+ done
+ else
+ echo -e "\nNo Solr nodes are running.\n"
+ fi
fi
} # end get_info
@@ -248,27 +314,30 @@ function stop_solr() {
SOLR_PORT="$2"
STOP_PORT="79${SOLR_PORT: -2}"
STOP_KEY="$3"
-
- SOLR_PID=`ps waux | grep start.jar | grep $SOLR_PORT | grep -v grep | awk '{print $2}' | sort -r`
+ SOLR_PID="$4"
+
if [ "$SOLR_PID" != "" ]; then
echo -e "Sending stop command to Jetty stop port $STOP_PORT ... waiting 5 seconds to allow process $SOLR_PID to stop gracefully."
$JAVA -jar $DIR/start.jar STOP.PORT=$STOP_PORT STOP.KEY=$STOP_KEY --stop || true
(sleep 5) &
spinner $!
+ rm -f $SOLR_TIP/bin/solr-$SOLR_PORT.pid
else
echo -e "No Solr nodes found to stop."
exit 0
fi
- SOLR_PID=`ps waux | grep start.jar | grep $SOLR_PORT | grep -v grep | awk '{print $2}' | sort -r`
- if [ "$SOLR_PID" != "" ]; then
+ CHECK_PID=`ps waux | awk '{print $2}' | grep $SOLR_PID | sort -r | tr -d ' '`
+ if [ "$CHECK_PID" != "" ]; then
echo -e "Solr process $SOLR_PID is still running; forcefully killing it now."
kill -9 $SOLR_PID
echo "Killed process $SOLR_PID"
+ rm -f $SOLR_TIP/bin/solr-$SOLR_PORT.pid
+ sleep 1
fi
- SOLR_PID=`ps waux | grep start.jar | grep $SOLR_PORT | grep -v grep | awk '{print $2}' | sort -r`
- if [ "$SOLR_PID" != "" ]; then
+ CHECK_PID=`ps waux | awk '{print $2}' | grep $SOLR_PID | sort -r | tr -d ' '`
+ if [ "$CHECK_PID" != "" ]; then
echo "ERROR: Failed to kill previous Solr Java process $SOLR_PID ... script fails."
exit 1
fi
@@ -365,23 +434,6 @@ if [ "$SCRIPT_CMD" != "stop" ] && [ "$SC
exit 1
fi
-# If an include wasn't specified in the environment, then search for one...
-if [ "x$SOLR_INCLUDE" == "x" ]; then
- # Locations (in order) to use when searching for an include file.
- for include in "`dirname "$0"`/solr.in.sh" \
- "$HOME/.solr.in.sh" \
- /usr/share/solr/solr.in.sh \
- /usr/local/share/solr/solr.in.sh \
- /opt/solr/solr.in.sh; do
- if [ -r "$include" ]; then
- . "$include"
- break
- fi
- done
-elif [ -r "$SOLR_INCLUDE" ]; then
- . "$SOLR_INCLUDE"
-fi
-
# Run in foreground (default is to run in the background)
FG="false"
noprompt=false
@@ -400,13 +452,22 @@ if [ $# -gt 0 ]; then
fi
# see if the arg value is relative to the tip vs full path
- if [ -d "$SOLR_TIP/$2" ]; then
- SOLR_SERVER_DIR="$SOLR_TIP/$2"
- else
+ if [[ $2 != /* ]] && [[ -d "$SOLR_TIP/$2" ]]; then
+ SOLR_SERVER_DIR="$SOLR_TIP/$2"
+ else
SOLR_SERVER_DIR="$2"
fi
shift 2
;;
+ -s|-solr.home)
+ if [ "${2:0:1}" == "-" ]; then
+ print_usage "$SCRIPT_CMD" "Expected directory but found $2 instead!"
+ exit 1
+ fi
+
+ SOLR_HOME="$2"
+ shift 2
+ ;;
-e|-example)
if [ "${2:0:1}" == "-" ]; then
print_usage "$SCRIPT_CMD" "Expected example name but found $2 instead!"
@@ -452,6 +513,14 @@ if [ $# -gt 0 ]; then
ZK_HOST="$2"
shift 2
;;
+ -a|-addlopts)
+ ADDITIONAL_CMD_OPTS="$2"
+ shift 2
+ ;;
+ -k|-key)
+ STOP_KEY="$2"
+ shift 2
+ ;;
-help|-usage)
print_usage "$SCRIPT_CMD"
exit 0
@@ -464,6 +533,10 @@ if [ $# -gt 0 ]; then
verbose=true
shift
;;
+ -all)
+ stop_all=true
+ shift
+ ;;
--)
shift
break
@@ -602,28 +675,32 @@ if [ "$EXAMPLE" != "" ]; then
esac
fi
-if [ "$SOLR_HOME" == "" ]; then
- SOLR_HOME="$SOLR_SERVER_DIR/solr"
-fi
-
if [ "$STOP_KEY" == "" ]; then
STOP_KEY="solrrocks"
fi
# stop all if no port specified
if [[ "$SCRIPT_CMD" == "stop" && "$SOLR_PORT" == "" ]]; then
- numSolrs=`ps waux | grep java | grep start.jar | wc -l | sed -e 's/^[ \t]*//'`
- if [ "$numSolrs" != "0" ]; then
- echo -e "\nFound $numSolrs Solr nodes to stop."
- for ID in `ps waux | grep java | grep start.jar | awk '{print $2}' | sort -r`
+ if $stop_all; then
+ none_stopped=true
+ for PIDF in `find $SOLR_TIP/bin -name "solr-*.pid" -type f`
do
- port=`jetty_port "$ID"`
- stop_solr "$SOLR_SERVER_DIR" "$port" "$STOP_KEY"
- done
+ NEXT_PID=`cat $PIDF`
+ port=`jetty_port "$NEXT_PID"`
+ if [ "$port" != "" ]; then
+ stop_solr "$SOLR_SERVER_DIR" "$port" "$STOP_KEY" "$NEXT_PID"
+ none_stopped=false
+ fi
+ rm -f $PIDF
+ done
+ if $none_stopped; then
+ echo -e "\nNo Solr nodes found to stop.\n"
+ fi
else
- echo -e "\nNo Solr nodes found to stop.\n"
+ echo -e "\nERROR: Must either specify a port using -p or -all to stop all Solr nodes on this host.\n"
+ exit 1
fi
- exit
+ exit
fi
if [ "$SOLR_PORT" == "" ]; then
@@ -636,7 +713,13 @@ fi
if [[ "$SCRIPT_CMD" == "start" ]]; then
# see if Solr is already running
- SOLR_PID=`ps waux | grep start.jar | grep $SOLR_PORT | grep -v grep | awk '{print $2}' | sort -r`
+ SOLR_PID=`solr_pid_by_port "$SOLR_PORT"`
+
+ if [ "$SOLR_PID" == "" ]; then
+ # not found using the pid file ... but use ps to ensure not found
+ SOLR_PID=`ps waux | grep start.jar | grep $SOLR_PORT | grep -v grep | awk '{print $2}' | sort -r`
+ fi
+
if [ "$SOLR_PID" != "" ]; then
echo -e "\nSolr already running on port $SOLR_PORT (pid: $SOLR_PID)!"
echo -e "Please use the 'restart' command if you want to restart this node.\n"
@@ -644,7 +727,17 @@ if [[ "$SCRIPT_CMD" == "start" ]]; then
fi
else
# either stop or restart
- stop_solr "$SOLR_SERVER_DIR" "$SOLR_PORT" "$STOP_KEY"
+ # see if Solr is already running
+ SOLR_PID=`solr_pid_by_port "$SOLR_PORT"`
+ if [ "$SOLR_PID" == "" ]; then
+ # not found using the pid file ... but use ps to ensure not found
+ SOLR_PID=`ps waux | grep start.jar | grep $SOLR_PORT | grep -v grep | awk '{print $2}' | sort -r`
+ fi
+ if [ "$SOLR_PID" != "" ]; then
+ stop_solr "$SOLR_SERVER_DIR" "$SOLR_PORT" "$STOP_KEY" "$SOLR_PID"
+ else
+ echo -e "No process found for Solr node running on port $SOLR_PORT"
+ fi
fi
# backup the log files
@@ -668,6 +761,22 @@ if [ "$SCRIPT_CMD" == "stop" ]; then
fi
# if we get here, then we're starting a new node up ...
+if [ "$SOLR_HOME" == "" ]; then
+ SOLR_HOME="$SOLR_SERVER_DIR/solr"
+else
+ if [[ $SOLR_HOME != /* ]] && [[ -d "$SOLR_SERVER_DIR/$SOLR_HOME" ]]; then
+ SOLR_HOME="$SOLR_SERVER_DIR/$SOLR_HOME"
+ fi
+fi
+
+if [ ! -e "$SOLR_HOME" ]; then
+ echo -e "\nSolr home directory $SOLR_HOME not found!\n"
+ exit 1
+fi
+if [ ! -e "$SOLR_HOME/solr.xml" ]; then
+ echo -e "\nSolr home directory $SOLR_HOME must contain a solr.xml file!\n"
+ exit 1
+fi
# if verbose gc logging enabled, setup the location of the log file
if [ "$GC_LOG_OPTS" != "" ]; then
@@ -689,11 +798,11 @@ if [ "$SOLR_MODE" == "solrcloud" ]; then
fi
CLOUD_MODE_OPTS="$CLOUD_MODE_OPTS -DzkRun"
-
- # and if collection1 needs to be bootstrapped
- if [ -e "$SOLR_HOME/collection1/core.properties" ]; then
- CLOUD_MODE_OPTS="$CLOUD_MODE_OPTS -Dbootstrap_confdir=./solr/collection1/conf -Dcollection.configName=myconf -DnumShards=1"
- fi
+ fi
+
+ # and if collection1 needs to be bootstrapped
+ if [ -e "$SOLR_HOME/collection1/core.properties" ]; then
+ CLOUD_MODE_OPTS="$CLOUD_MODE_OPTS -Dbootstrap_confdir=./solr/collection1/conf -Dcollection.configName=myconf -DnumShards=1"
fi
fi
@@ -780,7 +889,7 @@ $SOLR_HOST_ARG -Djetty.port=$SOLR_PORT \
$JAVA $SOLR_START_OPTS $SOLR_ADDL_ARGS -XX:OnOutOfMemoryError="$SOLR_TIP/bin/oom_solr.sh $SOLR_PORT" -jar start.jar
else
# run Solr in the background
- nohup $JAVA $SOLR_START_OPTS $SOLR_ADDL_ARGS -XX:OnOutOfMemoryError="$SOLR_TIP/bin/oom_solr.sh $SOLR_PORT" -jar start.jar 1>$SOLR_TIP/bin/solr-$SOLR_PORT-console.log 2>&1 &
+ nohup $JAVA $SOLR_START_OPTS $SOLR_ADDL_ARGS -XX:OnOutOfMemoryError="$SOLR_TIP/bin/oom_solr.sh $SOLR_PORT" -jar start.jar 1>$SOLR_SERVER_DIR/logs/solr-$SOLR_PORT-console.log 2>&1 & echo $! > $SOLR_TIP/bin/solr-$SOLR_PORT.pid
# no lsof on cygwin though
if [ "$hasLsof" != "" ]; then
@@ -815,7 +924,7 @@ $SOLR_HOST_ARG -Djetty.port=$SOLR_PORT \
}
if [ "$EXAMPLE" != "cloud" ]; then
- launch_solr "$FG" ""
+ launch_solr "$FG" "$ADDITIONAL_CMD_OPTS"
else
#
# SolrCloud example is a bit involved so needs special handling here
@@ -823,23 +932,42 @@ else
SOLR_SERVER_DIR=$SOLR_TIP/node1
SOLR_HOME=$SOLR_TIP/node1/solr
SOLR_PORT=${CLOUD_PORTS[0]}
+
+ if [ "$ZK_HOST" != "" ]; then
+ DASHZ="-z $ZK_HOST"
+ fi
+
+ if [ "$SOLR_HEAP" != "" ]; then
+ DASHM="-m $SOLR_HEAP"
+ fi
+
+ if [ "$ADDITIONAL_CMD_OPTS" != "" ]; then
+ DASHA="-a $ADDITIONAL_CMD_OPTS"
+ fi
+
echo -e "\nStarting up SolrCloud node1 on port ${CLOUD_PORTS[0]} using command:\n"
- echo -e "solr start -cloud -d node1 -p $SOLR_PORT \n\n"
+ echo -e "solr start -cloud -d node1 -p $SOLR_PORT $DASHZ $DASHM $DASHA\n\n"
# can't launch this node in the foreground else we can't run anymore commands
- launch_solr "false" ""
-
- zk_port=$[$SOLR_PORT+1000]
- zk_host=localhost:$zk_port
-
+ launch_solr "false" "$ADDITIONAL_CMD_OPTS"
+
+ sleep 5
+
+ # if user did not define a specific -z parameter, assume embedded in first cloud node we launched above
+ zk_host=$ZK_HOST
+ if [ "$zk_host" == "" ]; then
+ zk_port=$[$SOLR_PORT+1000]
+ zk_host=localhost:$zk_port
+ fi
+
for (( s=1; s<$CLOUD_NUM_NODES; s++ ))
do
ndx=$[$s+1]
next_port=${CLOUD_PORTS[$s]}
echo -e "\n\nStarting node$ndx on port $next_port using command:\n"
- echo -e "solr start -cloud -d node$ndx -p $next_port -z $zk_host \n\n"
+ echo -e "solr start -cloud -d node$ndx -p $next_port -z $zk_host $DASHM $DASHA \n\n"
# call this script again with correct args for next node
- $SOLR_TIP/bin/solr start -cloud -d node$ndx -p $next_port -z $zk_host
+ $SOLR_TIP/bin/solr start -cloud -d node$ndx -p $next_port -z $zk_host $DASHM $DASHA
done
# TODO: better (shorter) name??
Modified: lucene/dev/branches/lucene_solr_4_10/solr/bin/solr.cmd
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_10/solr/bin/solr.cmd?rev=1631528&r1=1631527&r2=1631528&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_10/solr/bin/solr.cmd (original)
+++ lucene/dev/branches/lucene_solr_4_10/solr/bin/solr.cmd Mon Oct 13 20:08:07 2014
@@ -30,8 +30,16 @@ REM Used to report errors before exiting
set SCRIPT_ERROR=
set NO_USER_PROMPT=0
+REM Allow user to import vars from an include file
+REM vars set in the include file can be overridden with
+REM command line args
+IF "%SOLR_INCLUDE%"=="" set SOLR_INCLUDE=solr.in.cmd
+IF EXIST "%SOLR_INCLUDE%" CALL "%SOLR_INCLUDE%"
+
REM Verify Java is available
-if NOT DEFINED JAVA_HOME goto need_java_home
+IF DEFINED SOLR_JAVA_HOME set "JAVA_HOME=%SOLR_JAVA_HOME%"
+IF NOT DEFINED JAVA_HOME goto need_java_home
+set JAVA_HOME=%JAVA_HOME:"=%
"%JAVA_HOME%"\bin\java -version:1.8 -version > nul 2>&1
IF ERRORLEVEL 1 "%JAVA_HOME%"\bin\java -version:1.7 -version > nul 2>&1
IF ERRORLEVEL 1 goto need_java_vers
@@ -59,14 +67,14 @@ IF "%1"=="start" goto set_script_cmd
IF "%1"=="stop" goto set_script_cmd
IF "%1"=="restart" goto set_script_cmd
IF "%1"=="healthcheck" (
-REM healthcheck uses different arg parsing strategy
-SHIFT
-goto parse_healthcheck_args
+ REM healthcheck uses different arg parsing strategy
+ SHIFT
+ goto parse_healthcheck_args
)
-goto include_vars
+goto parse_args
:usage
-IF NOT "%SCRIPT_ERROR%"=="" ECHO %SCRIPT_ERROR%
+IF NOT "%SCRIPT_ERROR%"=="" ECHO %SCRIPT_ERROR%
IF [%FIRST_ARG%]==[] goto script_usage
IF "%FIRST_ARG%"=="-help" goto script_usage
IF "%FIRST_ARG%"=="-usage" goto script_usage
@@ -81,18 +89,22 @@ goto done
@echo Usage: solr COMMAND OPTIONS
@echo where COMMAND is one of: start, stop, restart, healthcheck
@echo.
-@echo Example: Start Solr running in the background on port 8984:
+@echo Standalone server example (start Solr running in the background on port 8984):
@echo.
-@echo ./solr start -p 8984
+@echo solr start -p 8984
+@echo.
+@echo SolrCloud example (start Solr running in SolrCloud mode using localhost:2181 to connect to ZooKeeper, with 1g max heap size and remote Java debug options enabled):
+@echo.
+@echo solr start -c -m 1g -z localhost:2181 -a "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044"
@echo.
@echo Pass -help after any COMMAND to see command-specific usage information,
-@echo such as: ./solr start -help
+@echo such as: solr start -help or solr stop -help
@echo.
goto done
:start_usage
@echo.
-@echo Usage: solr %SCRIPT_CMD% [-f] [-c] [-h hostname] [-p port] [-d directory] [-z zkHost] [-m memory] [-e example] [-V]
+@echo Usage: solr %SCRIPT_CMD% [-f] [-c] [-h hostname] [-p port] [-d directory] [-z zkHost] [-m memory] [-e example] [-s solr.solr.home] [-a "additional-options"] [-V]
@echo.
@echo -f Start Solr in foreground; default starts Solr in the background
@echo and sends stdout / stderr to solr-PORT-console.log
@@ -112,6 +124,13 @@ goto done
@echo -m memory Sets the min (-Xms) and max (-Xmx) heap size for the JVM, such as: -m 4g
@echo results in: -Xms4g -Xmx4g; by default, this script sets the heap size to 512m
@echo.
+@echo -s dir Sets the solr.solr.home system property; Solr will create core directories under
+@echo this directory. This allows you to run multiple Solr instances on the same host
+@echo while reusing the same server directory set using the -d parameter. If set, the
+@echo specified directory should contain a solr.xml file. The default value is example/solr.
+@echo This parameter is ignored when running examples (-e), as the solr.solr.home depends
+@echo on which example is run.
+@echo.
@echo -e example Name of the example to run; available examples:
@echo cloud: SolrCloud example
@echo default: Solr default example
@@ -119,6 +138,11 @@ goto done
@echo schemaless: Schema-less example
@echo multicore: Multicore
@echo.
+@echo -a opts Additional parameters to pass to the JVM when starting Solr, such as to setup
+@echo Java debug options. For example, to enable a Java debugger to attach to the Solr JVM
+@echo you could pass: -a "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=18983"
+@echo In most cases, you should wrap the additional parameters in double quotes.
+@echo.
@echo -noprompt Don't prompt for input; accept all defaults when running examples that accept user input
@echo.
@echo -V Verbose messages from this script
@@ -149,14 +173,6 @@ goto done
@echo.
goto done
-REM Allow user to import vars from an include file
-REM vars set in the include file can be overridden with
-REM command line args
-:include_vars
-IF "%SOLR_INCLUDE%"=="" set SOLR_INCLUDE=solr.in.cmd
-IF EXIST "%SOLR_INCLUDE%" CALL "%SOLR_INCLUDE%"
-goto parse_args
-
REM Really basic command-line arg parsing
:parse_args
IF "%SCRIPT_CMD%"=="" set SCRIPT_CMD=start
@@ -172,6 +188,8 @@ IF "%1"=="-c" goto set_cloud_mode
IF "%1"=="-cloud" goto set_cloud_mode
IF "%1"=="-d" goto set_server_dir
IF "%1"=="-dir" goto set_server_dir
+IF "%1"=="-s" goto set_solr_home_dir
+IF "%1"=="-solr.home" goto set_solr_home_dir
IF "%1"=="-e" goto set_example
IF "%1"=="-example" goto set_example
IF "%1"=="-h" goto set_host
@@ -182,14 +200,17 @@ IF "%1"=="-p" goto set_port
IF "%1"=="-port" goto set_port
IF "%1"=="-z" goto set_zookeeper
IF "%1"=="-zkhost" goto set_zookeeper
+IF "%1"=="-a" goto set_addl_opts
+IF "%1"=="-addlopts" goto set_addl_opts
IF "%1"=="-noprompt" goto set_noprompt
+IF "%1"=="-k" goto set_stop_key
+IF "%1"=="-key" goto set_stop_key
IF NOT "%1"=="" goto invalid_cmd_line
-process_script_cmd
:set_script_cmd
set SCRIPT_CMD=%1
SHIFT
-goto include_vars
+goto parse_args
:set_foreground_mode
set FG=1
@@ -208,7 +229,7 @@ goto parse_args
:set_server_dir
-set "arg=%2"
+set "arg=%~2"
set firstChar=%arg:~0,1%
IF "%firstChar%"=="-" (
set SCRIPT_ERROR=Expected directory but found %2 instead!
@@ -216,80 +237,112 @@ IF "%firstChar%"=="-" (
)
REM See if they are using a short-hand name relative from the Solr tip directory
-IF EXIST "%SOLR_TIP%\%2" (
- set "SOLR_SERVER_DIR=%SOLR_TIP%\%2"
+IF EXIST "%SOLR_TIP%\%~2" (
+ set "SOLR_SERVER_DIR=%SOLR_TIP%\%~2"
) ELSE (
- set "SOLR_SERVER_DIR=%2"
+ set "SOLR_SERVER_DIR=%~2"
+)
+SHIFT
+SHIFT
+goto parse_args
+
+:set_solr_home_dir
+
+set "arg=%~2"
+set firstChar=%arg:~0,1%
+IF "%firstChar%"=="-" (
+ set SCRIPT_ERROR=Expected directory but found %2 instead!
+ goto invalid_cmd_line
)
+set "SOLR_HOME=%~2"
SHIFT
SHIFT
goto parse_args
:set_example
-set "arg=%2"
+set "arg=%~2"
set firstChar=%arg:~0,1%
IF "%firstChar%"=="-" (
set SCRIPT_ERROR=Expected example name but found %2 instead!
goto invalid_cmd_line
)
-set EXAMPLE=%2
+set EXAMPLE=%~2
SHIFT
SHIFT
goto parse_args
:set_memory
-set "arg=%2"
+set "arg=%~2"
set firstChar=%arg:~0,1%
IF "%firstChar%"=="-" (
set SCRIPT_ERROR=Expected memory setting but found %2 instead!
goto invalid_cmd_line
)
-set SOLR_HEAP=%2
-@echo SOLR_HEAP=%SOLR_HEAP%
+set SOLR_HEAP=%~2
SHIFT
SHIFT
goto parse_args
:set_host
-set "arg=%2"
+set "arg=%~2"
set firstChar=%arg:~0,1%
IF "%firstChar%"=="-" (
set SCRIPT_ERROR=Expected hostname but found %2 instead!
goto invalid_cmd_line
)
-set SOLR_HOST=%2
+set SOLR_HOST=%~2
SHIFT
SHIFT
goto parse_args
:set_port
-set "arg=%2"
+set "arg=%~2"
+set firstChar=%arg:~0,1%
+IF "%firstChar%"=="-" (
+ set SCRIPT_ERROR=Expected port but found %2 instead!
+ goto invalid_cmd_line
+)
+
+set SOLR_PORT=%~2
+SHIFT
+SHIFT
+goto parse_args
+
+:set_stop_key
+set "arg=%~2"
set firstChar=%arg:~0,1%
IF "%firstChar%"=="-" (
set SCRIPT_ERROR=Expected port but found %2 instead!
goto invalid_cmd_line
)
-set SOLR_PORT=%2
+set STOP_KEY=%~2
SHIFT
SHIFT
goto parse_args
:set_zookeeper
-set "arg=%2"
+set "arg=%~2"
set firstChar=%arg:~0,1%
IF "%firstChar%"=="-" (
set SCRIPT_ERROR=Expected ZooKeeper connection string but found %2 instead!
goto invalid_cmd_line
)
-set "ZK_HOST=%2"
+set "ZK_HOST=%~2"
+SHIFT
+SHIFT
+goto parse_args
+
+:set_addl_opts
+set "arg=%~2"
+set "SOLR_ADDL_ARGS=%~2"
SHIFT
SHIFT
goto parse_args
@@ -305,7 +358,7 @@ REM Perform the requested command after
IF "%verbose%"=="1" (
@echo Using Solr root directory: %SOLR_TIP%
@echo Using Java: %JAVA%
- %JAVA% -version
+ "%JAVA%" -version
)
IF NOT "%SOLR_HOST%"=="" (
@@ -344,6 +397,19 @@ IF "%EXAMPLE%"=="" (
:start_solr
IF "%SOLR_HOME%"=="" set "SOLR_HOME=%SOLR_SERVER_DIR%\solr"
+IF NOT EXIST "%SOLR_HOME%\" (
+ IF EXIST "%SOLR_SERVER_DIR%\%SOLR_HOME%" (
+ set "SOLR_HOME=%SOLR_SERVER_DIR%\%SOLR_HOME%"
+ ) ELSE (
+ set SCRIPT_ERROR=Solr home directory %SOLR_HOME% not found!
+ goto err
+ )
+)
+
+IF NOT EXIST "%SOLR_HOME%\solr.xml" (
+ set SCRIPT_ERROR=Solr home directory %SOLR_HOME% must contain solr.xml!
+ goto err
+)
IF "%STOP_KEY%"=="" set STOP_KEY=solrrocks
@@ -360,7 +426,7 @@ IF "%SOLR_PORT%"=="" set SOLR_PORT=8983
IF "%STOP_PORT%"=="" set STOP_PORT=79%SOLR_PORT:~-2,2%
IF "%SCRIPT_CMD%"=="start" (
- REM see if Solr is already running using netstat
+ REM see if Solr is already running using netstat
For /f "tokens=5" %%j in ('netstat -aon ^| find /i "listening" ^| find ":%SOLR_PORT%"') do (
set "SCRIPT_ERROR=Process %%j is already listening on port %SOLR_PORT%. If this is Solr, please stop it first before starting (or use restart). If this is not Solr, then please choose a different port using -p PORT"
goto err
@@ -403,8 +469,8 @@ IF "%SOLR_MODE%"=="solrcloud" (
) ELSE (
IF "%verbose%"=="1" echo Configuring SolrCloud to launch an embedded ZooKeeper using -DzkRun
set "CLOUD_MODE_OPTS=!CLOUD_MODE_OPTS! -DzkRun"
- IF EXIST "%SOLR_HOME%\collection1\core.properties" set "CLOUD_MODE_OPTS=!CLOUD_MODE_OPTS! -Dbootstrap_confdir=./solr/collection1/conf -Dcollection.configName=myconf -DnumShards=1"
- )
+ )
+ IF EXIST "%SOLR_HOME%\collection1\core.properties" set "CLOUD_MODE_OPTS=!CLOUD_MODE_OPTS! -Dbootstrap_confdir=./solr/collection1/conf -Dcollection.configName=myconf -DnumShards=1"
) ELSE (
set CLOUD_MODE_OPTS=
)
@@ -425,7 +491,7 @@ IF NOT "%SOLR_HOST%"=="" set REMOTE_JMX_
IF NOT "%SOLR_HEAP%"=="" set SOLR_JAVA_MEM=-Xms%SOLR_HEAP% -Xmx%SOLR_HEAP%
IF "%SOLR_JAVA_MEM%"=="" set SOLR_JAVA_MEM=-Xms512m -Xmx512m
-IF "%SOLR_TIMEZONE%"=="" set SOLR_TIMEZONE=UTC
+IF "%SOLR_TIMEZONE%"=="" set SOLR_TIMEZONE=UTC
IF "%verbose%"=="1" (
@echo Starting Solr using the following settings:
@@ -452,14 +518,14 @@ IF NOT "%SOLR_HOST_ARG%"=="" set START_O
cd "%SOLR_SERVER_DIR%"
@echo.
@echo Starting Solr on port %SOLR_PORT% from %SOLR_SERVER_DIR%
-@echo.
+@echo.
IF "%FG%"=="1" (
REM run solr in the foreground
"%JAVA%" -server -Xss256k %SOLR_JAVA_MEM% %START_OPTS% -DSTOP.PORT=%STOP_PORT% -DSTOP.KEY=%STOP_KEY% ^
-Djetty.port=%SOLR_PORT% -Dsolr.solr.home="%SOLR_HOME%" -jar start.jar
) ELSE (
START "" "%JAVA%" -server -Xss256k %SOLR_JAVA_MEM% %START_OPTS% -DSTOP.PORT=%STOP_PORT% -DSTOP.KEY=%STOP_KEY% ^
- -Djetty.port=%SOLR_PORT% -Dsolr.solr.home="%SOLR_HOME%" -jar start.jar > "%SOLR_TIP%\bin\solr-%SOLR_PORT%-console.log"
+ -Djetty.port=%SOLR_PORT% -Dsolr.solr.home="%SOLR_HOME%" -jar start.jar > "%SOLR_SERVER_DIR%\logs\solr-%SOLR_PORT%-console.log"
)
goto done
@@ -484,14 +550,14 @@ IF "%NO_USER_PROMPT%"=="1" (
goto while_num_nodes_not_valid
)
-:while_num_nodes_not_valid
+:while_num_nodes_not_valid
IF "%USER_INPUT%"=="" set USER_INPUT=2
SET /A INPUT_AS_NUM=!USER_INPUT!*1
IF %INPUT_AS_NUM% GEQ 1 IF %INPUT_AS_NUM% LEQ 4 set CLOUD_NUM_NODES=%INPUT_AS_NUM%
IF NOT DEFINED CLOUD_NUM_NODES (
SET USER_INPUT=
SET /P "USER_INPUT=Please enter a number between 1 and 4 [2]: "
- goto while_num_nodes_not_valid
+ goto while_num_nodes_not_valid
)
@echo Ok, let's start up %CLOUD_NUM_NODES% Solr nodes for your example SolrCloud cluster.
@@ -511,7 +577,7 @@ for /l %%x in (1, 1, !CLOUD_NUM_NODES!)
)
)
)
-
+
IF "%NO_USER_PROMPT%"=="1" (
set NODE_PORT=!DEF_PORT!
) ELSE (
@@ -521,20 +587,37 @@ for /l %%x in (1, 1, !CLOUD_NUM_NODES!)
echo node%%x port: !NODE_PORT!
@echo.
)
-
+
IF NOT EXIST "%SOLR_TIP%\node%%x" (
@echo Cloning %DEFAULT_SERVER_DIR% into %SOLR_TIP%\node%%x
xcopy /Q /E /I "%DEFAULT_SERVER_DIR%" "%SOLR_TIP%\node%%x"
)
-
- IF %%x EQU 1 (
+
+ IF NOT "!SOLR_HEAP!"=="" (
+ set "DASHM=-m !SOLR_HEAP!"
+ ) ELSE (
+ set "DASHM="
+ )
+
+ IF %%x EQU 1 (
set EXAMPLE=
- START "" "%SDIR%\solr" -f -c -p !NODE_PORT! -d node1
+ IF NOT "!ZK_HOST!"=="" (
+ set "DASHZ=-z !ZK_HOST!"
+ ) ELSE (
+ set "DASHZ="
+ )
+ @echo Starting node1 on port !NODE_PORT! using command:
+ @echo solr -cloud -p !NODE_PORT! -d node1 !DASHZ! !DASHM!
+ START "" "%SDIR%\solr" -f -cloud -p !NODE_PORT! -d node1 !DASHZ! !DASHM!
set NODE1_PORT=!NODE_PORT!
) ELSE (
- set /A ZK_PORT=!NODE1_PORT!+1000
- set "ZK_HOST=localhost:!ZK_PORT!"
- START "" "%SDIR%\solr" -f -c -p !NODE_PORT! -d node%%x -z !ZK_HOST!
+ IF "!ZK_HOST!"=="" (
+ set /A ZK_PORT=!NODE1_PORT!+1000
+ set "ZK_HOST=localhost:!ZK_PORT!"
+ )
+ @echo Starting node%%x on port !NODE_PORT! using command:
+ @echo solr -cloud -p !NODE_PORT! -d node%%x -z !ZK_HOST! !DASHM!
+ START "" "%SDIR%\solr" -f -cloud -p !NODE_PORT! -d node%%x -z !ZK_HOST! !DASHM!
)
timeout /T 10
@@ -600,7 +683,7 @@ echo.
set COLLECTIONS_API=http://localhost:!NODE1_PORT!/solr/admin/collections
set "CLOUD_CREATE_COLLECTION_CMD=%COLLECTIONS_API%?action=CREATE&name=%CLOUD_COLLECTION%&replicationFactor=%CLOUD_REPFACT%&numShards=%CLOUD_NUM_SHARDS%&collection.configName=!CLOUD_CONFIG!&maxShardsPerNode=%MAX_SHARDS_PER_NODE%&wt=json&indent=2"
-echo Creating new collection %CLOUD_COLLECTION% with %CLOUD_NUM_SHARDS% shards and replication factor %CLOUD_REPFACT% using Collections API command:
+echo Creating new collection %CLOUD_COLLECTION% with %CLOUD_NUM_SHARDS% shards and replication factor %CLOUD_REPFACT% using Collections API command:
echo.
@echo "%CLOUD_CREATE_COLLECTION_CMD%"
echo.
@@ -620,7 +703,7 @@ goto done
:get_info
-REM Find all Java processes, correlate with those listening on a port
+REM Find all Java processes, correlate with those listening on a port
REM and then try to contact via that port using the status tool
for /f "tokens=2" %%a in ('tasklist ^| find "java.exe"') do (
for /f "tokens=2,5" %%j in ('netstat -aon ^| find /i "listening"') do (
@@ -633,11 +716,11 @@ for /f "tokens=2" %%a in ('tasklist ^| f
"%JAVA%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
org.apache.solr.util.SolrCLI status -solr http://localhost:%%y/solr
-
+
@echo.
)
)
- )
+ )
)
)
if NOT "!has_info!"=="1" echo No running Solr nodes found.
@@ -656,13 +739,13 @@ IF "%1"=="/?" goto usage
goto run_healthcheck
:set_healthcheck_collection
-set HEALTHCHECK_COLLECTION=%2
+set HEALTHCHECK_COLLECTION=%~2
SHIFT
SHIFT
goto parse_healthcheck_args
:set_healthcheck_zk
-set HEALTHCHECK_ZK_HOST=%2
+set HEALTHCHECK_ZK_HOST=%~2
SHIFT
SHIFT
goto parse_healthcheck_args
Modified: lucene/dev/branches/lucene_solr_4_10/solr/bin/solr.in.cmd
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_10/solr/bin/solr.in.cmd?rev=1631528&r1=1631527&r2=1631528&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_10/solr/bin/solr.in.cmd (original)
+++ lucene/dev/branches/lucene_solr_4_10/solr/bin/solr.in.cmd Mon Oct 13 20:08:07 2014
@@ -25,7 +25,7 @@ REM Increase Java Min/Max Heap as needed
set SOLR_JAVA_MEM=-Xms512m -Xmx512m -XX:MaxPermSize=256m -XX:PermSize=256m
REM Enable verbose GC logging
-set GC_LOG_OPTS=-verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution
+set GC_LOG_OPTS=-verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime
REM These GC settings have shown to work well for a number of common Solr workloads
set GC_TUNE=-XX:-UseSuperWord ^
@@ -34,11 +34,13 @@ set GC_TUNE=-XX:-UseSuperWord ^
-XX:TargetSurvivorRatio=90 ^
-XX:MaxTenuringThreshold=8 ^
-XX:+UseConcMarkSweepGC ^
+ -XX:+UseParNewGC ^
+ -XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 ^
-XX:+CMSScavengeBeforeRemark ^
-XX:PretenureSizeThreshold=64m ^
-XX:CMSFullGCsBeforeCompaction=1 ^
-XX:+UseCMSInitiatingOccupancyOnly ^
- -XX:CMSInitiatingOccupancyFraction=70 ^
+ -XX:CMSInitiatingOccupancyFraction=50 ^
-XX:CMSTriggerPermRatio=80 ^
-XX:CMSMaxAbortablePrecleanTime=6000 ^
-XX:+CMSParallelRemarkEnabled ^
Modified: lucene/dev/branches/lucene_solr_4_10/solr/bin/solr.in.sh
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_10/solr/bin/solr.in.sh?rev=1631528&r1=1631527&r2=1631528&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_10/solr/bin/solr.in.sh (original)
+++ lucene/dev/branches/lucene_solr_4_10/solr/bin/solr.in.sh Mon Oct 13 20:08:07 2014
@@ -23,7 +23,7 @@ SOLR_JAVA_MEM="-Xms512m -Xmx512m -XX:Max
# Enable verbose GC logging
GC_LOG_OPTS="-verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails \
--XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution"
+-XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime"
# These GC settings have shown to work well for a number of common Solr workloads
GC_TUNE="-XX:-UseSuperWord \
@@ -32,11 +32,13 @@ GC_TUNE="-XX:-UseSuperWord \
-XX:TargetSurvivorRatio=90 \
-XX:MaxTenuringThreshold=8 \
-XX:+UseConcMarkSweepGC \
+-XX:+UseParNewGC \
+-XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 \
-XX:+CMSScavengeBeforeRemark \
-XX:PretenureSizeThreshold=64m \
-XX:CMSFullGCsBeforeCompaction=1 \
-XX:+UseCMSInitiatingOccupancyOnly \
--XX:CMSInitiatingOccupancyFraction=70 \
+-XX:CMSInitiatingOccupancyFraction=50 \
-XX:CMSTriggerPermRatio=80 \
-XX:CMSMaxAbortablePrecleanTime=6000 \
-XX:+CMSParallelRemarkEnabled \