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/12/12 01:47:50 UTC

svn commit: r1644801 - in /lucene/dev/branches/branch_5x: ./ solr/ solr/CHANGES.txt solr/bin/ solr/bin/solr solr/bin/solr.cmd solr/example/ solr/example/example-DIH/ solr/example/resources/ solr/server/ solr/server/resources/log4j.properties

Author: thelabdude
Date: Fri Dec 12 00:47:50 2014
New Revision: 1644801

URL: http://svn.apache.org/r1644801
Log:
SOLR-6833: Examples started with bin/solr -e should use a solr.solr.home directory under the example directory instead of server/solr.

Added:
    lucene/dev/branches/branch_5x/solr/example/resources/
      - copied from r1644799, lucene/dev/trunk/solr/example/resources/
Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/solr/   (props changed)
    lucene/dev/branches/branch_5x/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_5x/solr/bin/   (props changed)
    lucene/dev/branches/branch_5x/solr/bin/solr
    lucene/dev/branches/branch_5x/solr/bin/solr.cmd
    lucene/dev/branches/branch_5x/solr/example/   (props changed)
    lucene/dev/branches/branch_5x/solr/example/example-DIH/   (props changed)
    lucene/dev/branches/branch_5x/solr/server/   (props changed)
    lucene/dev/branches/branch_5x/solr/server/resources/log4j.properties

Modified: lucene/dev/branches/branch_5x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/CHANGES.txt?rev=1644801&r1=1644800&r2=1644801&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/solr/CHANGES.txt Fri Dec 12 00:47:50 2014
@@ -435,6 +435,10 @@ Other Changes
   since the checks are done automatically at a very low level in the segment merging. 
   This warning will become an error in Solr 6.0.  (hossman)
 
+* SOLR-6833: Examples started with bin/solr -e should use a solr.solr.home directory under
+  the example directory instead of server/solr. (Alexandre Rafalovitch, Anshum Gupta, hossman,
+  Timothy Potter)
+
 ==================  4.10.3 ==================
 
 Bug Fixes

Modified: lucene/dev/branches/branch_5x/solr/bin/solr
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/bin/solr?rev=1644801&r1=1644800&r2=1644801&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/bin/solr (original)
+++ lucene/dev/branches/branch_5x/solr/bin/solr Fri Dec 12 00:47:50 2014
@@ -682,12 +682,18 @@ if [ $# -gt 0 ]; then
             break
         ;;
         *)
-            if [ "$1" != "" ]; then            
-              print_usage "$SCRIPT_CMD" "$1 is not supported by this script"
-              exit 1
+            if [ "${1:0:2}" == "-D" ]; then
+              # pass thru any opts that begin with -D (java system props)
+              SOLR_OPTS="$SOLR_OPTS $1"
+              shift
             else
-              break # out-of-args, stop looping
-            fi 
+              if [ "$1" != "" ]; then
+                print_usage "$SCRIPT_CMD" "$1 is not supported by this script"
+                exit 1
+              else
+                break # out-of-args, stop looping
+              fi
+            fi
         ;;
     esac
   done
@@ -777,40 +783,35 @@ if [ "$EXAMPLE" != "" ]; then
               done
             fi       
 
