# start/stop/restart the jetty service for solr JAVA=$(which java) ROOT=$(dirname $0) TIMEOUT=30 JPORT=38983 STOP=38984 STOPKEY=stopkey if type netcat 2> /dev/null 1> /dev/null; then NETCAT=$(which netcat) elif type nc 2> /dev/null 1> /dev/null; then NETCAT=$(which nc) fi tryOnce() { ${NETCAT} -z localhost $JPORT return $? } portReachable() { # wait for 1 minute, then give up for i in $(seq 1 60); do tryOnce if [ $? -eq "0" ]; then return 0 else echo -n "." sleep 1 fi done return 1 } case "$1" in start) echo -n "Starting solr: " $JAVA -Xmx1G -Dsolr.solr.home=$ROOT/solr -Djetty.home=$ROOT -Djetty.port=$JPORT -DSTOP.PORT=$STOP -DSTOP.KEY=$STOPKEY -jar $ROOT/start.jar 1> /dev/null & sleep 1 if portReachable then RETVAL=0 echo "OK" else RETVAL=1 echo "FAILED" fi ;; stop) if tryOnce ; then echo -n "Stopping solr: " $JAVA -Dsolr.solr.home=$ROOT/solr -Djetty.home=$ROOT -DSTOP.PORT=$STOP -DSTOP.KEY=$STOPKEY -jar $ROOT/start.jar --stop sleep 1 if tryOnce ; then echo FAILED else echo OK fi RETVAL=$? else echo "not running" fi ;; status) if tryOnce ; then echo "running" else echo "stopped" fi RETVAL=$? ;; restart) $0 stop $0 start RETVAL=$? ;; *) echo "Usage: solr-control.sh {start|stop|status|restart}" exit 1 esac exit $RETVAL
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 8501 | Doug Scheirer |
* updating to gradlew for build * make (more) Mac compatible build process * default port for default install is now 8088 * updated API doc to include the queryRaw param on POSTs * minor bug fixes for when the p4d connection drops while indexing |
||
#1 | 8476 | Doug Scheirer | p4-search copy from //depot/main/p4-search |