|
How to Keep the OpenSearch Windows Service Running 24/7
with Service Protector |
Automatically restart OpenSearch if it loses its network connection stops for any reason.
Ensure that your search-based applications are always available.
OpenSearch is a powerful (and popular) open-source search engine.
For production environments, OpenSearch usually runs as a Windows Service — to start automatically at boot
and run unattended in the background:
Installing as a service is a great start but what happens if OpenSearch fails? Or if someone accidentally shuts down the service?
If your goal is 100% uptime, you should deploy Service Protector to keep a watchful eye on OpenSearch —
and quickly jump in if it detects a problem.
To monitor OpenSearch with Service Protector:
-
Download and
install
Service Protector, if necessary.
-
Start Service Protector.
-
Select Protector > Add to open the Add Protector window:
-
On the General tab, in the Service to protect drop-down, select the OpenSearch service.
You can leave all other settings at their defaults, which should work well for OpenSearch:
-
Switch to the Monitor tab.
OpenSearch is a TCP/IP-based service that should always be accepting network requests.
Let's set up a "sanity check" that will automatically restart OpenSearch if it ever stops processing incoming queries.
-
Check the Whenever it fails a periodic sanity check box and click the Set button on the right:
-
In the Add Sanity Check window, select the Check that your service has open network connections
option and click Next to proceed:
-
The next page allows you to specify what kind of network connections to look for.
Since OpenSearch is a server that must always have a listening connection, check the Fail if there are no listening/server connections box.
Click Next to continue.
-
At this point, specify how often Service Protector should check that OpenSearch has an outbound network connection.
Every 5 minutes should be good enough but feel free to adjust as you see fit:
After you're done, click Next to move on.
-
And finally, confirm your settings:
If everything looks good, click Add
to record your new sanity check and return to the Monitor tab.
One final recommendation on the Monitor tab: Set up a nightly restart of OpenSearch,
to cure memory leaks and other bugs that arise when the software runs for too long.
To do that:
-
Check the At the following times box and click the Add button on the right.
-
In the Add Time window that comes up, enter the time when you would like to restart the OpenSearch service.
Be sure to pick a "quiet" time, when the software is likely to be idle. For example, midnight works for us:
Click OK to save your time.
And after all that, your Monitor tab should look something like this:
-
We're done configuring OpenSearch so click the Save button.
In a few seconds, a new entry for OpenSearch will appear in Service Protector:
You can click the green "Running" circle to see how the OpenSearch service is performing:
And if you click the green shield icon, you'll see how long protection has been in place.
-
That's it! Next time your computer boots, OpenSearch will start automatically and Service Protector will babysit the service and
promptly restart it if it stops for any reason.
We encourage you to edit OpenSearch in Service Protector and review the many other settings that may be appropriate for your environment.
For example, send an email if the service fails, terminate OpenSearch if it gets stuck starting, and much more.
Trouble protecting the OpenSearch Windows Service?
|
Peace of mind for your important Windows Services!
|
|
|
Step-by-step guides for 70+ Services
|