-            # first, clone the server directory (w/o pulling over existing cores)
-            if [ ! -d "$SOLR_TIP/node1" ]; then
-              echo "Cloning $DEFAULT_SERVER_DIR into $SOLR_TIP/node1"
-              mkdir -p $SOLR_TIP/node1
-              cp -r $DEFAULT_SERVER_DIR/contexts $SOLR_TIP/node1/
-              cp -r $DEFAULT_SERVER_DIR/etc $SOLR_TIP/node1/
-              cp -r $DEFAULT_SERVER_DIR/lib $SOLR_TIP/node1/
-              cp -r $DEFAULT_SERVER_DIR/resources $SOLR_TIP/node1/
-              cp -r $DEFAULT_SERVER_DIR/scripts $SOLR_TIP/node1/
-              cp -r $DEFAULT_SERVER_DIR/webapps $SOLR_TIP/node1/
-              cp $DEFAULT_SERVER_DIR/start.jar $SOLR_TIP/node1/
-              mkdir -p $SOLR_TIP/node1/solr-webapp
-              mkdir -p $SOLR_TIP/node1/solr
-              cp -r $DEFAULT_SERVER_DIR/solr/configsets $SOLR_TIP/node1/solr/
-              cp $DEFAULT_SERVER_DIR/solr/solr.xml $SOLR_TIP/node1/solr/
-              cp $DEFAULT_SERVER_DIR/solr/zoo.cfg $SOLR_TIP/node1/solr/
+            # setup a unqiue solr.solr.home directory for each node
+            CLOUD_EXAMPLE_DIR=$SOLR_TIP/example/cloud
+            if [ ! -d "$CLOUD_EXAMPLE_DIR/node1/solr" ]; then
+              echo "Creating Solr home directory $CLOUD_EXAMPLE_DIR/node1/solr"
+              mkdir -p $CLOUD_EXAMPLE_DIR/node1/solr
+              cp $DEFAULT_SERVER_DIR/solr/solr.xml $CLOUD_EXAMPLE_DIR/node1/solr/
+              cp $DEFAULT_SERVER_DIR/solr/zoo.cfg $CLOUD_EXAMPLE_DIR/node1/solr/
             fi
 
             for (( s=1; s<$CLOUD_NUM_NODES; s++ ))
             do
               ndx=$[$s+1]
-              if [ ! -d "$SOLR_TIP/node$ndx" ]; then
-                echo "Cloning $SOLR_TIP/node1 into $SOLR_TIP/node$ndx"
-                cp -r $SOLR_TIP/node1 $SOLR_TIP/node$ndx
+              if [ ! -d "$CLOUD_EXAMPLE_DIR/node$ndx" ]; then
+                echo "Cloning Solr home directory $CLOUD_EXAMPLE_DIR/node1 into $CLOUD_EXAMPLE_DIR/node$ndx"
+                cp -r $CLOUD_EXAMPLE_DIR/node1 $CLOUD_EXAMPLE_DIR/node$ndx
               fi
             done
             SOLR_MODE="solrcloud"
-            SOLR_SERVER_DIR="$SOLR_TIP/node1"
-            SOLR_HOME="$SOLR_SERVER_DIR/solr"
+            SOLR_SERVER_DIR="$SOLR_TIP/server"
+            SOLR_HOME="$CLOUD_EXAMPLE_DIR/node1/solr"
             SOLR_PORT=${CLOUD_PORTS[0]}
             shift
         ;;
         techproducts)
-            SOLR_HOME="$SOLR_SERVER_DIR/solr"
+            SOLR_HOME="$SOLR_TIP/example/techproducts/solr"
+            mkdir -p $SOLR_HOME
+            if [ ! -f "$SOLR_HOME/solr.xml" ]; then
+              cp $DEFAULT_SERVER_DIR/solr/solr.xml $SOLR_HOME/solr.xml
+            fi
             EXAMPLE_CONFIGSET=sample_techproducts_configs
             shift
         ;;
@@ -819,7 +820,11 @@ if [ "$EXAMPLE" != "" ]; then
             shift
         ;;
         schemaless)
-            SOLR_HOME="$SOLR_SERVER_DIR/solr"
+            SOLR_HOME="$SOLR_TIP/example/schemaless/solr"
+            mkdir -p $SOLR_HOME
+            if [ ! -f "$SOLR_HOME/solr.xml" ]; then
+              cp $DEFAULT_SERVER_DIR/solr/solr.xml $SOLR_HOME/solr.xml
+            fi
             EXAMPLE_CONFIGSET=data_driven_schema_configs
             shift
         ;;
@@ -900,19 +905,24 @@ else
   fi
 fi
 
