lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thelabd...@apache.org
Subject svn commit: r1626847 - in /lucene/dev/trunk/solr: CHANGES.txt bin/solr bin/solr.cmd
Date Mon, 22 Sep 2014 17:23:14 GMT
Author: thelabdude
Date: Mon Sep 22 17:23:14 2014
New Revision: 1626847

URL: http://svn.apache.org/r1626847
Log:
SOLR-6509: Solr start scripts interactive mode doesn't honor -z argument

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/bin/solr
    lucene/dev/trunk/solr/bin/solr.cmd

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1626847&r1=1626846&r2=1626847&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Mon Sep 22 17:23:14 2014
@@ -192,6 +192,8 @@ Bug Fixes
 * SOLR-6484: SolrCLI's healthcheck action needs to check live nodes as part of reporting
   the status of a replica (Timothy Potter)
 
+* SOLR-6509: Solr start scripts interactive mode doesn't honor -z argument (Timothy Potter)
+
 
 Other Changes
 ----------------------

Modified: lucene/dev/trunk/solr/bin/solr
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/bin/solr?rev=1626847&r1=1626846&r2=1626847&view=diff
==============================================================================
--- lucene/dev/trunk/solr/bin/solr (original)
+++ lucene/dev/trunk/solr/bin/solr Mon Sep 22 17:23:14 2014
@@ -698,11 +698,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
@@ -832,14 +832,22 @@ 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
+
   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\n\n"
     
   # can't launch this node in the foreground else we can't run anymore commands
-  launch_solr "false" "$ADDITIONAL_CMD_OPTS"
-  
-  zk_port=$[$SOLR_PORT+1000]  
-  zk_host=localhost:$zk_port
+  launch_solr "false" ""
+
+  # 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

Modified: lucene/dev/trunk/solr/bin/solr.cmd
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/bin/solr.cmd?rev=1626847&r1=1626846&r2=1626847&view=diff
==============================================================================
--- lucene/dev/trunk/solr/bin/solr.cmd (original)
+++ lucene/dev/trunk/solr/bin/solr.cmd Mon Sep 22 17:23:14 2014
@@ -418,8 +418,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=
 )
@@ -541,15 +541,26 @@ for /l %%x in (1, 1, !CLOUD_NUM_NODES!) 
     @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 (
     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!
+    START "" "%SDIR%\solr" -f -cloud -p !NODE_PORT! -d node1 !DASHZ!
     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!
+    START "" "%SDIR%\solr" -f -cloud -p !NODE_PORT! -d node%%x -z !ZK_HOST!
   )
 
   timeout /T 10



Mime
View raw message