# Running as a Service on Windows

**URL:** <https://discuss.elastic.co/t/running-as-a-service-on-windows/69938>\
**Category:** Elasticsearch\
**Created:** [December 24, 2016, 9:01am UTC](https://discuss.elastic.co/t/running-as-a-service-on-windows/69938 "2016-12-24T09:01:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mario\_van\_Gemert](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario_van_gemert/32/13832_2.png) [@Mario\_van\_Gemert](https://discuss.elastic.co/u/Mario_van_Gemert)\
**Post date:** [December 24, 2016, 9:01am UTC](https://discuss.elastic.co/t/running-as-a-service-on-windows/69938/1 "2016-12-24T09:01:49Z")

</div>

I am running Elastic 5.1.1 and I am trying to run it as a service on Windows 10.

Did a: elasticsearch-service.bat install

Which was ok:  
Installing service : "elasticsearch-service-x64"  
Using JAVA\_HOME (64-bit): "C:\Program Files\Java\jdk1.8.0\_77"  
The service 'elasticsearch-service-x64' has been installed.

I am able to start the manager: elasticsearch-service.bat manager

But I am unable to start Elastic as a service: elasticsearch-service.bat start  
Failed starting 'elasticsearch-service-x64' service

Windows event log shows a:  
The service Elasticsearch 5.1.1 (elasticsearch-service-x64) has stopped with the following specific service error:  
Incorrect function. ID.7024

Anyone an idea how to run Elastic automatically as a a service?

---

<div class="post-metadata">

**Author:** ![askids](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/askids/32/22252_2.png) [@askids](https://discuss.elastic.co/u/askids)\
**Post date:** [December 24, 2016, 8:38pm UTC](https://discuss.elastic.co/t/running-as-a-service-on-windows/69938/2 "2016-12-24T20:38:42Z")

</div>

Once the installation is successful, you can simply go to the service manager and start it from there and also you can change the start type to automatic.

---

<div class="post-metadata">

**Author:** ![Mario\_van\_Gemert](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario_van_gemert/32/13832_2.png) [@Mario\_van\_Gemert](https://discuss.elastic.co/u/Mario_van_Gemert)\
**Post date:** [December 24, 2016, 9:20pm UTC](https://discuss.elastic.co/t/running-as-a-service-on-windows/69938/3 "2016-12-24T21:20:03Z")

</div>

Tried that, does not work either. Same error message.

---

<div class="post-metadata">

**Author:** ![askids](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/askids/32/22252_2.png) [@askids](https://discuss.elastic.co/u/askids)\
**Post date:** [December 27, 2016, 1:30am UTC](https://discuss.elastic.co/t/running-as-a-service-on-windows/69938/4 "2016-12-27T01:30:55Z")

</div>

Did you check the logs? Most of the times, the log messages are clear enough to point out the reason. With windows, your common reasons will be heap size or swap file size. But start by looking at your "Elasticseach" log files.

---

<div class="post-metadata">

**Author:** ![Mario\_van\_Gemert](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario_van_gemert/32/13832_2.png) [@Mario\_van\_Gemert](https://discuss.elastic.co/u/Mario_van_Gemert)\
**Post date:** [December 27, 2016, 7:09am UTC](https://discuss.elastic.co/t/running-as-a-service-on-windows/69938/5 "2016-12-27T07:09:08Z")

</div>

Thnx! Problem is solved. I had the bootstrap.memory\_lock set to true. Turned it off at it starts just fine. Guess that if I want to set the bootstrap.memory\_lock to true I have to adjust heap or swap file size first.

👍

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 24, 2017, 7:09am UTC](https://discuss.elastic.co/t/running-as-a-service-on-windows/69938/6 "2017-01-24T07:09:08Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
