Installing Elasticsearch as a Service on Windows

Elasticsearch can be installed as a service to run in the background or start automatically at boot time without any user interaction. This can be achieved upon installation using the following command line options

  • INSTALLASSERVICE=true
  • STARTAFTERINSTALL=true
  • STARTWHENWINDOWSSTARTS=true

Once installed, Elasticsearch will appear within the Services control panel:

and can be stopped and restarted from within the control panel, or from the command line using:

with Command Prompt:

sc.exe stop Elasticsearch
sc.exe start Elasticsearch

note:Run cmd  with administrator privileges 。

with PowerShell:

Get-Service Elasticsearch | Stop-Service | Start-Service

Changes can be made to jvm.options and elasticsearch.yml configuration files to configure the service after installation. Most changes (like JVM settings) will require a restart of the service in order to take effect.

猜你喜欢

转载自blog.csdn.net/dyxcome/article/details/82048009