Reputation: 13
I was able to run the Zookeeper server from command prompt on Windows .
Today I would like it to run as a background service instead and also start automatically upon OS boot.
I was able to create the service using below command.
sc.exe create ZookeeperService binPath= “C:\zookeeper\apache-zookeeper-3.5.5\bin\zkServer.cmd”
… but it is not started and an the following error appears:
Then how should I run Zookeeper server as an auto started service?
Upvotes: 1
Views: 2510
Reputation: 36
I had the same problem as you, and using NSSM was the only solution that worked for me.
sc.exe create
... does not work for batch files, because it does not implement the windows services interface like a .exe-file.
Possible solutions:
nssm.exe (my preferred solution).
Create a new scheduled task via command prompt using Schktasks.exe
Create a new scheduled task via PowerShell using ScheduledTask
Upvotes: 1