Return-Path: X-Original-To: apmail-zookeeper-user-archive@www.apache.org Delivered-To: apmail-zookeeper-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F0F311046D for ; Sun, 16 Mar 2014 16:31:55 +0000 (UTC) Received: (qmail 7216 invoked by uid 500); 16 Mar 2014 16:31:54 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 7114 invoked by uid 500); 16 Mar 2014 16:31:53 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Received: (qmail 7105 invoked by uid 99); 16 Mar 2014 16:31:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Mar 2014 16:31:52 +0000 X-ASF-Spam-Status: No, hits=4.5 required=5.0 tests=FORGED_YAHOO_RCVD,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [212.82.96.79] (HELO nm1-vm8.bullet.mail.ir2.yahoo.com) (212.82.96.79) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Mar 2014 16:31:45 +0000 Received: from [212.82.98.126] by nm1.bullet.mail.ir2.yahoo.com with NNFMP; 16 Mar 2014 16:31:23 -0000 Received: from [46.228.39.109] by tm19.bullet.mail.ir2.yahoo.com with NNFMP; 16 Mar 2014 16:31:23 -0000 Received: from [127.0.0.1] by smtp146.mail.ir2.yahoo.com with NNFMP; 16 Mar 2014 16:31:23 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1394987483; bh=Q0P2MpDuVmP4nx7bL9amOwp7fXO+s8bnwiyDpEelPx4=; h=X-Yahoo-Newman-Id:Message-ID:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:MIME-Version:To:From:Subject:Date:Content-Type; b=C2OH+twqsT5jXWZKPCTIWYd2Aa/DSJd9hqnnXVgamQIx7SaR5HGMBtcWNSkU8hgBdHXMvJSTHdhqhPmIuQNqP84k9jKQq/kKjPQzKwm2TUuWsAsdR0UoxUGTSxHLb02kWTMAMRMjKBC8xygM+QbxipbcPB1KjundMMfndZBGj18= X-Yahoo-Newman-Id: 208023.38985.bm@smtp146.mail.ir2.yahoo.com Message-ID: <208023.38985.bm@smtp146.mail.ir2.yahoo.com> X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: zeGw3wcVM1kWcGUu1Jynk9dqSbXRbzv0Qb700Bzfudmnuor ui33Ox7KHa7rwh_aZGDJJhFyzryrbX6W0Ua4QFRtuV6hhf7fxTUN1xfFYx7h ue3PekTEWvAuNSR4ovkAvBMVXVTMVNEqQjBFxJFdXcm5gHaekUTFQJ6_ZB6z QUe6krdlCXVfgKaibJMkg7gUFx.VbgZRP4YHnpZZKO2I3s.6cZvja0dJLLXB YB6jLvHAITWUlGCky20uWIWbTXLZ2t.t8BOTEvZMCKMGLlTGj003zIQeBdWd IG7WITSYxlOKm3rB8DR5fhK_kyvpeUDWLaTzN1n81jTU_.mJ5wdQ2sXAZE9U .S.4ZPEnwLbgZr.nEEfn4M762T3l6wZBEELAeneF3.8lcIrmIheiIXcufAbN dipvuj_GPOf4aUSL0tGRWJCst3JdTF9ObExJNltw7gAER3FaVz46VMMDyczt PzqivWQtruNlkwIBHx0PFtI6pOpbzfbmWgLojH7AD2PnxaLAFdhmGR6heE_d vjSpj4JM70VppWRDo4zRZNfM5sfx65xRvdd1MtVh11sJMzfXWeAzZqa8zcDu HimjyensRZGC2bi7NcYPM92ediZfCZZCXmQ31n9F_guOtGgNKz90cM1ZF3Ne rB71UcRq8zr5cq_1UkNVWexPW1nItCniicq.kj9qeknPEya.JRAcOkYhX168 qotAydPQuIQ7nJuJpZXyaMBbDwZ8gPYjLfv4cGLZ2BLWc.4Kcj_fs9OuO.TR CyFi7teoAPyibbBF59mRsb2UK9GYEmy_e0o40pdA4qtQvzuOX3dRSFKgIZ_i FOB5AgxisjzYJK611MNs6xvel3dMMlvBZUFoD88KY1GDLDDXqA3mpDcrzu0_ NLLNgx1VQdY1SF2pG99K3ZntusrW4xpCtiRWzMpAbKMk.7kqoFzavFdVSnL8 iDbWEXzzSnSGp0lm4fwuWKEGlFyqFXRj4saemvFYUYWxbrqVVBHEGscY- X-Yahoo-SMTP: HT5UJDeswBACWJPOeualxAa.da..S.fl X-Rocket-Received: from [192.168.1.67] (fpjunqueira@86.184.76.241 with plain [46.228.39.225]) by smtp146.mail.ir2.yahoo.com with SMTP; 16 Mar 2014 16:31:23 +0000 UTC MIME-Version: 1.0 To: "user@zookeeper.apache.org" From: Flavio Junqueira Subject: RE: Query regarding Zookeeper Windows API start/stop, using Zk as awindows service(using prunsrv) Date: Sun, 16 Mar 2014 16:29:40 +0000 Content-Type: multipart/alternative; boundary="_DDD8C7BF-5B02-487C-ABA1-F2A824BB4940_" X-Virus-Checked: Checked by ClamAV on apache.org --_DDD8C7BF-5B02-487C-ABA1-F2A824BB4940_ Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" I run regularly on Windows 8 and I haven't been having any issues with the = scripts. -Flavio -----Original Message----- From: "Patrick Hunt" Sent: =E2=80=8E16/=E2=80=8E03/=E2=80=8E2014 05:46 To: "UserZooKeeper" ; "nandini.nelson@gmail.com"= Cc: "zookeeper-user@hadoop.apache.org" Subject: Re: Query regarding Zookeeper Windows API start/stop, using Zk as = awindows service(using prunsrv) 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 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=3D%ZOO_LOG_DIR%" > "-Dzookeeper.root.logger=3D%ZOO_LOG4J_PROP%" -cp "%CLASSPATH%" %ZOOMAIN% > "%ZOOCFG%" %* > to > java "-Dzookeeper.log.dir=3D%ZOO_LOG_DIR%" > "-Dzookeeper.root.logger=3D%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 oth= er > directory (bin/zookeeper-3.4.5zookeeper-3.4.5data/ version-2/snapshot) an= d > 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 whe= n I > do a ctrl+C > > 2) I have to create a zookeeper service, and I am using prunsrv to d= o that. > I figured out the following 2 ways to do so. > > a) prunsrv //IS//Zookeeper --DisplayName=3D" ZOOKEEPER Service" > --Description=3D" ZOOKEEPER Service" --Startup=3Dauto --StartMode=3Dexe > --StartPath=3D%ZOOKEEPER_HOME% --StartImage=3D%ZOOKEEPER_HOME%\bin\zkServ= er.cmd > --StopTimeout=3D5 --LogPath=3D%LOGS_DIR% --LogPrefix=3Dzookeeper --LogLev= el=3DInfo > --PidFile=3Dzookeeper.pid --StdOutput=3Dauto --StdError=3Dauto > > > b) cd %ZOOKEEPER_HOME%\bin\ > call "%~dp0zkEnv.cmd" > set ZOOMAIN=3Dorg.apache.zookeeper.server.quorum.QuorumPe= erMain > prunsrv //IS//Zookeeper --DisplayName=3D" ZOOKEEPER Servi= ce" > --Description=3D" ZOOKEEPER Service" --Jvm=3D"%JVM_DLL%" > --JvmOptions=3D!JAVA_OPTS! > --Environment=3Dzookeeper.log.dir=3D%ZOO_LOG_DIR%;zookeeper.root.logger= =3D%ZOO_LOG4J_PROP%; > --Startup=3Dauto --LibraryPath=3D%LIB_DIR% --StartMode=3Djvm > --Classpath=3D%CLASSPATH% %ZOOMAIN% %ZOOCFG% > --StartClass=3Dorg.apache.zookeeper.server.quorum.QuorumPeerMain > --StartMethod=3Dstart --StopMode=3Djvm > --StopClass=3Dorg.apache.zookeeper.server.quorum.QuorumPeerMain > --StopMethod=3Dstop --StopTimeout=3D10 --LogPath=3D%LOGS_DIR% > --LogPrefix=3Dzookeeper --LogLevel=3DInfo --PidFile=3Dzookeeper.pid > --StdOutput=3Dauto --StdError=3Dauto > > basically in the second approach I am myself doing all tasks done by the > zkServer.cmd > > =3D>> 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 stoppi= ng > 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.QuorumPeerMai= n, > 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/sto= p, > 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,03= 6 > 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-serv= ice-using-prunsrv-tp7579637.html > Sent from the zookeeper-user mailing list archive at Nabble.com. --_DDD8C7BF-5B02-487C-ABA1-F2A824BB4940_--