Keep Elasticsearch running 24/7 with Service Protector

How to Keep Elasticsearch Running 24/7 with Service Protector

Automatically restart the Elasticsearch Windows Service if it crashes or is accidentally shut down. Ensure that your search engine is always available, with zero downtime.

Elasticsearch is an open-source, distributed, real-time search and analytics engine written in Java. Version 0.9.5 and later can be installed as a Windows Service:


To keep Elasticsearch running with Service Protector:

  1. Download and install Service Protector, if necessary.

  2. Start Service Protector.

  3. Select Protector > Add to open the Add Protector window:

    Add Protector

  4. On the General tab, select the Elasticsearch service from the Service to protect pull-down list. Since we have installed Elasticsearch 1.1.0 on our 64-bit Windows Server 2012 machine, this is called

    Elasticsearch 1.1.0 (elasticsearch-service-x64)
    Your service should be named similarly, and you will notice a green circle on the left if the service is already running.

    Elasticsearch Windows Service: General Tab

  5. Click the Save >> button. In a couple of seconds, an entry for Elasticsearch will show up in the Service Protector window. Elasticsearch is probably already running but it is not yet being protected by Service Protector (as shown below).

    Elasticsearch Windows Service: Created

  6. To start protection, choose Protector > Start "Elasticsearch 1.1.0 (elasticsearch-service-x64)" (or click on the third toolbar button). The shield icon will go to green to indicate that Elasticsearch is being monitored and protected by Service Protector.

    Click on the green shield to bring up a popup indicating when protection started. (You can also click on the green circle to see information on the service itself.)

    Elasticsearch Windows Service: Running

  7. That's it! Next time your computer boots, Elasticsearch will start and Service Protector will begin monitoring the service to promptly restart it if it fails, crashes or stops for any reason.

    We encourage you to edit your Elasticsearch entry in Service Protector and review the many other settings that could help in your environment. For example, send an email when the service fails, restart Elasticsearch regularly to keep the service responsive, and much more.



Trouble protecting the Elasticsearch Windows Service?