lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nikola Garafolic <nikola.garafo...@srce.hr>
Subject Re: solr init.d script
Date Tue, 09 Nov 2010 08:06:17 GMT
Sorry, forgot to mention, Centos.
Thanks.

I have very similar script to this Centos one and I am missing status 
portion of the script.

On 11/09/2010 08:47 AM, Eric Martin wrote:
> Er, what flavor?
>
> RHEL / CentOS
>
> #!/bin/sh
>
> # Starts, stops, and restarts Apache Solr.
> #
> # chkconfig: 35 92 08
> # description: Starts and stops Apache Solr
>
> SOLR_DIR="/var/solr"
> JAVA_OPTIONS="-Xmx1024m -DSTOP.PORT=8079 -DSTOP.KEY=mustard -jar start.jar"
> LOG_FILE="/var/log/solr.log"
> JAVA="/usr/bin/java"
>
> case $1 in
>      start)
>          echo "Starting Solr"
>          cd $SOLR_DIR
>          $JAVA $JAVA_OPTIONS 2>  $LOG_FILE&
>          ;;
>      stop)
>          echo "Stopping Solr"
>          cd $SOLR_DIR
>          $JAVA $JAVA_OPTIONS --stop
>          ;;
>      restart)
>          $0 stop
>          sleep 1
>          $0 start
>          ;;
>      *)
>          echo "Usage: $0 {start|stop|restart}">&2
>          exit 1
>          ;;
> esac
>
> ________________________________
>
>
> Debian
>
> http://xdeb.org/node/1213
>
> ______________________
>
> Ubuntu
>
> STEPS
> Type in the following command in TERMINAL to install nano text editor.
> sudo apt-get install nano
> Type in the following command in TERMINAL to add a new script.
> sudo nano /etc/init.d/solr
> TERMINAL will display a new page title "GNU nano 2.0.x".
> Paste the below script in this TERMINAL window.
> #!/bin/sh -e
>
> # Starts, stops, and restarts solr
>
> SOLR_DIR="/apache-solr-1.4.0/example"
> JAVA_OPTIONS="-Xmx1024m -DSTOP.PORT=8079 -DSTOP.KEY=stopkey -jar start.jar"
> LOG_FILE="/var/log/solr.log"
> JAVA="/usr/bin/java"
>
> case $1 in
>      start)
>          echo "Starting Solr"
>          cd $SOLR_DIR
>          $JAVA $JAVA_OPTIONS 2>  $LOG_FILE&
>          ;;
>      stop)
>          echo "Stopping Solr"
>          cd $SOLR_DIR
>          $JAVA $JAVA_OPTIONS --stop
>          ;;
>      restart)
>          $0 stop
>          sleep 1
>          $0 start
>          ;;
>      *)
>          echo "Usage: $0 {start|stop|restart}">&2
>          exit 1
>          ;;
> esac
> Note: In above script you might have to replace /apache-solr-1.4.0/example
> with appropriate directory name.
> Press CTRL-X keys.
> Type in Y
> When ask File Name to Write press ENTER key.
> You're now back to TERMINAL command line.
>
> Type in the following command in TERMINAL to create all the links to the
> script.
> sudo update-rc.d solr defaults
> Type in the following command in TERMINAL to make the script executable.
> sudo chmod a+rx /etc/init.d/solr
> To test. Reboot your Ubuntu Server.
> Wait until Ubuntu Server reboot is completed.
> Wait 2 minutes for Apache Solr to startup.
> Using your internet browser go to your website and try a Solr search.
>
>
>
> -----Original Message-----
> From: Nikola Garafolic [mailto:nikola.garafolic@srce.hr]
> Sent: Monday, November 08, 2010 11:42 PM
> To: solr-user@lucene.apache.org
> Subject: solr init.d script
>
> Hi,
>
> Does anyone have some kind of init.d script for solr, that can start,
> stop and check solr status?
>


-- 
Nikola Garafolic
SRCE, Sveucilisni racunski centar
tel: +385 1 6165 804
email: nikola.garafolic@srce.hr

Mime
View raw message