running Elastic Search as a Windows service

若如初见. 提交于 2019-12-02 16:39:36

As of 0.90.5+, support for running ElasticSearch as a Windows Service is officially included in the Windows distribution.

http://www.elasticsearch.org/blog/0-90-5-released/

From the bin folder:

> service.bat
Usage: service.bat install|remove|start|stop|manager [SERVICE_ID]

> service install
Installing service      :  'elasticsearch-service-x64'
Using JAVA_HOME (64-bit):  c:jvmjdk1.7
The service 'elasticsearch-service-x64' has been installed.

> service start
The service 'elasticsearch-service-x64' has been started

Just made an install for windows service and setup tool for settings.

https://github.com/jdzurik/ESWindowsInstaller

Requires only Java and .net and works on windows server 64bit

You can use this binary install , works perfectly and you don't have to do anything in CLI.

I've been using this installer. It is as easy as "next, next, next!"

As of v0.90.5 functionality comes right out of the box (executing a batch file) - see running as a service on windows.

Yes, it is described here. That link describes using Java Service Wrapper, which can work on windows. :)

Create your own Elasticsearch msi installer with a customized ES config that fit your needs or simply download the standard preconfigured installer:

https://github.com/salyh/elasticsearch-msi-installer/releases

The time this question asked there wasn't inbuilt solution but now There is. Please check http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/setup-service-win.html

All you need do is go to the folder where your ES is installed.

Run the commands

service.bat

service install

service start

and you are done.

Elasticsearch uses procrun to wrap the application as a windows service.

For Elasticsearch version starting 5.x, the .bat file names are changed. To install as a Windows Service, we can use the following command:

C:\elasticsearch-5.0.0>.\bin\elasticsearch-service install

assuming your Elasticsearch package is located at C:\elasticsearch-5.0.0.

If we are using Elasticsearch on 64-bit Windows, we might end up with the following exception while doing the above:

thread stack size not set; configure via C:\elasticsearch-5.0.0\config\jvm.options or ES_JAVA_OPTS

Reason: The issue when running Elasticsearch as a service on Windows is that procrun requires min heap, max heap and thread stack size to be set.

Resolution: We could use -Xss1m (or what ever the space you want to be) in jvm.options file.

Open the jvm.options file in the .\config folder and enter -Xss1m after the lines

-Xms2g 
-Xmx2g

like below:

-Xms2g
-Xmx2g
-Xss1m
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!