Created
July 16, 2012 01:16
-
-
Save ygpark2/3119630 to your computer and use it in GitHub Desktop.
solr for second server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
# Must be a valid filename | |
NAME=apache-solr | |
VERSION=4.0.0-ALPHA | |
APPNAME=joko | |
APPDIR=/home/joinus/$NAME-$VERSION/$APPNAME | |
PIDFILE=/var/run/solr.pid | |
#This is the command to be run, give the full pathname | |
DAEMON="/usr/bin/java" | |
#create a config yml with daemonization options in it - and the same PIDFILE path as above | |
DAEMON_OPTS="-Djetty.port=7574 -DzkHost=localhost:9983 -jar start.jar" | |
USER=www-data | |
LOGFILE=/var/log/solr/output.log | |
# below is our java opts, for a 8 gig ram, xeon quadcore machine, you might want to change this | |
# export JAVA_OPTS="-server -Xmx2500m -Xms2500m -XX:PermSize=512m -XX:MaxPermSize=512m -XX:NewRatio=2 -XX:+DisableExplicitGC -Dhk2.file.directory.changeIntervalTimer=6000 -Xss2048k -XX:ParallelGCThreads=4 -XX:+AggressiveHeap" | |
# export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" | |
case "$1" in | |
start) | |
echo -n "Starting daemon: "$NAME | |
start-stop-daemon --background --start --chdir $APPDIR --quiet --chuid $USER --make-pidfile --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS >> "$LOGFILE" | |
echo "." | |
;; | |
stop) | |
echo -n "Stopping daemon: "$NAME | |
start-stop-daemon --stop --chdir $APPDIR --quiet --chuid $USER --oknodo --pidfile $PIDFILE | |
echo "." | |
;; | |
restart) | |
echo -n "Restarting daemon: "$NAME | |
start-stop-daemon --stop --chdir $APPDIR --quiet --chuid $USER --oknodo --pidfile $PIDFILE | |
start-stop-daemon --background --start --chdir $APPDIR --quiet --chuid $USER --make-pidfile --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS >> "$LOGFILE" | |
echo "." | |
;; | |
*) | |
echo "Usage: "$1" {start|stop|restart}" | |
exit 1 | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment