[
https://issues.apache.org/jira/browse/ZOOKEEPER-1122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16054232#comment-16054232
]
Travis Lagnese edited comment on ZOOKEEPER-1122 at 6/19/17 4:20 PM:
--------------------------------------------------------------------
Hello all,
Thanks for all the work that seems to have been done here over the past few
...years?
I'm trying to wrap zookeeper into a background service using prunsrv. I've
copied the scripts provided above, and it seems that trying to stop zookeeper
using zkServer.cmd stop does not "stop the service in a timely fashion."
Do I need to lengthen the timeout, or has there been any additional effort put
toward stopping zookeeper gracefully?
Thanks in advance,
Travis
Edit: I have tried a different method, writing my own "zkServerStop.cmd" based
on some conversation on StackOverflow. I've had some success here, but when I
stop the service it always results in "Error 1067: The process terminated
unexpectedly". The service does stop, but I think this might cause problems
down the road if/when we automate deployment.
Here's what I'm using in zkServerStop.cmd. It's pretty similar to the scripts
attached above:
bq. @echo off
bq. setlocal
bq. TASKLIST /svc | findstr /c:"Zookeeper" > C:\Zookeeper352\zookeeper_svc.pid
bq. FOR /F "tokens=2 delims= " %%G IN (C:\Zookeeper352\zookeeper_svc.pid) DO (
bq. @set zkPID=%%G
bq. )
bq. taskkill /PID %zkPID% /T /F
bq. del C:\Zookeeper352\zookeeper_svc.pid
bq. endlocal
was (Author: napkin41):
Hello all,
Thanks for all the work that seems to have been done here over the past few
...years?
I'm trying to wrap zookeeper into a background service using prunsrv. I've
copied the scripts provided above, and it seems that trying to stop zookeeper
using zkServer.cmd stop does not "stop the service in a timely fashion."
Do I need to lengthen the timeout, or has there been any additional effort put
toward stopping zookeeper gracefully?
Thanks in advance,
Travis
Edit: I have tried a different method, writing my own "zkServerStop.cmd" based
on some conversation on StackOverflow. I've had some success here, but when I
stop the service it always results in "Error 1067: The process terminated
unexpectedly". The service does stop, but I think this might cause problems
down the road if/when we automate deployment.
Here's what I'm using in zkServerStop.cmd. It's pretty similar to the scripts
attached above:
{{@echo off
setlocal
TASKLIST /svc | findstr /c:"Zookeeper" > C:\Zookeeper352\zookeeper_svc.pid
FOR /F "tokens=2 delims= " %%G IN (C:\Zookeeper352\zookeeper_svc.pid) DO (
@set zkPID=%%G
)
taskkill /PID %zkPID% /T /F
del C:\Zookeeper352\zookeeper_svc.pid
endlocal}}
> "start" and "stop" commands are not present in zkServer.cmd
> -----------------------------------------------------------
>
> Key: ZOOKEEPER-1122
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1122
> Project: ZooKeeper
> Issue Type: Improvement
> Components: scripts
> Affects Versions: 3.3.3
> Environment: Windows
> Reporter: Alexander Osadchiy
> Labels: patch
> Fix For: 3.6.0
>
> Attachments: zkServer.cmd, zkServer.cmd
>
>
> Now ZooKeeper server can be started and stoped from Unix-based systems using
> script "bin/zkServer.sh":
> bin/zkServer.sh start - to start server;
> bin/zkServer.sh stop - to stop server.
> There are no "start" and "stop" commands in script "zkServer.cmd" (for
> Windows).
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)