1. Overview

“In Windows operating systems, a Windows service is a computer program that operates in the background.” In our previous Spring Boot as Windows Service article, we have discussed spring boot as a windows services. In this article, we will discuss how to run elastic search instances as a service.

2. elasticsearch-service.bat

Elasticsearch can be installed on Windows as service using elasticsearch-service.bat command file. command file also provides help of all the commands to easily use provided options. Just execute command file as below.

Elastic Search Window Service Help

Let’s discuss each option with more details.

2.1 Install elastic search service

install option is used to install Elastic Search. Refer below example.

Install Elastic Search Windows Service

In above example, we have given ES_Service_1 as a SERVICE_ID. In local services, you will see installed service as Elasticsearch {version} (Service ID) as below.

Install Elastic Search Windows Service 2

2.2 start elastic search service

start option is used to start installed Elastic Search service in our example ES_Service_1. Refer below example.

Start Elastic Search Windows Service

After starting Elastic Search services, Verify it using localhost:9200. If everything is fine you will get ES cluster, version and other pieces of information as below.

Start Elastic Search Windows Service Verification

2.3 stop elastic search service

stop option of elasticsearch-service.bat command file is used to stop elastic search services.

Stop Elastic Search Windows Service

2.4 Remove elasticsearch service

We can remove installed ES services using remove option as below.

Remove Elastic Search Windows Service

3. Conclusion

In this article, we have discussed how to install, start, stop, remove and manage Elastic Search service using elasticsearch-service.bat command file.

4. References

Refer below link for more details.

Was this post helpful?
Let us know, if you liked the post. Only in this way, we can improve us.
Yes
No

Leave a Reply

Your email address will not be published. Required fields are marked *