Elastic Kibana - install as windows service
The following command will create the service with a name of "ElasticSearch Kibana 4.0.1" and make it depend on ElasticSearch so it doesn't try to start too soon.
sc create "ElasticSearch Kibana 4.0.1" binPath= "{path to batch file}" depend= "elasticsearch-service-x64"
The kibana.bat file delivered with Kibana 4.6.1 was not suited to use with sc create directly for me (Service start failed).I used nssm like this
nssm install kibana461
- UI: choose
kibana.bat
as Application Path - UI: select a log file to write to on "I/O" tab for stdout and stderr
- UI: on the "Dependencies" tab enter
elasticsearch241
(or whatever you called it) - UI: "Install Service"
sc start kibana461
Rather than creating a dependency, I made a delayed start.
First use the
sc
command (from jhilden).sc create "Elasticsearch Kibana 4.4.2" binPath= "C:\kibana-4.4.2-windows\bin\kibana.bat"
Open
services.msc
and find your new service.- Right click the service and select
Properties
. - Change to
Automatic (Delayed Start)
. - If you haven't already, change Elasticsearch to
Automatic
.
This will ensure elasticsearch will start when the machine starts, and kibana will start sometime soon after (approx 2 minutes from this question).