Hi Patrick, Thanks for the reply and encouragement. Will fix it soon and patch against trunk
One more thing cannot connect to http://irc.freenode.org/ so the link http://zookeeper.apache.org/irc.html is leading the user no where. Thanks, Nandini On Sun, Mar 16, 2014 at 10:49 AM, Patrick Hunt <[email protected]> wrote: > Hi Nandini, this is great feedback. It's likely that not many people > are using ZK and those cmd scripts on windows. As a result things get > stale. I'd encourage you to provide some patches agains the trunk > which incorporate your fixes. You can see more detail on how to do > that here: > https://cwiki.apache.org/confluence/display/ZOOKEEPER/HowToContribute > > Regards, > > Patrick > > On Wed, Mar 12, 2014 at 2:47 AM, nandini <[email protected]> wrote: > > Hi, > > > > I am using zookeeper in my product. > > While working with zookeeper on Windows, I am creating a service(using > > prunsrv) , > > I have few queries and issues. Listed them all, > > > > Issues: > > 1) zkServer.cmd didn't start on Win server 2008 machine & Win 7 > > Enterprise(64 bit both), had to replace the following line, > > java "-Dzookeeper.log.dir=%ZOO_LOG_DIR%" > > "-Dzookeeper.root.logger=%ZOO_LOG4J_PROP%" -cp "%CLASSPATH%" %ZOOMAIN% > > "%ZOOCFG%" %* > > to > > java "-Dzookeeper.log.dir=%ZOO_LOG_DIR%" > > "-Dzookeeper.root.logger=%ZOO_LOG4J_PROP%" -cp "%CLASSPATH%" %ZOOMAIN% > > "%ZOOCFG%" > > And it worked, could it be fixed in some other way? > > > > 2) In the zoo.cnf I specified the dataDir, still it creates some > other > > directory (bin/zookeeper-3.4.5zookeeper-3.4.5data/ version-2/snapshot) > and > > stores the snapshots there. > > > > Queries: > > 1) There is no start/stop with zkServer.cmd as it is in > zkServer.sh, so > > basically it is started with zkServer.cmd but to stop I do a Ctrl+C/Z > > So if I start the process, it is a foreground process and gets killed > when I > > do a ctrl+C > > > > 2) I have to create a zookeeper service, and I am using prunsrv to > do that. > > I figured out the following 2 ways to do so. > > > > a) prunsrv //IS//Zookeeper --DisplayName=" ZOOKEEPER Service" > > --Description=" ZOOKEEPER Service" --Startup=auto --StartMode=exe > > --StartPath=%ZOOKEEPER_HOME% > --StartImage=%ZOOKEEPER_HOME%\bin\zkServer.cmd > > --StopTimeout=5 --LogPath=%LOGS_DIR% --LogPrefix=zookeeper > --LogLevel=Info > > --PidFile=zookeeper.pid --StdOutput=auto --StdError=auto > > > > > > b) cd %ZOOKEEPER_HOME%\bin\ > > call "%~dp0zkEnv.cmd" > > set > ZOOMAIN=org.apache.zookeeper.server.quorum.QuorumPeerMain > > prunsrv //IS//Zookeeper --DisplayName=" ZOOKEEPER > Service" > > --Description=" ZOOKEEPER Service" --Jvm="%JVM_DLL%" > > --JvmOptions=!JAVA_OPTS! > > > --Environment=zookeeper.log.dir=%ZOO_LOG_DIR%;zookeeper.root.logger=%ZOO_LOG4J_PROP%; > > --Startup=auto --LibraryPath=%LIB_DIR% --StartMode=jvm > > --Classpath=%CLASSPATH% %ZOOMAIN% %ZOOCFG% > > --StartClass=org.apache.zookeeper.server.quorum.QuorumPeerMain > > --StartMethod=start --StopMode=jvm > > --StopClass=org.apache.zookeeper.server.quorum.QuorumPeerMain > > --StopMethod=stop --StopTimeout=10 --LogPath=%LOGS_DIR% > > --LogPrefix=zookeeper --LogLevel=Info --PidFile=zookeeper.pid > > --StdOutput=auto --StdError=auto > > > > basically in the second approach I am myself doing all tasks done by the > > zkServer.cmd > > > > =>> My Query is in the second step(2b), that to stop the service there > > should be a stop method exposed, so that when I stop the service it is > > called. > > So right now if I create a service and start it, ZK runs fine, but > stopping > > it takes indefinitely, so I have to go and kill the process. > > Is there some stop() for the same, I see a shutdown() but there is no > > description for it > > > > I went through the class > org.apache.zookeeper.server.quorum.QuorumPeerMain, > > here the main() is the start method( if my understanding is correct), and > > there should be some method to shutdown the process. > > > > > > https://issues.apache.org/jira/browse/ZOOKEEPER-1122, exposes a > start/stop, > > but the stop has some issues > > > > it throws the following error: > > > > E:\zookeeper-3.4.5\zookeeper-3.4.5\bin>zkServer.cmd stop > > "JMX enabled by default" > > "Using config: E:\zookeeper-3.4.5\zookeeper-3.4.5\bin\..\conf\zoo.cfg" > > "Stopping zookeeper ... " > > ERROR: The process with PID 452 (child process of PID 4) could not be > > terminated. > > Reason: This is critical system process. Taskkill cannot end this > process. > > ERROR: The process with PID 4 (child process of PID 0) could not be > > terminated. > > Reason: Access is denied. > > ERROR: The process with PID 0 (child process of PID 0) could not be > > terminated. > > Reason: This is critical system process. Taskkill cannot end this > process. > > STOPED > > > > I am running this stop command on a Administrator console. > > > > E:\zookeeper-3.4.5\zookeeper-3.4.5\bin>tasklist | findstr "java" > > java.exe 10324 Console 1 > 36,036 > > K. > > > > > > > > > > > > -- > > View this message in context: > http://zookeeper-user.578899.n2.nabble.com/Query-regarding-Zookeeper-Windows-API-start-stop-using-Zk-as-a-windows-service-using-prunsrv-tp7579637.html > > Sent from the zookeeper-user mailing list archive at Nabble.com. > -- Regards, Nandini
