Run Solr as a Windows Service

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:

  1. 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.

  2. Download and install AlwaysUp, if necessary.

  3. Start AlwaysUp.

  4. Select Application > Add to open the Add Application window:

    Add Application

  5. 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:

      C:\Program Files\Java\jre7\bin\java.exe

    • 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:

      -jar C:\Solr\example\start.jar
      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:

      C:\Solr\example

    • 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.

    Solr Windows Service: General Tab

  6. 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.

    Solr Windows Service: Startup Tab

  7. 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.

    Solr Windows Service: Created

  8. 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:

    Solr Windows Service: Running

    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).

  9. 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!

Download & Try it Free!

Download AlwaysUp and Run as a Service Today! Version 9.7

4.6 MB Installer
  • Unrestricted 30-day trial for new users; upgrade for existing users
  • Windows 10/8.1/8/7/XP & Windows Server 2012 R2/2008/2003
  • How to Install | EULA
Our customers include...


Compatible with Windows 10 (32 & 64-bit)

Windows Server 2012 Certified (32 & 64-bit)

Windows 8 Compatible (32 & 64-bit)

Compatible with Windows 7 (32 & 64-bit)

Works with Windows Server 2008 R2 (32 & 64-bit)



Over 68,000 installations, and counting!
 
AlwaysUp is number 1! Run as a Service with AlwaysUp

Rock-solid for the past 10+ years!