Is there a way to run Elastic Search as a Windows service? It may not be possible, but I thought I would see.
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
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
来源:https://stackoverflow.com/questions/8760696/running-elastic-search-as-a-windows-service