Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running Elasticsearch as a service on Windows #3716

Closed
costin opened this Issue Sep 17, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@costin
Copy link
Member

commented Sep 17, 2013

Add support for running Elasticsearch as a service on Windows through service.bat and Apache Commons Daemon.
The ZIP file contains 3 new exe files:
elasticsearch-service-x64.exe - service wrapper for 64-bit JVMs
elasticsearch-service-x86.exe - service wrapper for 32-bit JVMs
elasticsearch-service-mgr.exe - service manager (works with both 62 and 32 wrappers)

plus a new .bat file which is the entry point called service.bat

Simply running service.bat gives information on its usage:

> 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:\jvm\jdk1.7
The service 'elasticsearch-service-x64' has been installed.

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

> service stop
The service 'elasticsearch-service-x64' has been stopped

> service remove
The service 'elasticsearch-service-x64' has been removed

In most cases, one simply installs the service and potentially does extra customizations through the service manager

> service install
> service manager

Once installed, Elasticsearch acts as any other Windows service so can be started, stopped, have different Startup types, etc...

Note that service.bat relies on the same conventions as elasticsearch.bat and the debian package - meaning the environment variables will be used (if present) during the install to set certain options.

P.S. The service.bat automatically does detection of the architecture (64 vs 32) of the target JVM detected through JAVA_HOME variable. If a certain JVM is desired, make sure that JAVA_HOME points to it.

@costin

This comment has been minimized.

Copy link
Member Author

commented Sep 17, 2013

Associated pull request (pushed to master and then cherry-picked to 0.90).

@costin costin closed this Sep 17, 2013

@Brimstedt

This comment has been minimized.

Copy link

commented Sep 20, 2013

Seems to be problem if JAVA_HOME has spaces ("c:\program files\java...")

@costin

This comment has been minimized.

Copy link
Member Author

commented Sep 20, 2013

@Brimstedt This has been fixed in master some days ago:
#3725

And please open up a new issue next time instead of commenting on a closed one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.