How to Run Apache Solr V4 (+Jetty) as a Windows Service with AlwaysUp
Automatically start Solr (version 4 and earlier) when your server boots and keep it running 24/7 in the background. Survive accidental shutdowns and other failures!
Apache Solr is an java based enterprise search platform from the Apache Lucene project.
In this tutorial, we'll set up the
example schema distributed with Solr,
which includes a small installation of the
Jetty application server.
Note from the Solr documentation
"Beginning with Solr 5.0, support for deploying Solr as a WAR in standalone servlet containers like Jetty is no longer supported."
This tutorial applies to Solr version 4 and earlier which distribute Jetty.
Please see our tutorial for Solr 5 and later
to setup the newer "standalone" versions of Solr that incorporate Jetty internally.
To configure Solr with AlwaysUp 8.5 and later:
Download and install Solr, if necessary.
We have expanded the zip file and moved its contents to C:\Solr so we will use that folder in the steps below.
Download and install AlwaysUp, if necessary.
Select Application > Add to open the Add Application window:
Now we need to run the start.jar file found in Solr's example directory. On the General tab:
In the Application field, enter the full path to the java executable, java.exe.
If you installed Java in the default location, this will be:
In the Arguments field, specify the parameters to the java executable.
Since all we want to do is run the example distribution's start.jar file, this is:
Be sure to use quotes around your JAR file name if it contains spaces!
In the Start in directory field, we have entered the example directory because the start.jar file won't operate properly unless it is run from that folder:
In the Name field, enter the name that you will call the application in AlwaysUp.
We have specified Solr but you can specify another name if you like.
Click over to the Startup tab and check the Ensure that the Windows Networking components have started box.
This informs AlwaysUp that Solr/Jetty needs TCP/IP networking support to do its work.
Click the Save >> button. In a couple of seconds, an application called Solr will show up in the AlwaysUp window.
It is not yet running though.
To start Solr from AlwaysUp, choose Application > Start "Solr". In a couple of seconds, the status will change to Running
and you will be able to access Solr from port 8983 in your web browser:
Note that on Windows 8/7/Vista and Server 2012/2008, Solr will not be visible on your desktop. It will be running in the background on the
isolated Session 0.
Select Tools > Switch to Session 0 to visit Jetty's CMD window on Session 0 (may be useful when debugging).
That's it! Next time your computer boots, Solr will start up immediately, in Session 0, without anyone needing to log on. Please restart your server now and test that Solr works as expected after Windows resumes.
And please feel free to edit Solr in AlwaysUp to check out the many other settings that may be appropriate for your environment.
For example, boost Solr's priority to give it more resources on the server, send email alerts if it stops, etc.
Solr not working properly as a Windows Service?
From AlwaysUp, select Application > Report Activity > Today... to bring up a HTML report detailing the interaction between AlwaysUp and Solr.
The AlwaysUp Event Log Messages page explains the more obscure messages.
- Consult the AlwaysUp FAQ for answers to commonly asked questions and troubleshooting tips.
- Contact us and we will be happy to help!
Over 73,000 installations, and counting!
Rock-solid for the past 12+ years!
Fully Compatible with 100+ Applications...