1

Using Zookeeper 3.5.6-bin, on Win10, java8

PATH= ;%ZOOKEEPER_HOME%\bin;  
ZOOKEEPER_HOME=C:\apps\Apache\apache-zookeeper-3.5.6-bin  
dataDir=C:\appas\apache\apache-zookeeper-3.5.6-bin\data

I am starting with zkServer start

ERROR:

[main:ZooKeeperServerMain@66] - Invalid arguments, exiting abnormally  
java.lang.NumberFormatException: For input string: "C:\apps\apache\apache-zookeeper-3.5.6-bin\bin\..\conf\zoo.cfg" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:82)

2020-01-28 15:29:12,618 [myid:] - INFO  [main:ZooKeeperServerMain@67] - Usage: ZooKeeperServerMain configfile | port datadir [ticktime] [maxcnxns]  
Usage: ZooKeeperServerMain configfile | port datadir [ticktime] [maxcnxns]  

ZOOKEEPER_HOME etc seem correct?

Update/Resolution
zkServer [start] - is a documented legit way to start - but this gives errors - cant figure that out why. So just zkServer to start.
Port 8080 conflict for admin server: You can kill the existing process on this port (requires a bit of doing). Or you can start admin on different port (or even disable admin server completely). This is not clearly documented in the Docs - but check here

Sam-T
  • 1,877
  • 6
  • 23
  • 51
  • I'm guessing the correct string would be `apache-zookeeper-3.5.6` without the `-bin` – Scratte Jan 28 '20 at 21:24
  • The problem is zookeeper is picking the path, I have only setup the ZOOKEEPER_HOME. The `-bin` in the path name is actually directory name, not `\bin`. – Sam-T Jan 28 '20 at 21:27
  • What's in your `C:\apps\apache\apache-zookeeper-3.5.6-bin\conf\zoo.cfg` file? – Scratte Jan 28 '20 at 21:34
  • The `zoo.cfg` is the application configuration file. If I check the actual windows cmd file the starts it shows `set ZOOCFGDIR=%~dp0%..\conf`. `conf` and `bin` directories are the the same level. – Sam-T Jan 28 '20 at 21:55
  • It's obviously trying to parse a string into a number. But it fails to do so. The only number that I see is 3.5.6. If the zookeeper people are assuming that the numbers are not extended with `-bin` then it may be trying to parse 6-bin. If that's the case your easiest solution is to move the entire thing to a new directory called `apache-zookeeper-3.5.6`. But.. it's a lot of ifs. – Scratte Jan 28 '20 at 22:01
  • Added some more error details in main. The `cfg` file has some more numbers: `tickTime=2000` `maxClientCnxns=10` `clientPort=2181` , etc. The `-bin` in directory name is standard zookeeper directory (as you unzip) – Sam-T Jan 28 '20 at 22:13
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/206824/discussion-between-scratte-and-sam-t). – Scratte Jan 28 '20 at 22:17

1 Answers1

2

In a joint effort the solution is to run it without start, just

> zkServer

..and to ensure nothing else is running on port 8080 for the AdminServer to be able to start, avoiding this:

Unable to start AdminServer, exiting abnormally
org.apache.zookeeper.server.admin.AdminServer$AdminServerException:
  Problem starting AdminServer on address 0.0.0.0, port 8080 and command URL /commands.
  Caused by: java.io.IOException: Failed to bind to /0.0.0.0:8080
  Caused by: java.net.BindException: Address already in use: bind.
Scratte
  • 3,056
  • 6
  • 19
  • 26