Keep Consul Windows Service running 24/7 with Service Protector

How to Monitor the Consul Windows Service with Service Protector

Automatically restart Consul if it crashes, gets shut down accidentally or stops for any reason.

HashiCorp Consul helps to run distributed systems, providing discovery, segmentation and configuration services. It can be installed as a Windows Service, to start automatically whenever your server reboots:

To monitor the Consul Windows Service with Service Protector:

  1. Download and install Service Protector.

  2. Start Service Protector.

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

    Add Protector

  4. On the General tab, in the Service to protect field, select your Consul Windows Service.

    If you followed the "Installing Consul as a Service" guide, the service will be called Consul:

    Consul Windows Service: General Tab

  5. If you want to prevent Consul from consuming too much RAM, switch to the Monitor tab and activate the memory threshold feature. Enter the maximum number of megabytes that Consul should use before it is stopped and restarted.

    Consul Windows Service: Monitor Tab

  6. We're done with the basic setup so click the Save button to record your settings. In a few seconds, an entry for Consul will show up in the Service Protector window.

    The shield icon in the Protected column will be green — indicating that Consul is being monitored by Service Protector:

    Consul Windows Service: Protected

    You can click the green "Running" circle to see how the Consul service is doing:

    Consul Windows Service: Status

    Similarly, clicking the shield icon will show the status of protection.

  7. And that's it! Next time your computer boots, Consul will start up automatically and Service Protector will start monitoring the service to restart it quickly it if it crashes for any reason.

    We encourage you to edit the Consul entry in Service Protector and check out the many other settings that may be helpful in your environment. For example, restart the service if it hogs the CPU, send an email notification if the service stops, and much more.



Trouble protecting the Consul Windows Service?