-# backup the log files
-if [ -f $SOLR_SERVER_DIR/logs/solr.log ]; then
-  if $verbose ; then
-    echo "Backing up $SOLR_SERVER_DIR/logs/solr.log"
+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"
+  elif [[ $SOLR_HOME != /* ]] && [[ -d "`pwd`/$SOLR_HOME" ]]; then
+    SOLR_HOME="`pwd`/$SOLR_HOME"
   fi
-  mv $SOLR_SERVER_DIR/logs/solr.log $SOLR_SERVER_DIR/logs/solr_log_`date +"%Y%m%d_%H%M"`
 fi
 
-if [ -f $SOLR_SERVER_DIR/logs/solr_gc.log ]; then
-  if $verbose ; then
-    echo "Backing up $SOLR_SERVER_DIR/logs/solr_gc.log"
-  fi
-  mv $SOLR_SERVER_DIR/logs/solr_gc.log $SOLR_SERVER_DIR/logs/solr_gc_log_`date +"%Y%m%d_%H%M"`
+# This is quite hacky, but examples rely on a different log4j.properties
+# so that we can write logs for examples to $SOLR_HOME/../logs
+SOLR_LOGS_DIR=$SOLR_SERVER_DIR/logs
+EXAMPLE_DIR=$SOLR_TIP/example
+if [ "${SOLR_HOME:0:${#EXAMPLE_DIR}}" = $EXAMPLE_DIR ]; then
+  LOG4J_PROPS=$EXAMPLE_DIR/resources/log4j.properties
+  SOLR_LOGS_DIR=$SOLR_HOME/../logs
+  LOG4J_CONFIG="-Dlog4j.configuration=file:$LOG4J_PROPS"
 fi
 
 if [ "$SCRIPT_CMD" == "stop" ]; then
@@ -920,14 +930,7 @@ if [ "$SCRIPT_CMD" == "stop" ]; then
   exit 0
 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
+# NOTE: If the script gets to here, then it is starting up a Solr node.
 
 if [ ! -e "$SOLR_HOME" ]; then
   echo -e "\nSolr home directory $SOLR_HOME not found!\n"
@@ -938,9 +941,24 @@ if [ ! -e "$SOLR_HOME/solr.xml" ]; then
   exit 1
 fi
 
+# backup the log files before starting
+if [ -f $SOLR_LOGS_DIR/solr.log ]; then
+  if $verbose ; then
+    echo "Backing up $SOLR_LOGS_DIR/solr.log"
+  fi
+  mv $SOLR_LOGS_DIR/solr.log $SOLR_LOGS_DIR/solr_log_`date +"%Y%m%d_%H%M"`
+fi
+
+if [ -f $SOLR_LOGS_DIR/solr_gc.log ]; then
+  if $verbose ; then
+    echo "Backing up $SOLR_LOGS_DIR/solr_gc.log"
+  fi
+  mv $SOLR_LOGS_DIR/solr_gc.log $SOLR_LOGS_DIR/solr_gc_log_`date +"%Y%m%d_%H%M"`
+fi
+
 # if verbose gc logging enabled, setup the location of the log file
 if [ "$GC_LOG_OPTS" != "" ]; then
-  GC_LOG_OPTS="$GC_LOG_OPTS -Xloggc:$SOLR_SERVER_DIR/logs/solr_gc.log"
+  GC_LOG_OPTS="$GC_LOG_OPTS -Xloggc:$SOLR_LOGS_DIR/solr_gc.log"
 fi
 
 if [ "$SOLR_MODE" == "solrcloud" ]; then
@@ -1068,21 +1086,21 @@ $SOLR_HOST_ARG -Djetty.port=$SOLR_PORT \
 -Dsolr.solr.home=$SOLR_HOME \
 -Dsolr.install.dir=$SOLR_TIP \
 -Duser.timezone=$SOLR_TIMEZONE \
--Djava.net.preferIPv4Stack=true \
+-Djava.net.preferIPv4Stack=true $LOG4J_CONFIG \
 $SOLR_OPTS"
   
   if [ "$SOLR_MODE" == "solrcloud" ]; then
     IN_CLOUD_MODE=" in SolrCloud mode"
   fi
 
-  mkdir -p $SOLR_SERVER_DIR/logs
+  mkdir -p $SOLR_LOGS_DIR
 
   if [ "$run_in_foreground" == "true" ]; then
     echo -e "\nStarting Solr$IN_CLOUD_MODE on port $SOLR_PORT from $SOLR_SERVER_DIR\n"
     $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_SERVER_DIR/logs/solr-$SOLR_PORT-console.log 2>&1 & echo $! > $SOLR_TIP/bin/solr-$SOLR_PORT.pid
+    nohup $JAVA $SOLR_START_OPTS $SOLR_ADDL_ARGS -XX:OnOutOfMemoryError="$SOLR_TIP/bin/oom_solr.sh $SOLR_PORT" -jar start.jar 1>$SOLR_LOGS_DIR/solr-$SOLR_PORT-console.log 2>&1 & echo $! > $SOLR_TIP/bin/solr-$SOLR_PORT.pid
   
     # no lsof on cygwin though
     if [ "$hasLsof" != "" ]; then
@@ -1098,7 +1116,7 @@ $SOLR_OPTS"
             loops=$[$loops+1]
           else
             echo -e "Still not seeing Solr listening on $SOLR_PORT after 30 seconds!"
-            tail -30 $SOLR_SERVER_DIR/logs/solr.log
+            tail -30 $SOLR_LOGS_DIR/solr.log
             exit;
           fi
         else
@@ -1140,8 +1158,8 @@ else
   #
   # SolrCloud example is a bit involved so needs special handling here
   #
-  SOLR_SERVER_DIR=$SOLR_TIP/node1
-  SOLR_HOME=$SOLR_TIP/node1/solr
+  SOLR_SERVER_DIR=$SOLR_TIP/server
+  SOLR_HOME=$SOLR_TIP/example/cloud/node1/solr
   SOLR_PORT=${CLOUD_PORTS[0]}
 
   if [ "$ZK_HOST" != "" ]; then
@@ -1157,7 +1175,7 @@ else
   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 $DASHZ $DASHM $DASHA\n\n"
+  echo -e "solr start -cloud -s $SOLR_HOME -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" "$ADDITIONAL_CMD_OPTS"
@@ -1174,9 +1192,9 @@ else
     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 $DASHM $DASHA \n\n"
+    echo -e "solr start -cloud -s $SOLR_TIP/example/cloud/node$ndx/solr -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 $DASHM $DASHA
+    $SOLR_TIP/bin/solr start -cloud -s $SOLR_TIP/example/cloud/node$ndx/solr -p $next_port -z $zk_host $DASHM $DASHA
   done
   
   # TODO: better (shorter) name??

Modified: lucene/dev/branches/branch_5x/solr/bin/solr.cmd
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/bin/solr.cmd?rev=1644801&r1=1644800&r2=1644801&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/bin/solr.cmd (original)
+++ lucene/dev/branches/branch_5x/solr/bin/solr.cmd Fri Dec 12 00:47:50 2014
@@ -33,7 +33,7 @@ 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 "%SOLR_INCLUDE%"=="" set "SOLR_INCLUDE=%SOLR_TIP%\bin\solr.in.cmd"
 IF EXIST "%SOLR_INCLUDE%" CALL "%SOLR_INCLUDE%"
 
 REM Verify Java is available
@@ -43,7 +43,6 @@ IF NOT DEFINED JAVA_HOME (
   FOR /F "skip=2 tokens=2*" %%A IN ('REG QUERY "HKLM\Software\JavaSoft\Java Runtime Environment" /v CurrentVersion') DO set CurVer=%%B
   FOR /F "skip=2 tokens=2*" %%A IN ('REG QUERY "HKLM\Software\JavaSoft\Java Runtime Environment\!CurVer!" /v JavaHome') DO (
     set JAVA_HOME=%%B
-    @echo Detected JAVA_HOME=%%B
   )
 )
 
@@ -54,12 +53,7 @@ IF ERRORLEVEL 1 "%JAVA_HOME%"\bin\java -
 IF ERRORLEVEL 1 goto need_java_vers
 set "JAVA=%JAVA_HOME%\bin\java"
 
-REM See SOLR-3619
-IF EXIST "%SOLR_TIP%\server\start.jar" (
-  set "DEFAULT_SERVER_DIR=%SOLR_TIP%\server"
-) ELSE (
-  set "DEFAULT_SERVER_DIR=%SOLR_TIP%\example"
-)
+set "DEFAULT_SERVER_DIR=%SOLR_TIP%\server"
 
 set FIRST_ARG=%1
 
@@ -177,7 +171,7 @@ goto done
 @echo.
 @echo  -k key      Stop key; default is solrrocks
 @echo.
-@echo  -p port     Specify the port to start the Solr HTTP listener on; default is 8983
+@echo  -p port     Specify the port the Solr HTTP listener is bound to
 @echo.
 @echo  -all        Find and stop all running Solr servers on this host
 @echo.
@@ -475,14 +469,22 @@ IF NOT EXIST "%SOLR_SERVER_DIR%" (
 IF "%EXAMPLE%"=="" (
   REM SOLR_HOME just becomes serverDir/solr
 ) ELSE IF "%EXAMPLE%"=="techproducts" (
-  set "SOLR_HOME=%SOLR_TIP%\server\solr"
+  mkdir "%SOLR_TIP%\example\techproducts\solr"
+  set "SOLR_HOME=%SOLR_TIP%\example\techproducts\solr"
+  IF NOT EXIST "!SOLR_HOME!\solr.xml" (
+    copy "%DEFAULT_SERVER_DIR%\solr\solr.xml" "!SOLR_HOME!\solr.xml"
+  )
 ) ELSE IF "%EXAMPLE%"=="cloud" (
   set SOLR_MODE=solrcloud
   goto cloud_example_start
 ) ELSE IF "%EXAMPLE%"=="dih" (
   set "SOLR_HOME=%SOLR_TIP%\example\example-DIH\solr"
 ) ELSE IF "%EXAMPLE%"=="schemaless" (
-  set "SOLR_HOME=%SOLR_TIP%\server\solr"
+  mkdir "%SOLR_TIP%\example\schemaless\solr"
+  set "SOLR_HOME=%SOLR_TIP%\example\schemaless\solr"
+  IF NOT EXIST "!SOLR_HOME!\solr.xml" (
+    copy "%DEFAULT_SERVER_DIR%\solr\solr.xml" "!SOLR_HOME!\solr.xml"
+  )
 ) ELSE (
   @echo.
   @echo 'Unrecognized example %EXAMPLE%!'
@@ -495,6 +497,8 @@ IF "%SOLR_HOME%"=="" set "SOLR_HOME=%SOL
 IF NOT EXIST "%SOLR_HOME%\" (
   IF EXIST "%SOLR_SERVER_DIR%\%SOLR_HOME%" (
     set "SOLR_HOME=%SOLR_SERVER_DIR%\%SOLR_HOME%"
+  ) ELSE IF EXIST "%cd%\%SOLR_HOME%" (
+    set "SOLR_HOME=%cd%\%SOLR_HOME%"
   ) ELSE (
     set SCRIPT_ERROR=Solr home directory %SOLR_HOME% not found!
     goto err
@@ -508,6 +512,17 @@ IF NOT EXIST "%SOLR_HOME%\solr.xml" (
 
 IF "%STOP_KEY%"=="" set STOP_KEY=solrrocks
 
+@REM This is quite hacky, but examples rely on a different log4j.properties
+@REM so that we can write logs for examples to %SOLR_HOME%\..\logs
+set "SOLR_LOGS_DIR=%SOLR_SERVER_DIR%\logs"
+set "EXAMPLE_DIR=%SOLR_TIP%\example"
+set LOG4J_CONFIG=
+set TMP=!SOLR_HOME:%EXAMPLE_DIR%=!
+IF NOT "%TMP%"=="%SOLR_HOME%" (
+  set "SOLR_LOGS_DIR=%SOLR_HOME%\..\logs"
+  set "LOG4J_CONFIG=file:%EXAMPLE_DIR%\resources\log4j.properties"
+)
+
 @REM stop logic here
 IF "%SCRIPT_CMD%"=="stop" (
   IF "%SOLR_PORT%"=="" (
@@ -542,20 +557,6 @@ IF "%SCRIPT_CMD%"=="stop" (
       timeout /T 5
       REM Kill it if it is still running after the graceful shutdown
       For /f "tokens=5" %%j in ('netstat -nao ^| find /i "listening" ^| find ":%SOLR_PORT%"') do (taskkill /f /PID %%j)
-
-      REM backup log files (use current timestamp for backup name)
-      For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
-      For /f "tokens=1-2 delims=/:" %%a in ("%TIME%") do (set mytime=%%a%%b)
-      set now_ts=!mydate!_!mytime!
-      IF EXIST "%SOLR_SERVER_DIR%\logs\solr.log" (
-        echo Backing up %SOLR_SERVER_DIR%\logs\solr.log
-        move /Y "%SOLR_SERVER_DIR%\logs\solr.log" "%SOLR_SERVER_DIR%\logs\solr_log_!now_ts!"
-      )
-
-      IF EXIST "%SOLR_SERVER_DIR%\logs\solr_gc.log" (
-        echo Backing up %SOLR_SERVER_DIR%\logs\solr_gc.log
-        move /Y "%SOLR_SERVER_DIR%\logs\solr_gc.log" "%SOLR_SERVER_DIR%\logs\solr_gc_log_!now_ts!"
-      )
     )
     if "!found_it!"=="0" echo No Solr found running on port %SOLR_PORT%
   )
@@ -573,8 +574,22 @@ IF "%SCRIPT_CMD%"=="start" (
   )
 )
 
+REM backup log files (use current timestamp for backup name)
+For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
+For /f "tokens=1-2 delims=/:" %%a in ("%TIME%") do (set mytime=%%a%%b)
+set now_ts=!mydate!_!mytime!
+IF EXIST "!SOLR_LOGS_DIR!\solr.log" (
+  echo Backing up !SOLR_LOGS_DIR!\solr.log
+  move /Y "!SOLR_LOGS_DIR!\solr.log" "!SOLR_LOGS_DIR!\solr_log_!now_ts!"
+)
+
+IF EXIST "!SOLR_LOGS_DIR!\solr_gc.log" (
+  echo Backing up !SOLR_LOGS_DIR!\solr_gc.log
+  move /Y "!SOLR_LOGS_DIR!\solr_gc.log" "!SOLR_LOGS_DIR!\solr_gc_log_!now_ts!"
+)
+
 REM if verbose gc logging enabled, setup the location of the log file
-IF NOT "%GC_LOG_OPTS%"=="" set GC_LOG_OPTS=%GC_LOG_OPTS% -Xloggc:"%SOLR_SERVER_DIR%/logs/solr_gc.log"
+IF NOT "%GC_LOG_OPTS%"=="" set GC_LOG_OPTS=%GC_LOG_OPTS% -Xloggc:"!SOLR_LOGS_DIR!/solr_gc.log"
 
 IF "%SOLR_MODE%"=="solrcloud" (
   IF "%ZK_CLIENT_TIMEOUT%"=="" set "ZK_CLIENT_TIMEOUT=15000"
@@ -670,16 +685,17 @@ IF "%verbose%"=="1" (
 
 set START_OPTS=-Duser.timezone=%SOLR_TIMEZONE% -Djava.net.preferIPv4Stack=true
 set START_OPTS=%START_OPTS% !GC_TUNE! %GC_LOG_OPTS%
-IF NOT "!CLOUD_MODE_OPTS!"=="" set START_OPTS=%START_OPTS% !CLOUD_MODE_OPTS!
-IF NOT "%REMOTE_JMX_OPTS%"=="" set START_OPTS=%START_OPTS% %REMOTE_JMX_OPTS%
-IF NOT "%SOLR_ADDL_ARGS%"=="" set START_OPTS=%START_OPTS% %SOLR_ADDL_ARGS%
-IF NOT "%SOLR_HOST_ARG%"=="" set START_OPTS=%START_OPTS% %SOLR_HOST_ARG%
-IF NOT "%SOLR_OPTS%"=="" set START_OPTS=%START_OPTS% %SOLR_OPTS%
+IF NOT "!CLOUD_MODE_OPTS!"=="" set "START_OPTS=%START_OPTS% !CLOUD_MODE_OPTS!"
+IF NOT "%REMOTE_JMX_OPTS%"=="" set "START_OPTS=%START_OPTS% %REMOTE_JMX_OPTS%"
+IF NOT "%SOLR_ADDL_ARGS%"=="" set "START_OPTS=%START_OPTS% %SOLR_ADDL_ARGS%"
+IF NOT "%SOLR_HOST_ARG%"=="" set "START_OPTS=%START_OPTS% %SOLR_HOST_ARG%"
+IF NOT "%SOLR_OPTS%"=="" set "START_OPTS=%START_OPTS% %SOLR_OPTS%"
+IF NOT "%LOG4J_CONFIG%"=="" set "START_OPTS=%START_OPTS% -Dlog4j.configuration=%LOG4J_CONFIG%"
 
 cd "%SOLR_SERVER_DIR%"
 
-IF NOT EXIST "%SOLR_SERVER_DIR%\logs" (
-  mkdir "%SOLR_SERVER_DIR%\logs"
+IF NOT EXIST "!SOLR_LOGS_DIR!" (
+  mkdir "!SOLR_LOGS_DIR!"
 )
 
 @echo.
@@ -692,8 +708,8 @@ IF "%FG%"=="1" (
   "%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%" -Dsolr.install.dir="%SOLR_TIP%" -jar start.jar
 ) ELSE (
-  START "Solr-%SOLR_PORT%" "%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%" -Dsolr.install.dir="%SOLR_TIP%" -jar start.jar > "%SOLR_SERVER_DIR%\logs\solr-%SOLR_PORT%-console.log"
+  START /B "Solr-%SOLR_PORT%" "%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%" -Dsolr.install.dir="%SOLR_TIP%" -jar start.jar > "!SOLR_LOGS_DIR!\solr-%SOLR_PORT%-console.log"
   echo %SOLR_PORT%>%SOLR_TIP%\bin\solr-%SOLR_PORT%.port
 )
 
@@ -769,26 +785,17 @@ IF NOT DEFINED CLOUD_NUM_NODES (
 
 :start_cloud_nodes
 
-@echo Cloning %DEFAULT_SERVER_DIR% into %SOLR_TIP%\node1
-mkdir "%SOLR_TIP%\node1"
-xcopy /Q /E /I "%DEFAULT_SERVER_DIR%\contexts" "%SOLR_TIP%\node1\contexts"
-xcopy /Q /E /I "%DEFAULT_SERVER_DIR%\etc" "%SOLR_TIP%\node1\etc"
-xcopy /Q /E /I "%DEFAULT_SERVER_DIR%\lib" "%SOLR_TIP%\node1\lib"
-xcopy /Q /E /I "%DEFAULT_SERVER_DIR%\resources" "%SOLR_TIP%\node1\resources"
-xcopy /Q /E /I "%DEFAULT_SERVER_DIR%\scripts" "%SOLR_TIP%\node1\scripts"
-xcopy /Q /E /I "%DEFAULT_SERVER_DIR%\webapps" "%SOLR_TIP%\node1\webapps"
-copy "%DEFAULT_SERVER_DIR%\start.jar" "%SOLR_TIP%\node1\start.jar"
-mkdir "%SOLR_TIP%\node1\solr-webapp"
-mkdir "%SOLR_TIP%\node1\solr"
-mkdir "%SOLR_TIP%\node1\logs"
-xcopy /Q /E /I "%DEFAULT_SERVER_DIR%\solr\configsets" "%SOLR_TIP%\node1\solr\configsets"
-copy "%DEFAULT_SERVER_DIR%\solr\solr.xml" "%SOLR_TIP%\node1\solr\solr.xml"
-copy "%DEFAULT_SERVER_DIR%\solr\zoo.cfg" "%SOLR_TIP%\node1\solr\zoo.cfg"
+set "CLOUD_EXAMPLE_DIR=%SOLR_TIP%\example\cloud"
+
+@echo Creating Solr home %CLOUD_EXAMPLE_DIR%\node1\solr
+mkdir "%CLOUD_EXAMPLE_DIR%\node1\solr"
+copy "%DEFAULT_SERVER_DIR%\solr\solr.xml" "%CLOUD_EXAMPLE_DIR%\node1\solr\solr.xml"
+copy "%DEFAULT_SERVER_DIR%\solr\zoo.cfg" "%CLOUD_EXAMPLE_DIR%\node1\solr\zoo.cfg"
 
 for /l %%x in (2, 1, !CLOUD_NUM_NODES!) do (
   IF NOT EXIST "%SOLR_TIP%\node%%x" (
-    @echo Cloning %SOLR_TIP%\node1 into %SOLR_TIP%\node%%x
-    xcopy /Q /E /I "%SOLR_TIP%\node1" "%SOLR_TIP%\node%%x"
+    @echo Cloning %CLOUD_EXAMPLE_DIR%\node1 into %CLOUD_EXAMPLE_DIR%\node%%x
+    xcopy /Q /E /I "%CLOUD_EXAMPLE_DIR%\node1" "%CLOUD_EXAMPLE_DIR%\node%%x"
   )
 )
 
@@ -832,8 +839,8 @@ for /l %%x in (1, 1, !CLOUD_NUM_NODES!)
       set "DASHZ="
     )
     @echo Starting node1 on port !NODE_PORT! using command:
-    @echo solr -cloud -p !NODE_PORT! -d node1 !DASHZ! !DASHM!
-    START "Solr-!NODE_PORT!" "%SDIR%\solr" -f -cloud -p !NODE_PORT! -d node1 !DASHZ! !DASHM!
+    @echo solr -cloud -p !NODE_PORT! !DASHZ! !DASHM! -s %CLOUD_EXAMPLE_DIR%\node1\solr
+    START "Solr-!NODE_PORT!" "%SDIR%\solr" -f -cloud -p !NODE_PORT! !DASHZ! !DASHM! -s %CLOUD_EXAMPLE_DIR%\node1\solr
     set NODE1_PORT=!NODE_PORT!
     echo !NODE_PORT!>%SOLR_TIP%\bin\solr-!NODE_PORT!.port
   ) ELSE (
@@ -842,8 +849,8 @@ for /l %%x in (1, 1, !CLOUD_NUM_NODES!)
       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 "Solr-!NODE_PORT!" "%SDIR%\solr" -f -cloud -p !NODE_PORT! -d node%%x -z !ZK_HOST! !DASHM!
+    @echo solr -cloud -p !NODE_PORT! -z !ZK_HOST! !DASHM! -s %CLOUD_EXAMPLE_DIR%\node%%x\solr
+    START "Solr-!NODE_PORT!" "%SDIR%\solr" -f -cloud -p !NODE_PORT! -z !ZK_HOST! !DASHM! -s %CLOUD_EXAMPLE_DIR%\node%%x\solr
     echo !NODE_PORT!>%SOLR_TIP%\bin\solr-!NODE_PORT!.port
   )
 
@@ -1003,7 +1010,7 @@ goto parse_create_args
 
 :run_create
 IF "!CREATE_NAME!"=="" (
-  set "SCRIPT_ERROR=Name (-n) is a required parameter for $SCRIPT_CMD"
+  set "SCRIPT_ERROR=Name (-n) is a required parameter for %SCRIPT_CMD%"
   goto invalid_cmd_line
 )
 IF "!CREATE_CONFIGSET!"=="" set CREATE_CONFIGSET=data_driven_schema_configs

Modified: lucene/dev/branches/branch_5x/solr/server/resources/log4j.properties
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/server/resources/log4j.properties?rev=1644801&r1=1644800&r2=1644801&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/server/resources/log4j.properties (original)
+++ lucene/dev/branches/branch_5x/solr/server/resources/log4j.properties Fri Dec 12 00:47:50 2014
@@ -1,5 +1,5 @@
 #  Logging level
-solr.log=logs/
+solr.log=logs
 log4j.rootLogger=INFO, file, CONSOLE
 
 log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender