Dockerfile - how does the VOLUME work? - apache-zookeeper

I am trying to understand the dockerfile here after ( it comes from here : https://hub.docker.com/r/jplock/zookeeper/~/dockerfile/ )
What I don't understand is the VOLUME ["/opt/zookeeper/conf", "/tmp/zookeeper"] part...
From Docker's doc I read :
The VOLUME instruction creates a mount point with the specified name
and marks it as holding externally mounted volumes from native host or
other containers. The value can be a JSON array, VOLUME ["/var/log/"], or a
plain string with multiple arguments, such as VOLUME /var/log or VOLUME
/var/log /var/db. For more information/examples and mounting instructions
via the Docker client, refer to Share Directories via Volumes
documentation.
So What I understand is that I could have a local file which would take place of the container's file.
So I created a file in my local hard-drive :
$ cat /opt/zookeeper/conf/zoo.cfg
# The number of milliseconds of each tick
tickTime=3000
And hope the [VOLUME] function would place it on top of the by default [zoo.cfg] in the container.
Unfortunately, launching the container I still see a ticktime at 2000 (last line) :
ZooKeeper JMX enabled by default
Using config: /opt/zookeeper/bin/../conf/zoo.cfg
2016-12-05 13:13:18,728 [myid:] - INFO [main:QuorumPeerConfig#124] - Reading configuration from: /opt/zookeeper/bin/../conf/zoo.cfg
2016-12-05 13:13:18,736 [myid:] - INFO [main:DatadirCleanupManager#78] - autopurge.snapRetainCount set to 3
2016-12-05 13:13:18,737 [myid:] - INFO [main:DatadirCleanupManager#79] - autopurge.purgeInterval set to 0
2016-12-05 13:13:18,738 [myid:] - INFO [main:DatadirCleanupManager#101] - Purge task is not scheduled.
2016-12-05 13:13:18,740 [myid:] - WARN [main:QuorumPeerMain#113] - Either no config or no quorum defined in config, running in standalone mode
2016-12-05 13:13:18,763 [myid:] - INFO [main:QuorumPeerConfig#124] - Reading configuration from: /opt/zookeeper/bin/../conf/zoo.cfg
2016-12-05 13:13:18,764 [myid:] - INFO [main:ZooKeeperServerMain#96] - Starting server
2016-12-05 13:13:18,781 [myid:] - INFO [main:Environment#100] - Server environment:zookeeper.version=3.4.9-1757313, built on 08/23/2016 06:50 GMT
2016-12-05 13:13:18,781 [myid:] - INFO [main:Environment#100] - Server environment:host.name=11586b93e1ff
2016-12-05 13:13:18,782 [myid:] - INFO [main:Environment#100] - Server environment:java.version=1.8.0_92-internal
2016-12-05 13:13:18,782 [myid:] - INFO [main:Environment#100] - Server environment:java.vendor=Oracle Corporation
2016-12-05 13:13:18,783 [myid:] - INFO [main:Environment#100] - Server environment:java.home=/usr/lib/jvm/java-1.8-openjdk/jre
2016-12-05 13:13:18,783 [myid:] - INFO [main:Environment#100] - Server environment:java.class.path=/opt/zookeeper/bin/../build/classes:/opt/zookeeper/bin/../build/lib/*.jar:/opt/zookeeper/bin/../lib/slf4j-log4j12-1.6.1.jar:/opt/zookeeper/bin/../lib/slf4j-api-1.6.1.jar:/opt/zookeeper/bin/../lib/netty-3.10.5.Final.jar:/opt/zookeeper/bin/../lib/log4j-1.2.16.jar:/opt/zookeeper/bin/../lib/jline-0.9.94.jar:/opt/zookeeper/bin/../zookeeper-3.4.9.jar:/opt/zookeeper/bin/../src/java/lib/*.jar:/opt/zookeeper/bin/../conf:
2016-12-05 13:13:18,784 [myid:] - INFO [main:Environment#100] - Server environment:java.library.path=/usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64/server:/usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64:/usr/lib/jvm/java-1.8-openjdk/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2016-12-05 13:13:18,785 [myid:] - INFO [main:Environment#100] - Server environment:java.io.tmpdir=/tmp
2016-12-05 13:13:18,785 [myid:] - INFO [main:Environment#100] - Server environment:java.compiler=<NA>
2016-12-05 13:13:18,789 [myid:] - INFO [main:Environment#100] - Server environment:os.name=Linux
2016-12-05 13:13:18,789 [myid:] - INFO [main:Environment#100] - Server environment:os.arch=amd64
2016-12-05 13:13:18,790 [myid:] - INFO [main:Environment#100] - Server environment:os.version=4.4.27-moby
2016-12-05 13:13:18,790 [myid:] - INFO [main:Environment#100] - Server environment:user.name=root
2016-12-05 13:13:18,791 [myid:] - INFO [main:Environment#100] - Server environment:user.home=/root
2016-12-05 13:13:18,791 [myid:] - INFO [main:Environment#100] - Server environment:user.dir=/opt/zookeeper
2016-12-05 13:13:18,803 [myid:] - INFO [main:ZooKeeperServer#815] - tickTime set to 2000
So I don't understand the VOLUME Commande :(
FROM openjdk:8-jre-alpine
MAINTAINER Justin Plock <justin#plock.net>
ARG MIRROR=http://apache.mirrors.pair.com
ARG VERSION=3.4.9
LABEL name="zookeeper" version=$VERSION
RUN apk add --no-cache wget bash \
&& mkdir /opt \
&& wget -q -O - $MIRROR/zookeeper/zookeeper-$VERSION/zookeeper-$VERSION.tar.gz | tar -xzf - -C /opt \
&& mv /opt/zookeeper-$VERSION /opt/zookeeper \
&& cp /opt/zookeeper/conf/zoo_sample.cfg /opt/zookeeper/conf/zoo.cfg \
&& mkdir -p /tmp/zookeeper
EXPOSE 2181 2888 3888
WORKDIR /opt/zookeeper
VOLUME ["/opt/zookeeper/conf", "/tmp/zookeeper"]
ENTRYPOINT ["/opt/zookeeper/bin/zkServer.sh"]
CMD ["start-foreground"]

Related

Not able to install zookeeper in windows

When i am executing zkServer.cmd via below command:
D:\zookeeper\zookeeper-3.4.14\bin>call "C:\Program Files\Java\jdk-13.0.2"\bin\java "-Dzookeeper.log.dir=D:\zookeeper\zookeeper-3.4.14\bin\.." "-Dzookeeper.root.logger=INFO,CONSOLE" -cp "D:\zookeeper\zookeeper-3.4.14\bin\..\build\classes;D:\zookeeper\zookeeper-3.4.14\bin\..\build\lib\*;D:\zookeeper\zookeeper-3.4.14\bin\..\*;D:\zookeeper\zookeeper-3.4.14\bin\..\lib\*;D:\zookeeper\zookeeper-3.4.14\bin\..\conf" org.apache.zookeeper.server.quorum.QuorumPeerMain "D:\zookeeper\zookeeper-3.4.14\bin\..\conf\zoo.cfg"
Output:
2020-02-22 22:07:42,378 [myid:] - INFO [main:QuorumPeerConfig#136] - Reading configuration from: D:\zookeeper\zookeeper-3.4.14\bin\..\conf\zoo.cfg
2020-02-22 22:07:42,384 [myid:] - INFO [main:DatadirCleanupManager#78] - autopurge.snapRetainCount set to 3
2020-02-22 22:07:42,384 [myid:] - INFO [main:DatadirCleanupManager#79] - autopurge.purgeInterval set to 0
2020-02-22 22:07:42,385 [myid:] - INFO [main:DatadirCleanupManager#101] - Purge task is not scheduled.
2020-02-22 22:07:42,387 [myid:] - WARN [main:QuorumPeerMain#116] - Either no config or no quorum defined in config, running in standalone mode
2020-02-22 22:07:42,487 [myid:] - INFO [main:QuorumPeerConfig#136] - Reading configuration from: D:\zookeeper\zookeeper-3.4.14\bin\..\conf\zoo.cfg
2020-02-22 22:07:42,487 [myid:] - INFO [main:ZooKeeperServerMain#98] - Starting server
2020-02-22 22:07:42,512 [myid:] - INFO [main:Environment#100] - Server environment:zookeeper.version=3.4.14-4c25d480e66aadd371de8bd2fd8da255ac140bcf, built on 03/06/2019 16:18 GMT
2020-02-22 22:07:42,512 [myid:] - INFO [main:Environment#100] - Server environment:host.name=LAPTOP-78H8U6PB
2020-02-22 22:07:42,517 [myid:] - INFO [main:Environment#100] - Server environment:java.version=13.0.2
2020-02-22 22:07:42,518 [myid:] - INFO [main:Environment#100] - Server environment:java.vendor=Oracle Corporation
2020-02-22 22:07:42,519 [myid:] - INFO [main:Environment#100] - Server environment:java.home=C:\Program Files\Java\jdk-13.0.2
2020-02-22 22:07:42,519 [myid:] - INFO [main:Environment#100] - Server environment:java.class.path=D:\zookeeper\zookeeper-3.4.14\bin\..\build\classes;D:\zookeeper\zookeeper-3.4.14\bin\..\build\lib\*;D:\zookeeper\zookeeper-3.4.14\bin\..\zookeeper-3.4.14.jar;D:\zookeeper\zookeeper-3.4.14\bin\..\lib\audience-annotations-0.5.0.jar;D:\zookeeper\zookeeper-3.4.14\bin\..\lib\jline-0.9.94.jar;D:\zookeeper\zookeeper-3.4.14\bin\..\lib\log4j-1.2.17.jar;D:\zookeeper\zookeeper-3.4.14\bin\..\lib\netty-3.10.6.Final.jar;D:\zookeeper\zookeeper-3.4.14\bin\..\lib\slf4j-api-1.7.25.jar;D:\zookeeper\zookeeper-3.4.14\bin\..\lib\slf4j-log4j12-1.7.25.jar;D:\zookeeper\zookeeper-3.4.14\bin\..\conf
2020-02-22 22:07:42,520 [myid:] - INFO [main:Environment#100] - Server environment:java.library.path=C:\Program Files\Java\jdk-13.0.2\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Java\jdk-13.0.2\bin;.
2020-02-22 22:07:42,520 [myid:] - INFO [main:Environment#100] - Server environment:java.io.tmpdir=C:\Users\erdiv\AppData\Local\Temp\
2020-02-22 22:07:42,521 [myid:] - INFO [main:Environment#100] - Server environment:java.compiler=<NA>
2020-02-22 22:07:42,523 [myid:] - INFO [main:Environment#100] - Server environment:os.name=Windows 10
2020-02-22 22:07:42,524 [myid:] - INFO [main:Environment#100] - Server environment:os.arch=amd64
2020-02-22 22:07:42,525 [myid:] - INFO [main:Environment#100] - Server environment:os.version=10.0
2020-02-22 22:07:42,525 [myid:] - INFO [main:Environment#100] - Server environment:user.name=erdiv
2020-02-22 22:07:42,526 [myid:] - INFO [main:Environment#100] - Server environment:user.home=C:\Users\erdiv
2020-02-22 22:07:42,526 [myid:] - INFO [main:Environment#100] - Server environment:user.dir=D:\zookeeper\zookeeper-3.4.14\bin
2020-02-22 22:07:42,534 [myid:] - INFO [main:ZooKeeperServer#836] - tickTime set to 2000
2020-02-22 22:07:42,534 [myid:] - INFO [main:ZooKeeperServer#845] - minSessionTimeout set to -1
2020-02-22 22:07:42,534 [myid:] - INFO [main:ZooKeeperServer#854] - maxSessionTimeout set to -1
2020-02-22 22:07:42,962 [myid:] - INFO [main:ServerCnxnFactory#117] - Using org.apache.zookeeper.server.NIOServerCnxnFactory as server connection factory
2020-02-22 22:07:42,964 [myid:] - INFO [main:NIOServerCnxnFactory#89] - binding to port 0.0.0.0/0.0.0.0:2181
the process gets stuck and zookeeper is not started
Also, when i do ./zkServer.cmd start, following is the output:
D:\zookeeper\zookeeper-3.4.14\bin>call "C:\Program Files\Java\jdk-13.0.2"\bin\java "-Dzookeeper.log.dir=D:\zookeeper\zookeeper-3.4.14\bin\.." "-Dzookeeper.root.logger=INFO,CONSOLE" -cp "D:\zookeeper\zookeeper-3.4.14\bin\..\build\classes;D:\zookeeper\zookeeper-3.4.14\bin\..\build\lib\*;D:\zookeeper\zookeeper-3.4.14\bin\..\*;D:\zookeeper\zookeeper-3.4.14\bin\..\lib\*;D:\zookeeper\zookeeper-3.4.14\bin\..\conf" org.apache.zookeeper.server.quorum.QuorumPeerMain "D:\zookeeper\zookeeper-3.4.14\bin\..\conf\zoo.cfg" start
2020-02-22 22:14:58,220 [myid:] - INFO [main:DatadirCleanupManager#78] - autopurge.snapRetainCount set to 3
2020-02-22 22:14:58,223 [myid:] - INFO [main:DatadirCleanupManager#79] - autopurge.purgeInterval set to 0
2020-02-22 22:14:58,225 [myid:] - INFO [main:DatadirCleanupManager#101] - Purge task is not scheduled.
2020-02-22 22:14:58,232 [myid:] - WARN [main:QuorumPeerMain#116] - Either no config or no quorum defined in config, running in standalone mode
2020-02-22 22:14:58,338 [myid:] - ERROR [main:ZooKeeperServerMain#57] - Invalid arguments, exiting abnormally
java.lang.NumberFormatException: For input string: "D:\zookeeper\zookeeper-3.4.14\bin\..\conf\zoo.cfg"
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:68)
at java.base/java.lang.Integer.parseInt(Integer.java:658)
at java.base/java.lang.Integer.parseInt(Integer.java:776)
at org.apache.zookeeper.server.ServerConfig.parse(ServerConfig.java:61)
at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:86)
at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:55)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:119)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:81)
2020-02-22 22:14:58,340 [myid:] - INFO [main:ZooKeeperServerMain#58] - Usage: ZooKeeperServerMain configfile | port datadir [ticktime] [maxcnxns]
Usage: ZooKeeperServerMain configfile | port datadir [ticktime] [maxcnxns]
the process gets stuck and zookeeper is not started
It's not stuck. It started and is waiting on connections
By the way, Java 13 might not work with Zookeeper 3.4.x

Zookeeper EndOfStreamException happened in Heron Cluster

There is a problem that bothers me. EndOfStreamExceptionalways happen in zookeeper after submitted topologies. Although it does not affect the normal operation of the cluster, I still hope to solve the problem because it may be affect other parts of Heron function.
The zookeeper version is 3.4.10 and was deployed on standalonemode in one host of my cluster. The contents of zoo.cfg are as follows.
tickTime=10000
initLimit=100
syncLimit=50
dataDir=/home/yitian/zookeeper/data
dataLogDir=/home/yitian/zookeeper/logs
clientPort=2181
maxClientCnxns=100
server.1=heron01:2888:3888
Moreover, there is the myidfile in dataDir, and its content is: 1. That is my configuration of zookeeper.
The contents of the statemgr.yaml in heron are as follows:
com.twitter.heron.statemgr.zookeeper.curator.CuratorStateManager
heron.statemgr.connection.string: "heron01:2181"
heron.statemgr.root.path: "/heron"
heron.statemgr.zookeeper.is.initialize.tree: True
There are four hosts in my Heron cluster, one mesos master host and three agent hosts. And in zookeeper log files, EndOfStreamException occurred in the three agent hosts. The contents of zookeeper.log are as follows:
2018-07-10 10:30:06,565 [myid:] - INFO [main:QuorumPeerConfig#134] - Reading configuration from: /home/yitian/zookeeper/zookeeper-3.4.10/bin/../conf/zoo.cfg
2018-07-10 10:30:06,574 [myid:] - INFO [main:QuorumPeer$QuorumServer#167] - Resolved hostname: heron01 to address: heron01/218.195.228.24
2018-07-10 10:30:06,574 [myid:] - ERROR [main:QuorumPeerConfig#345] - Invalid configuration, only one server specified (ignoring)
2018-07-10 10:30:06,576 [myid:] - INFO [main:DatadirCleanupManager#78] - autopurge.snapRetainCount set to 3
2018-07-10 10:30:06,576 [myid:] - INFO [main:DatadirCleanupManager#79] - autopurge.purgeInterval set to 0
2018-07-10 10:30:06,576 [myid:] - INFO [main:DatadirCleanupManager#101] - Purge task is not scheduled.
2018-07-10 10:30:06,576 [myid:] - WARN [main:QuorumPeerMain#113] - Either no config or no quorum defined in config, running in standalone mode
2018-07-10 10:30:06,584 [myid:] - INFO [main:QuorumPeerConfig#134] - Reading configuration from: /home/yitian/zookeeper/zookeeper-3.4.10/bin/../conf/zoo.cfg
2018-07-10 10:30:06,584 [myid:] - INFO [main:QuorumPeer$QuorumServer#167] - Resolved hostname: heron01 to address: heron01/218.195.228.24
2018-07-10 10:30:06,584 [myid:] - ERROR [main:QuorumPeerConfig#345] - Invalid configuration, only one server specified (ignoring)
2018-07-10 10:30:06,585 [myid:] - INFO [main:ZooKeeperServerMain#96] - Starting server
2018-07-10 10:30:06,589 [myid:] - INFO [main:Environment#100] - Server environment:zookeeper.version=3.4.10-39d3a4f269333c922ed3db283be479f9deacaa0f, built on 03/23/2017 10:13 GMT
2018-07-10 10:30:06,589 [myid:] - INFO [main:Environment#100] - Server environment:host.name=heron01
2018-07-10 10:30:06,589 [myid:] - INFO [main:Environment#100] - Server environment:java.version=1.8.0_151
2018-07-10 10:30:06,589 [myid:] - INFO [main:Environment#100] - Server environment:java.vendor=Oracle Corporation
2018-07-10 10:30:06,589 [myid:] - INFO [main:Environment#100] - Server environment:java.home=/usr/java/jdk1.8.0_151/jre
2018-07-10 10:30:06,590 [myid:] - INFO [main:Environment#100] - Server environment:java.class.path=/home/yitian/zookeeper/zookeeper-3.4.10/bin/../build/classes:/home/yitian/zookeeper/zookeeper-3.4.10/bin/../build/lib/*.jar:/home/yitian/zookeeper/zookeeper-3.4.10/bin/../lib/slf4j-log4j12-1.6.1.jar:/home/yitian/zookeeper/zookeeper-3.4.10/bin/../lib/slf4j-api-1.6.1.jar:/home/yitian/zookeeper/zookeeper-3.4.10/bin/../lib/netty-3.10.5.Final.jar:/home/yitian/zookeeper/zookeeper-3.4.10/bin/../lib/log4j-1.2.16.jar:/home/yitian/zookeeper/zookeeper-3.4.10/bin/../lib/jline-0.9.94.jar:/home/yitian/zookeeper/zookeeper-3.4.10/bin/../zookeeper-3.4.10.jar:/home/yitian/zookeeper/zookeeper-3.4.10/bin/../src/java/lib/*.jar:/home/yitian/zookeeper/zookeeper-3.4.10/bin/../conf:/home/yitian/zookeeper/zookeeper-3.4.10/bin/../build/classes:/home/yitian/zookeeper/zookeeper-3.4.10/bin/../build/lib/*.jar:/home/yitian/zookeeper/zookeeper-3.4.10/bin/../lib/slf4j-log4j12-1.6.1.jar:/home/yitian/zookeeper/zookeeper-3.4.10/bin/../lib/slf4j-api-1.6.1.jar:/home/yitian/zookeeper/zookeeper-3.4.10/bin/../lib/netty-3.10.5.Final.jar:/home/yitian/zookeeper/zookeeper-3.4.10/bin/../lib/log4j-1.2.16.jar:/home/yitian/zookeeper/zookeeper-3.4.10/bin/../lib/jline-0.9.94.jar:/home/yitian/zookeeper/zookeeper-3.4.10/bin/../zookeeper-3.4.10.jar:/home/yitian/zookeeper/zookeeper-3.4.10/bin/../src/java/lib/*.jar:/home/yitian/zookeeper/zookeeper-3.4.10/bin/../conf:.:/usr/java/jdk1.8.0_151/lib:/usr/java/jdk1.8.0_151/jre/lib
2018-07-10 10:30:06,590 [myid:] - INFO [main:Environment#100] - Server environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2018-07-10 10:30:06,590 [myid:] - INFO [main:Environment#100] - Server environment:java.io.tmpdir=/tmp
2018-07-10 10:30:06,590 [myid:] - INFO [main:Environment#100] - Server environment:java.compiler=<NA>
2018-07-10 10:30:06,590 [myid:] - INFO [main:Environment#100] - Server environment:os.name=Linux
2018-07-10 10:30:06,590 [myid:] - INFO [main:Environment#100] - Server environment:os.arch=amd64
2018-07-10 10:30:06,591 [myid:] - INFO [main:Environment#100] - Server environment:os.version=4.13.0-43-generic
2018-07-10 10:30:06,591 [myid:] - INFO [main:Environment#100] - Server environment:user.name=yitian
2018-07-10 10:30:06,591 [myid:] - INFO [main:Environment#100] - Server environment:user.home=/home/yitian
2018-07-10 10:30:06,591 [myid:] - INFO [main:Environment#100] - Server environment:user.dir=/home/yitian
2018-07-10 10:30:06,595 [myid:] - INFO [main:ZooKeeperServer#829] - tickTime set to 5000
2018-07-10 10:30:06,595 [myid:] - INFO [main:ZooKeeperServer#838] - minSessionTimeout set to -1
2018-07-10 10:30:06,595 [myid:] - INFO [main:ZooKeeperServer#847] - maxSessionTimeout set to -1
2018-07-10 10:30:06,601 [myid:] - INFO [main:NIOServerCnxnFactory#89] - binding to port 0.0.0.0/0.0.0.0:2181
2018-07-10 10:30:07,585 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#192] - Accepted socket connection from /218.195.228.24:39618
2018-07-10 10:30:07,600 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#935] - Client attempting to renew session 0x16482052aec0004 at /218.195.228.24:39618
2018-07-10 10:30:07,608 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#687] - Established session 0x16482052aec0004 with negotiated timeout 10000 for client /218.195.228.24:39618
2018-07-10 10:30:07,624 [myid:] - INFO [ProcessThread(sid:0 cport:2181)::PrepRequestProcessor#648] - Got user-level KeeperException when processing sessionid:0x16482052aec0004 type:create cxid:0x1c zxid:0x158f txntype:-1 reqpath:n/a Error Path:/aurora/scheduler/member_0000000454 Error:KeeperErrorCode = NodeExists for /aurora/scheduler/member_0000000454
2018-07-10 10:30:07,625 [myid:] - INFO [SyncThread:0:FileTxnLog#203] - Creating new log file: log.158f
2018-07-10 10:30:09,917 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#192] - Accepted socket connection from /218.195.228.24:39622
2018-07-10 10:30:09,917 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#192] - Accepted socket connection from /218.195.228.24:39620
2018-07-10 10:30:09,917 [myid:] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#896] - Connection request from old client /218.195.228.24:39622; will be dropped if server is in r-o mode
2018-07-10 10:30:09,917 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#935] - Client attempting to renew session 0x16482052aec0000 at /218.195.228.24:39622
2018-07-10 10:30:09,918 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#687] - Established session 0x16482052aec0000 with negotiated timeout 10000 for client /218.195.228.24:39622
2018-07-10 10:30:09,918 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#192] - Accepted socket connection from /218.195.228.24:39626
2018-07-10 10:30:09,918 [myid:] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#896] - Connection request from old client /218.195.228.24:39620; will be dropped if server is in r-o mode
2018-07-10 10:30:09,919 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#935] - Client attempting to renew session 0x16482052aec0006 at /218.195.228.24:39620
2018-07-10 10:30:09,919 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#687] - Established session 0x16482052aec0006 with negotiated timeout 10000 for client /218.195.228.24:39620
2018-07-10 10:30:09,919 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#192] - Accepted socket connection from /218.195.228.24:39628
2018-07-10 10:30:09,919 [myid:] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#896] - Connection request from old client /218.195.228.24:39626; will be dropped if server is in r-o mode
2018-07-10 10:30:09,919 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#935] - Client attempting to renew session 0x16482052aec0001 at /218.195.228.24:39626
2018-07-10 10:30:09,920 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#687] - Established session 0x16482052aec0001 with negotiated timeout 10000 for client /218.195.228.24:39626
2018-07-10 10:30:09,920 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#192] - Accepted socket connection from /218.195.228.24:39630
2018-07-10 10:30:09,920 [myid:] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#896] - Connection request from old client /218.195.228.24:39628; will be dropped if server is in r-o mode
2018-07-10 10:30:09,920 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#935] - Client attempting to renew session 0x16482052aec0007 at /218.195.228.24:39628
2018-07-10 10:30:09,921 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#687] - Established session 0x16482052aec0007 with negotiated timeout 10000 for client /218.195.228.24:39628
2018-07-10 10:30:09,921 [myid:] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#896] - Connection request from old client /218.195.228.24:39630; will be dropped if server is in r-o mode
2018-07-10 10:30:09,921 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#935] - Client attempting to renew session 0x16482052aec0005 at /218.195.228.24:39630
2018-07-10 10:30:09,921 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#687] - Established session 0x16482052aec0005 with negotiated timeout 10000 for client /218.195.228.24:39630
2018-07-10 10:30:09,922 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#192] - Accepted socket connection from /218.195.228.24:39632
2018-07-10 10:30:09,922 [myid:] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#896] - Connection request from old client /218.195.228.24:39632; will be dropped if server is in r-o mode
2018-07-10 10:30:09,922 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#935] - Client attempting to renew session 0x16482052aec0002 at /218.195.228.24:39632
2018-07-10 10:30:09,922 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#687] - Established session 0x16482052aec0002 with negotiated timeout 10000 for client /218.195.228.24:39632
2018-07-10 10:30:09,922 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#192] - Accepted socket connection from /218.195.228.24:39634
2018-07-10 10:30:09,923 [myid:] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#896] - Connection request from old client /218.195.228.24:39634; will be dropped if server is in r-o mode
2018-07-10 10:30:09,923 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#935] - Client attempting to renew session 0x16482052aec0003 at /218.195.228.24:39634
2018-07-10 10:30:09,925 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#687] - Established session 0x16482052aec0003 with negotiated timeout 10000 for client /218.195.228.24:39634
2018-07-10 10:56:28,040 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#192] - Accepted socket connection from /218.195.228.24:39852
2018-07-10 10:56:28,043 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#942] - Client attempting to establish new session at /218.195.228.24:39852
2018-07-10 10:56:28,044 [myid:] - INFO [SyncThread:0:ZooKeeperServer#687] - Established session 0x164820646770000 with negotiated timeout 30000 for client /218.195.228.24:39852
2018-07-10 10:56:37,924 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#192] - Accepted socket connection from /218.195.228.24:39860
2018-07-10 10:56:37,925 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#942] - Client attempting to establish new session at /218.195.228.24:39860
2018-07-10 10:56:37,926 [myid:] - INFO [SyncThread:0:ZooKeeperServer#687] - Established session 0x164820646770001 with negotiated timeout 10000 for client /218.195.228.24:39860
2018-07-10 10:56:37,936 [myid:] - INFO [ProcessThread(sid:0 cport:2181)::PrepRequestProcessor#486] - Processed session termination for sessionid: 0x164820646770001
2018-07-10 10:56:37,941 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn#1044] - Closed socket connection for client /218.195.228.24:39860 which had sessionid 0x164820646770001
2018-07-10 10:56:43,514 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#192] - Accepted socket connection from /218.195.228.43:35560
2018-07-10 10:56:43,516 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#942] - Client attempting to establish new session at /218.195.228.43:35560
2018-07-10 10:56:43,521 [myid:] - INFO [SyncThread:0:ZooKeeperServer#687] - Established session 0x164820646770002 with negotiated timeout 10000 for client /218.195.228.43:35560
2018-07-10 10:56:44,022 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#192] - Accepted socket connection from /218.195.228.19:50174
2018-07-10 10:56:44,026 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#942] - Client attempting to establish new session at /218.195.228.19:50174
2018-07-10 10:56:44,031 [myid:] - INFO [SyncThread:0:ZooKeeperServer#687] - Established session 0x164820646770003 with negotiated timeout 10000 for client /218.195.228.19:50174
2018-07-10 10:56:44,130 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#192] - Accepted socket connection from /218.195.228.28:44134
2018-07-10 10:56:44,149 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#942] - Client attempting to establish new session at /218.195.228.28:44134
2018-07-10 10:56:44,154 [myid:] - INFO [SyncThread:0:ZooKeeperServer#687] - Established session 0x164820646770004 with negotiated timeout 10000 for client /218.195.228.28:44134
2018-07-10 10:56:45,730 [myid:] - INFO [ProcessThread(sid:0 cport:2181)::PrepRequestProcessor#486] - Processed session termination for sessionid: 0x164820646770000
2018-07-10 10:56:45,736 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn#1044] - Closed socket connection for client /218.195.228.24:39852 which had sessionid 0x164820646770000
2018-07-10 10:57:16,966 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#192] - Accepted socket connection from /218.195.228.43:35572
2018-07-10 10:57:16,970 [myid:] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn#368] - caught end of stream exception
EndOfStreamException: Unable to read additional data from client sessionid 0x0, likely client has closed socket
at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:239)
at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:203)
at java.lang.Thread.run(Thread.java:748)
2018-07-10 10:57:16,977 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn#1044] - Closed socket connection for client /218.195.228.43:35572 (no session established for client)
2018-07-10 10:57:16,979 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#192] - Accepted socket connection from /218.195.228.43:35574
2018-07-10 10:57:16,980 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#942] - Client attempting to establish new session at /218.195.228.43:35574
2018-07-10 10:57:16,984 [myid:] - INFO [SyncThread:0:ZooKeeperServer#687] - Established session 0x164820646770005 with negotiated timeout 10000 for client /218.195.228.43:35574
2018-07-10 10:57:17,095 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#192] - Accepted socket connection from /218.195.228.43:35578
2018-07-10 10:57:17,097 [myid:] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#896] - Connection request from old client /218.195.228.43:35578; will be dropped if server is in r-o mode
2018-07-10 10:57:17,097 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#942] - Client attempting to establish new session at /218.195.228.43:35578
2018-07-10 10:57:17,101 [myid:] - INFO [SyncThread:0:ZooKeeperServer#687] - Established session 0x164820646770006 with negotiated timeout 30000 for client /218.195.228.43:35578
2018-07-10 10:57:17,747 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#192] - Accepted socket connection from /218.195.228.19:50186
2018-07-10 10:57:17,749 [myid:] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn#368] - caught end of stream exception
EndOfStreamException: Unable to read additional data from client sessionid 0x0, likely client has closed socket
at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:239)
at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:203)
at java.lang.Thread.run(Thread.java:748)
2018-07-10 10:57:17,751 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn#1044] - Closed socket connection for client /218.195.228.19:50186 (no session established for client)
2018-07-10 10:57:17,752 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#192] - Accepted socket connection from /218.195.228.19:50188
2018-07-10 10:57:17,752 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#942] - Client attempting to establish new session at /218.195.228.19:50188
2018-07-10 10:57:17,756 [myid:] - INFO [SyncThread:0:ZooKeeperServer#687] - Established session 0x164820646770007 with negotiated timeout 10000 for client /218.195.228.19:50188
2018-07-10 10:57:18,742 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#192] - Accepted socket connection from /218.195.228.19:50190
2018-07-10 10:57:18,743 [myid:] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#896] - Connection request from old client /218.195.228.19:50190; will be dropped if server is in r-o mode
2018-07-10 10:57:18,744 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#942] - Client attempting to establish new session at /218.195.228.19:50190
2018-07-10 10:57:18,751 [myid:] - INFO [SyncThread:0:ZooKeeperServer#687] - Established session 0x164820646770008 with negotiated timeout 30000 for client /218.195.228.19:50190
2018-07-10 10:57:20,456 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#192] - Accepted socket connection from /218.195.228.43:35586
2018-07-10 10:57:20,458 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#942] - Client attempting to establish new session at /218.195.228.43:35586
2018-07-10 10:57:20,463 [myid:] - INFO [SyncThread:0:ZooKeeperServer#687] - Established session 0x164820646770009 with negotiated timeout 30000 for client /218.195.228.43:35586
2018-07-10 10:57:36,004 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#192] - Accepted socket connection from /218.195.228.28:44146
2018-07-10 10:57:36,004 [myid:] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn#368] - caught end of stream exception
EndOfStreamException: Unable to read additional data from client sessionid 0x0, likely client has closed socket
at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:239)
at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:203)
at java.lang.Thread.run(Thread.java:748)
2018-07-10 10:57:36,004 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn#1044] - Closed socket connection for client /218.195.228.28:44146 (no session established for client)
2018-07-10 10:57:36,006 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#192] - Accepted socket connection from /218.195.228.28:44148
2018-07-10 10:57:36,006 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#942] - Client attempting to establish new session at /218.195.228.28:44148
2018-07-10 10:57:36,008 [myid:] - INFO [SyncThread:0:ZooKeeperServer#687] - Established session 0x16482064677000a with negotiated timeout 10000 for client /218.195.228.28:44148
2018-07-10 10:57:36,892 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#192] - Accepted socket connection from /218.195.228.28:44152
2018-07-10 10:57:36,893 [myid:] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#896] - Connection request from old client /218.195.228.28:44152; will be dropped if server is in r-o mode
2018-07-10 10:57:36,894 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer#942] - Client attempting to establish new session at /218.195.228.28:44152
2018-07-10 10:57:36,898 [myid:] - INFO [SyncThread:0:ZooKeeperServer#687] - Established session 0x16482064677000b with negotiated timeout 30000 for client /218.195.228.28:44152
In above zookeeper.log, the host with IP:218.195.228.24 is the master node, hosts list with IP: 28, 19, 43 are agents nodes.
I have tried a lot of methods, but they don't work. What is the cause of the problem? And how can I fix it? Thanks a lot for your help.
Yitan - If you are using in Aurora and during submission, the client directly writes into the zookeeper the logical plan. It might be possible the zookeeper client running on heron client might not be gracefully terminating.
Issue seems to be at client side as per below ZK issue:
https://issues.apache.org/jira/browse/ZOOKEEPER-1582
You may have to check the logs of the Zookeeper client trying to connect.

Zookeeper running or not in relation to standard port 2181 usage?

CLOUDERA QUICKSTART 5.13 as follows.
I am not sure whether zookeeper out of the box is running or not, and if so, then if it would work reliably? I got this when trying to run zookeeper from within the from kafka supplied version that I downloaded, in standalone mode:
[2018-06-17 00:49:32,847] INFO binding to port 0.0.0.0/0.0.0.0:2181
(org.apache.zookeeper.server.NIOServerCnxnFactory)
[2018-06-17 00:49:32,854] ERROR Unexpected exception, exiting abnormally
(org.apache.zookeeper.server.ZooKeeperServerMain)
java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method)
netstat on the vm reveals:
[cloudera#quickstart kafka_2.11-1.1.0]$ netstat -an | grep 2181
tcp 0 0 0.0.0.0:2181 0.0.0.0:*
LISTEN
tcp 0 0 127.0.0.1:2181 127.0.0.1:49718
ESTABLISHED
tcp 0 0 127.0.0.1:49707 127.0.0.1:2181
ESTABLISHED
tcp 0 0 127.0.0.1:2181 127.0.0.1:49707
ESTABLISHED
tcp 0 0 127.0.0.1:49697 127.0.0.1:2181
ESTABLISHED
tcp 0 0 10.0.2.15:49065 10.0.2.15:2181
ESTABLISHED
tcp 0 0 127.0.0.1:49718 127.0.0.1:2181
ESTABLISHED
tcp 0 0 127.0.0.1:49706 127.0.0.1:2181
ESTABLISHED
tcp 0 0 127.0.0.1:49714 127.0.0.1:2181
ESTABLISHED
tcp 0 0 10.0.2.15:2181 10.0.2.15:49060
ESTABLISHED
tcp 0 0 10.0.2.15:2181 10.0.2.15:49065
ESTABLISHED
tcp 0 0 127.0.0.1:2181 127.0.0.1:49701
ESTABLISHED
tcp 0 0 127.0.0.1:2181 127.0.0.1:49714
ESTABLISHED
tcp 0 0 127.0.0.1:2181 127.0.0.1:49706
ESTABLISHED
tcp 0 0 10.0.2.15:49060 10.0.2.15:2181
ESTABLISHED
tcp 0 0 127.0.0.1:49701 127.0.0.1:2181
ESTABLISHED
tcp 0 0 127.0.0.1:2181 127.0.0.1:49697
ESTABLISHED
sudo jps when executed shows QuorumPeerMain - which I think is zookeeper these days(?):
8196
5559 SecondaryNameNode
7116 HistoryServer
5831 NodeManager
5290 DataNode
10995 Jps
5216 QuorumPeerMain
6449 ThriftServer
6587 RunJar
7068 Bootstrap
5384 JournalNode
7879 Bootstrap
6317 RESTServer
7237 HRegionServer
5687 Bootstrap
6061 ResourceManager
8124 Bootstrap
8153
5479 NameNode
5745 JobHistoryServer
6699 RunJar
6158 HMaster
Not sure what to make of it as got the below when starting zookeeper from cloudera install. Do I have zookeeper working? No such process to kill means?
[cloudera#quickstart kafka_2.11-1.1.0]$ sudo
/usr/lib/zookeeper/bin/zkServer.sh start
JMX enabled by default
Using config: /usr/lib/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[cloudera#quickstart kafka_2.11-1.1.0]$ sudo /usr/lib/zookeeper/bin/zkServer.sh stop
JMX enabled by default
Using config: /usr/lib/zookeeper/bin/../conf/zoo.cfg
Stopping zookeeper ... /usr/lib/zookeeper/bin/zkServer.sh: line 162: kill:
(11140) - No such process
STOPPED
Basically, I find the observations not adding up with standard descriptions.
As your error states that you have an
Address already in use
you should figure out (as beny23 said) which process occupies that port:
lsof -i :2181
Once you have a zookeeper running you should see logs like:
Validating environment
ZK_REPLICAS=1
MY_ID=1
ZK_LOG_LEVEL=INFO
ZK_DATA_DIR=/var/lib/zookeeper/data
ZK_DATA_LOG_DIR=/var/lib/zookeeper/log
ZK_LOG_DIR=/var/log/zookeeper
ZK_CLIENT_PORT=2181
ZK_SERVER_PORT=2888
ZK_ELECTION_PORT=3888
ZK_TICK_TIME=2000
ZK_INIT_LIMIT=10
ZK_SYNC_LIMIT=2000
ZK_MAX_CLIENT_CNXNS=60
ZK_MIN_SESSION_TIMEOUT= 4000
ZK_MAX_SESSION_TIMEOUT= 40000
ZK_HEAP_SIZE=1G
ZK_SNAP_RETAIN_COUNT=3
ZK_PURGE_INTERVAL=0
ENSEMBLE
server.1=zookeeper-0.zookeeper.default.svc.cluster.local:2888:3888
Environment validation successful
Creating ZooKeeper configuration
Wrote ZooKeeper configuration file to /etc/zookeeper/zoo.cfg
Creating ZooKeeper log4j configuration
Wrote log4j configuration to /etc/zookeeper/log4j.properties
Creating ZooKeeper data directories and setting permissions
Created ZooKeeper data directories and set permissions in /var/lib/zookeeper/data
Creating JVM configuration file
Wrote JVM configuration to /etc/zookeeper/java.env
ZooKeeper JMX enabled by default
Using config: /etc/zookeeper/zoo.cfg
2018-06-18 07:52:43,747 [myid:] - INFO [main:QuorumPeerConfig#136] - Reading configuration from: /etc/zookeeper/zoo.cfg
2018-06-18 07:52:43,752 [myid:] - INFO [main:DatadirCleanupManager#78] - autopurge.snapRetainCount set to 3
2018-06-18 07:52:43,752 [myid:] - INFO [main:DatadirCleanupManager#79] - autopurge.purgeInterval set to 0
2018-06-18 07:52:43,752 [myid:] - INFO [main:DatadirCleanupManager#101] - Purge task is not scheduled.
2018-06-18 07:52:43,752 [myid:] - WARN [main:QuorumPeerMain#116] - Either no config or no quorum defined in config, running in standalone mode
2018-06-18 07:52:43,764 [myid:] - INFO [main:QuorumPeerConfig#136] - Reading configuration from: /etc/zookeeper/zoo.cfg
2018-06-18 07:52:43,764 [myid:] - INFO [main:ZooKeeperServerMain#98] - Starting server
2018-06-18 07:52:43,771 [myid:] - INFO [main:Environment#100] - Server environment:zookeeper.version=3.4.11-37e277162d567b55a07d1755f0b31c32e93c01a0, built on 11/01/2017 18:06 GMT
2018-06-18 07:52:43,771 [myid:] - INFO [main:Environment#100] - Server environment:host.name=zookeeper-0.zookeeper.default.svc.cluster.local
2018-06-18 07:52:43,771 [myid:] - INFO [main:Environment#100] - Server environment:java.version=1.8.0_151
2018-06-18 07:52:43,772 [myid:] - INFO [main:Environment#100] - Server environment:java.vendor=Oracle Corporation
2018-06-18 07:52:43,772 [myid:] - INFO [main:Environment#100] - Server environment:java.home=/usr/lib/jvm/java-8-openjdk-amd64/jre
2018-06-18 07:52:43,772 [myid:] - INFO [main:Environment#100] - Server environment:java.class.path=/usr/bin/../build/classes:/usr/bin/../build/lib/*.jar:/usr/bin/../share/zookeeper/zookeeper-3.4.11.jar:/usr/bin/../share/zookeeper/slf4j-log4j12-1.6.1.jar:/usr/bin/../share/zookeeper/slf4j-api-1.6.1.jar:/usr/bin/../share/zookeeper/netty-3.10.5.Final.jar:/usr/bin/../share/zookeeper/log4j-1.2.16.jar:/usr/bin/../share/zookeeper/jline-0.9.94.jar:/usr/bin/../share/zookeeper/audience-annotations-0.5.0.jar:/usr/bin/../src/java/lib/*.jar:/etc/zookeeper:
2018-06-18 07:52:43,772 [myid:] - INFO [main:Environment#100] - Server environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
2018-06-18 07:52:43,772 [myid:] - INFO [main:Environment#100] - Server environment:java.io.tmpdir=/tmp
2018-06-18 07:52:43,772 [myid:] - INFO [main:Environment#100] - Server environment:java.compiler=<NA>
2018-06-18 07:52:43,773 [myid:] - INFO [main:Environment#100] - Server environment:os.name=Linux
2018-06-18 07:52:43,773 [myid:] - INFO [main:Environment#100] - Server environment:os.arch=amd64
2018-06-18 07:52:43,773 [myid:] - INFO [main:Environment#100] - Server environment:os.version=4.9.64
2018-06-18 07:52:43,773 [myid:] - INFO [main:Environment#100] - Server environment:user.name=zookeeper
2018-06-18 07:52:43,774 [myid:] - INFO [main:Environment#100] - Server environment:user.home=/home/zookeeper
2018-06-18 07:52:43,774 [myid:] - INFO [main:Environment#100] - Server environment:user.dir=/usr/bin
2018-06-18 07:52:43,778 [myid:] - INFO [main:ZooKeeperServer#825] - tickTime set to 2000
2018-06-18 07:52:43,778 [myid:] - INFO [main:ZooKeeperServer#834] - minSessionTimeout set to 4000
2018-06-18 07:52:43,778 [myid:] - INFO [main:ZooKeeperServer#843] - maxSessionTimeout set to 40000
2018-06-18 07:52:43,785 [myid:] - INFO [main:ServerCnxnFactory#117] - Using org.apache.zookeeper.server.NIOServerCnxnFactory as server connection factory
2018-06-18 07:52:43,788 [myid:] - INFO [main:NIOServerCnxnFactory#89] - binding to port 0.0.0.0/0.0.0.0:2181
2018-06-18 07:52:56,088 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory#215] - Accepted socket connection from /127.0.0.1:40634
2018-06-18 07:52:56,093 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ServerCnxn#324] - The list of known four letter word commands is : [{1936881266=srvr, 1937006964=stat, 2003003491=wchc, 1685417328=dump, 1668445044=crst, 1936880500=srst, 1701738089=envi, 1668247142=conf, 2003003507=wchs, 2003003504=wchp, 1668247155=cons, 1835955314=mntr, 1769173615=isro, 1920298859=ruok, 1735683435=gtmk, 1937010027=stmk}]
In your config you should have define the server name, I have this line (I deployed zookeeper in a kubernetes cluster)
server.1=zookeeper-0.zookeeper.default.svc.cluster.local:2888:3888
Anyway you need to declare it (in your zoo.cfg) or pass it as variable at startup.

unable to start zookeeper server

I was doing setup zookeeper and while setting zookeeper server I am getting below out put. Server is not starting.
.10\bin>call "C:\Program Files\Java\jre1.8.0_111"\bin\java "-Dzookeeper.log.dir=C:\zookeeper-3.4.10\b
:43,637 [myid:] - INFO [main:QuorumPeerConfig#134] - Reading configuration
from: C:\zookeeper-3.4.10
:43,651 [myid:] - INFO [main:DatadirCleanupManager#78] - autopurge.snapRetainCount set to 3
:43,651 [myid:] - INFO [main:DatadirCleanupManager#79] - autopurge.purgeInterval set to 0
:43,651 [myid:] - INFO [main:DatadirCleanupManager#101] - Purge task is not scheduled.
:43,654 [myid:] - WARN [main:QuorumPeerMain#113] - Either no config or no quorum defined in config,
:43,790 [myid:] - INFO [main:QuorumPeerConfig#134] - Reading configuration from: C:\zookeeper-3.4.10
:43,792 [myid:] - INFO [main:ZooKeeperServerMain#96] - Starting server
:43,824 [myid:] - INFO [main:Environment#100] - Server environment:zookeeper.version=3.4.10-39d3a4f2
:43,824 [myid:] - INFO [main:Environment#100] - Server environment:host.name=P4A-508SD1Q.dir.svc.acc
:43,824 [myid:] - INFO [main:Environment#100] - Server environment:java.version=1.8.0_111
:43,824 [myid:] - INFO [main:Environment#100] - Server environment:java.vendor=Oracle Corporation
:43,824 [myid:] - INFO [main:Environment#100] - Server environment:java.home=C:\Program Files\Java\j
:43,825 [myid:] - INFO [main:Environment#100] - Server environment:java.class.path=C:\zookeeper-3.4.
:43,825 [myid:] - INFO [main:Environment#100] - Server environment:java.library.path=C:\Program File
:43,826 [myid:] - INFO [main:Environment#100] - Server environment:java.io.tmpdir=C:\Users\SHASHI~1.
:43,826 [myid:] - INFO [main:Environment#100] - Server environment:java.compiler=<NA>
:43,829 [myid:] - INFO [main:Environment#100] - Server environment:os.name=Windows 7
:43,830 [myid:] - INFO [main:Environment#100] - Server environment:os.arch=amd64
:43,830 [myid:] - INFO [main:Environment#100] - Server environment:os.version=6.1
:43,830 [myid:] - INFO [main:Environment#100] - Server environment:user.name=shashibhusan.mohanta
:43,831 [myid:] - INFO [main:Environment#100] - Server environment:user.home=C:\Users\shashibhusan.m
:43,832 [myid:] - INFO [main:Environment#100] - Server environment:user.dir=C:\zookeeper-3.4.10\bin
:43,852 [myid:] - INFO [main:ZooKeeperServer#829] - tickTime set to 2000
:43,855 [myid:] - INFO [main:ZooKeeperServer#838] - minSessionTimeout set to -1
:43,856 [myid:] - INFO [main:ZooKeeperServer#847] - maxSessionTimeout set to -1
:44,194 [myid:] - INFO [main:NIOServerCnxnFactory#89] - binding to port 0.0.0.0/0.0.0.0:2181
I am not understanding what is the maxSessionTimeout set to -1 what does that mean and how to fix please help.
That means, you haven't specifically set those values and zookeeper will be using default values for maxSessionTimeout and minSessionTimeout which are 20 and 2 times the tickTime respectively.
Read the zookeeper minimum configuration docs.

zookeeper server STARTED but ruok no output

I have set in zoo.cfg : clientPort=2181
cloudera#cloudera-vm:/$ sudo /usr/lib/zookeeper/bin/zkServer.sh start
I get the following response:
JMX enabled by default
Using config: /usr/lib/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
cloudera#cloudera-vm:/$ sudo /usr/lib/zookeeper/bin/zkServer.sh status
JMX enabled by default
Using config: /usr/lib/zookeeper/bin/../conf/zoo.cfg
Mode: standalone
But
$ echo ruok | nc localhost 2181
$
is not giving any output. where is the problem?
Log file:
2014-10-03 08:40:10,912 - INFO [main:QuorumPeerConfig#90] - Reading configuration from: /usr/lib/zookeeper/bin/../conf/zoo.cfg
2014-10-03 08:40:10,916 - ERROR [main:QuorumPeerConfig#259] - Invalid configuration, only one server specified (ignoring)
2014-10-03 08:40:10,916 - WARN [main:QuorumPeerMain#105] - Either no config or no quorum defined in config, running in standalone mode
2014-10-03 08:40:10,927 - INFO [main:QuorumPeerConfig#90] - Reading configuration from: /usr/lib/zookeeper/bin/../conf/zoo.cfg
2014-10-03 08:40:10,928 - ERROR [main:QuorumPeerConfig#259] - Invalid configuration, only one server specified (ignoring)
2014-10-03 08:40:10,928 - INFO [main:ZooKeeperServerMain#94] - Starting server
2014-10-03 08:40:10,933 - INFO [main:Environment#97] - Server environment:zookeeper.version=3.3.5-cdh3u6--1, built on 03/20/2013 20:16 GMT
2014-10-03 08:40:10,933 - INFO [main:Environment#97] - Server environment:host.name=cloudera-vm
2014-10-03 08:40:10,933 - INFO [main:Environment#97] - Server environment:java.version=1.6.0_24
2014-10-03 08:40:10,934 - INFO [main:Environment#97] - Server environment:java.vendor=Sun Microsystems Inc.
2014-10-03 08:40:10,934 - INFO [main:Environment#97] - Server environment:java.home=/usr/lib/jvm/java-6-sun-1.6.0.24/jre
2014-10-03 08:40:10,934 - INFO [main:Environment#97] - Server environment:java.class.path=/usr/lib/zookeeper/bin/../build/classes:/usr/lib/zookeeper/bin/../build/lib/*.jar:/usr/lib/zookeeper/bin/../zookeeper-3.3.5-cdh3u6.jar:/usr/lib/zookeeper/bin/../lib/log4j-1.2.15.jar:/usr/lib/zookeeper/bin/../lib/jline-0.9.94.jar:/usr/lib/zookeeper/bin/../src/java/lib/*.jar:/usr/lib/zookeeper/bin/../conf:
2014-10-03 08:40:10,934 - INFO [main:Environment#97] - Server environment:java.library.path=/usr/lib/jvm/java-6-sun-1.6.0.24/jre/lib/i386/client:/usr/lib/jvm/java-6-sun-1.6.0.24/jre/lib/i386:/usr/lib/jvm/java-6-sun-1.6.0.24/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
2014-10-03 08:40:10,934 - INFO [main:Environment#97] - Server environment:java.io.tmpdir=/tmp
2014-10-03 08:40:10,934 - INFO [main:Environment#97] - Server environment:java.compiler=<NA>
2014-10-03 08:40:10,934 - INFO [main:Environment#97] - Server environment:os.name=Linux
2014-10-03 08:40:10,934 - INFO [main:Environment#97] - Server environment:os.arch=i386
2014-10-03 08:40:10,935 - INFO [main:Environment#97] - Server environment:os.version=2.6.35-28-generic
2014-10-03 08:40:10,935 - INFO [main:Environment#97] - Server environment:user.name=root
2014-10-03 08:40:10,935 - INFO [main:Environment#97] - Server environment:user.home=/root
2014-10-03 08:40:10,935 - INFO [main:Environment#97] - Server environment:user.dir=/
2014-10-03 08:40:10,940 - INFO [main:ZooKeeperServer#673] - tickTime set to 2000
2014-10-03 08:40:10,940 - INFO [main:ZooKeeperServer#682] - minSessionTimeout set to -1
2014-10-03 08:40:10,941 - INFO [main:ZooKeeperServer#691] - maxSessionTimeout set to -1
2014-10-03 08:40:10,953 - INFO [main:NIOServerCnxn$Factory#143] - binding to port 0.0.0.0/0.0.0.0:2181
2014-10-03 08:40:10,963 - INFO [main:FileSnap#82] - Reading snapshot /var/zookeeper/version-2/snapshot.0
2014-10-03 08:40:10,972 - INFO [main:FileTxnSnapLog#256] - Snapshotting: 0
2014-10-03 08:45:42,225 - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn$Factory#251] - Accepted socket connection from /127.0.0.1:39879
2014-10-03 08:45:42,231 - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn#1237] - Processing srvr command from /127.0.0.1:39879
2014-10-03 08:45:42,239 - INFO [Thread-1:NIOServerCnxn#1435] - Closed socket connection for client /127.0.0.1:39879 (no session established for client)
One thing to keep in mind is that echo hello | nc localhost 2181 just writes hello to the host:port and doesn't necessarily wait to receive any response. If you must wait for a response, make netcat wait for it by providing it a -q option. For instance, you might want to try echo hello | nc -q 3 localhost 2181