Mitch Pronschinske is a Senior Content Analyst at DZone. That means he writes and searches for the finest developer content in the land so that you don't have to. He often eats peanut butter and bananas, likes to make his own ringtones, enjoys card and board games, and is married to an underwear model. Mitch is a DZone Zone Leader and has posted 2573 posts at DZone. You can read more from them at their website. View Full User Profile

Run Solr as a Service on Linux in Just a Few Mintues

08.13.2011
| 9044 views |
  • submit to reddit
I found a short and sweet blog tutorial by Lucene/Solr committer Mark Millar this morning.   It shows you how to install Solr as a service on Linux in less than 300 words (and just a few small code snippets).  The example uses Ubuntu 11.04.

Logging

 

By default, Solr logs to STD ERROR. You likely want to add a log configuration file to have the most control over how Solr logs – see http://wiki.apache.org/solr/LoggingInDefaultJettySetup. To be lazy though (and perhaps safe), let’s make sure STD OUT and STD ERR are nicely logged for us by runit.

This method just logs STD OUT, so lets first edit our Solr run script to redirect STD ERR to STD OUT

 

 

Now create a new directory called log in the /etc/sv/solr service directory. Inside this, create another script called run. This script will start the log service, run it under the user mark, and put the log files in the log directory we just made (we use . for the current working directory).



You can find the full tutorial on Lucid Imagination's blog.  Just click through the References box link.
References
Reference: http://www.lucidimagination.com/blog/2011/08/10/running-solr-as-a-service-on-linux/