SOLR-6509: Solr start scripts interactive mode doesn't honor -z argument

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1626847 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy Potter 2014-09-22 17:23:14 +00:00
parent 5703c00949
commit 4e7cc1a695
3 changed files with 37 additions and 16 deletions

View File

@ -192,6 +192,8 @@ Bug Fixes
* SOLR-6484: SolrCLI's healthcheck action needs to check live nodes as part of reporting * SOLR-6484: SolrCLI's healthcheck action needs to check live nodes as part of reporting
the status of a replica (Timothy Potter) the status of a replica (Timothy Potter)
* SOLR-6509: Solr start scripts interactive mode doesn't honor -z argument (Timothy Potter)
Other Changes Other Changes
---------------------- ----------------------

View File

@ -698,11 +698,11 @@ if [ "$SOLR_MODE" == "solrcloud" ]; then
fi fi
CLOUD_MODE_OPTS="$CLOUD_MODE_OPTS -DzkRun" CLOUD_MODE_OPTS="$CLOUD_MODE_OPTS -DzkRun"
fi
# and if collection1 needs to be bootstrapped
if [ -e "$SOLR_HOME/collection1/core.properties" ]; then # and if collection1 needs to be bootstrapped
CLOUD_MODE_OPTS="$CLOUD_MODE_OPTS -Dbootstrap_confdir=./solr/collection1/conf -Dcollection.configName=myconf -DnumShards=1" if [ -e "$SOLR_HOME/collection1/core.properties" ]; then
fi CLOUD_MODE_OPTS="$CLOUD_MODE_OPTS -Dbootstrap_confdir=./solr/collection1/conf -Dcollection.configName=myconf -DnumShards=1"
fi fi
fi fi
@ -832,14 +832,22 @@ else
SOLR_SERVER_DIR=$SOLR_TIP/node1 SOLR_SERVER_DIR=$SOLR_TIP/node1
SOLR_HOME=$SOLR_TIP/node1/solr SOLR_HOME=$SOLR_TIP/node1/solr
SOLR_PORT=${CLOUD_PORTS[0]} 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 "\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 # can't launch this node in the foreground else we can't run anymore commands
launch_solr "false" "$ADDITIONAL_CMD_OPTS" launch_solr "false" ""
zk_port=$[$SOLR_PORT+1000] # if user did not define a specific -z parameter, assume embedded in first cloud node we launched above
zk_host=localhost:$zk_port 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++ )) for (( s=1; s<$CLOUD_NUM_NODES; s++ ))
do do

View File

@ -418,8 +418,8 @@ IF "%SOLR_MODE%"=="solrcloud" (
) ELSE ( ) ELSE (
IF "%verbose%"=="1" echo Configuring SolrCloud to launch an embedded ZooKeeper using -DzkRun IF "%verbose%"=="1" echo Configuring SolrCloud to launch an embedded ZooKeeper using -DzkRun
set "CLOUD_MODE_OPTS=!CLOUD_MODE_OPTS! -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 ( ) ELSE (
set CLOUD_MODE_OPTS= set CLOUD_MODE_OPTS=
) )
@ -541,15 +541,26 @@ for /l %%x in (1, 1, !CLOUD_NUM_NODES!) do (
@echo Cloning %DEFAULT_SERVER_DIR% into %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" xcopy /Q /E /I "%DEFAULT_SERVER_DIR%" "%SOLR_TIP%\node%%x"
) )
IF %%x EQU 1 ( IF %%x EQU 1 (
set EXAMPLE= 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! set NODE1_PORT=!NODE_PORT!
) ELSE ( ) ELSE (
set /A ZK_PORT=!NODE1_PORT!+1000 IF "!ZK_HOST!"=="" (
set "ZK_HOST=localhost:!ZK_PORT!" set /A ZK_PORT=!NODE1_PORT!+1000
START "" "%SDIR%\solr" -f -c -p !NODE_PORT! -d node%%x -z !ZK_HOST! 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 timeout /T 10