mirror of
https://github.com/apache/lucene.git
synced 2025-02-12 21:15:19 +00:00
SOLR-6447: bin/solr should pass -DnumShards=1 for bootstrapping collection1 when starting in cloud mode
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1622733 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f15d6e2b21
commit
49c6a4a0bf
@ -173,6 +173,9 @@ Bug Fixes
|
|||||||
* SOLR-5814: CoreContainer reports incorrect & missleading path for solrconfig.xml
|
* SOLR-5814: CoreContainer reports incorrect & missleading path for solrconfig.xml
|
||||||
when there are loading problems (Pradeep via hossman)
|
when there are loading problems (Pradeep via hossman)
|
||||||
|
|
||||||
|
* SOLR-6447: bin/solr script needs to pass -DnumShards=1 for boostrapping collection1
|
||||||
|
when starting Solr in cloud mode. (Timothy Potter)
|
||||||
|
|
||||||
Other Changes
|
Other Changes
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
|
@ -47,6 +47,8 @@
|
|||||||
SOLR_SCRIPT="$0"
|
SOLR_SCRIPT="$0"
|
||||||
verbose=false
|
verbose=false
|
||||||
THIS_OS=`uname -s`
|
THIS_OS=`uname -s`
|
||||||
|
hasLsof=$(which lsof)
|
||||||
|
|
||||||
# for now, we don't support running this script from cygwin due to problems
|
# 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
|
# like not having lsof, ps waux, curl, and awkward directory handling
|
||||||
if [ "${THIS_OS:0:6}" == "CYGWIN" ]; then
|
if [ "${THIS_OS:0:6}" == "CYGWIN" ]; then
|
||||||
@ -251,7 +253,8 @@ function stop_solr() {
|
|||||||
if [ "$SOLR_PID" != "" ]; then
|
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."
|
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
|
$JAVA -jar $DIR/start.jar STOP.PORT=$STOP_PORT STOP.KEY=$STOP_KEY --stop || true
|
||||||
sleep 5
|
(sleep 5) &
|
||||||
|
spinner $!
|
||||||
else
|
else
|
||||||
echo -e "No Solr nodes found to stop."
|
echo -e "No Solr nodes found to stop."
|
||||||
exit 0
|
exit 0
|
||||||
@ -543,6 +546,7 @@ if [ "$EXAMPLE" != "" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# check to see if something is already bound to that port
|
# check to see if something is already bound to that port
|
||||||
|
if [ "$hasLsof" != "" ]; then
|
||||||
PORT_IN_USE=`lsof -i:$CLOUD_PORT | grep $CLOUD_PORT`
|
PORT_IN_USE=`lsof -i:$CLOUD_PORT | grep $CLOUD_PORT`
|
||||||
if [ "$PORT_IN_USE" != "" ]; then
|
if [ "$PORT_IN_USE" != "" ]; then
|
||||||
read -e -p "Oops! Looks like port $CLOUD_PORT is already being used by another process. Please choose a different port. " USER_INPUT
|
read -e -p "Oops! Looks like port $CLOUD_PORT is already being used by another process. Please choose a different port. " USER_INPUT
|
||||||
@ -551,6 +555,11 @@ if [ "$EXAMPLE" != "" ]; then
|
|||||||
echo $CLOUD_PORT
|
echo $CLOUD_PORT
|
||||||
break;
|
break;
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
CLOUD_PORTS[$s]=$CLOUD_PORT
|
||||||
|
echo $CLOUD_PORT
|
||||||
|
break;
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
@ -683,7 +692,7 @@ if [ "$SOLR_MODE" == "solrcloud" ]; then
|
|||||||
|
|
||||||
# and if collection1 needs to be bootstrapped
|
# and if collection1 needs to be bootstrapped
|
||||||
if [ -e "$SOLR_HOME/collection1/core.properties" ]; then
|
if [ -e "$SOLR_HOME/collection1/core.properties" ]; then
|
||||||
CLOUD_MODE_OPTS="$CLOUD_MODE_OPTS -Dbootstrap_confdir=./solr/collection1/conf -Dcollection.configName=myconf"
|
CLOUD_MODE_OPTS="$CLOUD_MODE_OPTS -Dbootstrap_confdir=./solr/collection1/conf -Dcollection.configName=myconf -DnumShards=1"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -774,6 +783,7 @@ $SOLR_HOST_ARG -Djetty.port=$SOLR_PORT \
|
|||||||
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_TIP/bin/solr-$SOLR_PORT-console.log 2>&1 &
|
||||||
|
|
||||||
# no lsof on cygwin though
|
# no lsof on cygwin though
|
||||||
|
if [ "$hasLsof" != "" ]; then
|
||||||
echo -n "Waiting to see Solr listening on port $SOLR_PORT"
|
echo -n "Waiting to see Solr listening on port $SOLR_PORT"
|
||||||
# Launch in a subshell to show the spinner
|
# Launch in a subshell to show the spinner
|
||||||
(loops=0
|
(loops=0
|
||||||
@ -796,6 +806,11 @@ $SOLR_HOST_ARG -Djetty.port=$SOLR_PORT \
|
|||||||
fi
|
fi
|
||||||
done) &
|
done) &
|
||||||
spinner $!
|
spinner $!
|
||||||
|
else
|
||||||
|
SOLR_PID=`ps waux | grep start.jar | grep $SOLR_PORT | grep -v grep | awk '{print $2}' | sort -r`
|
||||||
|
echo -e "\nStarted Solr server on port $SOLR_PORT (pid=$SOLR_PID). Happy searching!\n"
|
||||||
|
exit;
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -403,7 +403,7 @@ 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"
|
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=
|
||||||
|
Loading…
x
Reference in New Issue
Block a user