Category Archives: apache-zookeeper

Classpath is empty. Please build the project first e.g. by running ‘./gradlew jar -PscalaVersion=2.11.12′

I am not able to run a Apache Kafka service due to a failure while trying to start a Zookeeper instance. I have downloaded and tried it with all 3 availabe downloads at the official site. (binarys and source) When i try to start zookeeper with

./bin/zookeeper-server-start.sh config/zookeeper.properties

I always get the same error message:

Classpath is empty. Please build the project first e.g. by running './gradlew jar -PscalaVersion=2.11.12'

The same goes for (after starting a seperate zookeeper (not the build-in from kakfa) instance)

./bin/kafka-server-start.sh config/server.properties

I have tried it under Ubuntu 17.04 and 18.04. When i try this on a virtual machine using Ubuntu 16.04 it works.

Unfortunatly, all i found regarding this problem, was for Windows. Thank you for any help.

How can I configure Apache Zookeeper with redundancy on only two physical frames?

I would like to have a high-availability/redundant installation of Zookeeper running in my production environment. The problem is that I only have 2 physical frames available, so that rules out configuring a Zookeeper cluster/ensemble since I'd only have redundancy if the frame with the minority of servers goes down. What is the best practice in this situation? Is it possible to have a separate standalone install running on each frame connected to the same set of SOLR nodes or to use one server as primary and one as backup?

org.apache.zookeeper.server.ServerCnxn$EndOfStreamException when running test cases of Kafka Java project

2017-09-06 11:58:16.380  WARN 8376 --- [ry:/127.0.0.1:0] o.apache.zookeeper.server.NIOServerCnxn  : caught end of stream exception

org.apache.zookeeper.server.ServerCnxn$EndOfStreamException: Unable to read additional data from client sessionid 0x15e55dfd1a70001, likely client has closed socket
    at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:228) ~[zookeeper-3.4.9.jar:3.4.9-1757313]
    at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:203) [zookeeper-3.4.9.jar:3.4.9-1757313]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_112]

2017-09-06 11:58:16.381  INFO 8376 --- [ry:/127.0.0.1:0] o.apache.zookeeper.server.NIOServerCnxn  : Closed socket connection for client /127.0.0.1:53191 which had sessionid 0x15e55dfd1a70001
2017-09-06 11:58:16.427  INFO 8376 --- [127.0.0.1:53184] org.I0Itec.zkclient.ZkEventThread        : Terminate ZkClient event thread.
2017-09-06 11:58:16.428  INFO 8376 --- [0 cport:53184):] o.a.z.server.PrepRequestProcessor        : Processed session termination for sessionid: 0x15e55dfd1a70000
2017-09-06 11:58:16.494  INFO 8376 --- [           main] org.apache.zookeeper.ZooKeeper           : Session: 0x15e55dfd1a70000 closed
2017-09-06 11:58:16.496  INFO 8376 --- [           main] o.a.zookeeper.server.ZooKeeperServer     : shutting down
2017-09-06 11:58:16.497 ERROR 8376 --- [           main] o.a.zookeeper.server.ZooKeeperServer     : ZKShutdownHandler is not registered, so ZooKeeper server won't take any action on ERROR or SHUTDOWN server state changes
2017-09-06 11:58:16.497  INFO 8376 --- [           main] o.a.zookeeper.server.SessionTrackerImpl  : Shutting down
2017-09-06 11:58:16.497  INFO 8376 --- [           main] o.a.z.server.PrepRequestProcessor        : Shutting down
2017-09-06 11:58:16.497  INFO 8376 --- [           main] o.a.z.server.SyncRequestProcessor        : Shutting down
2017-09-06 11:58:16.494  INFO 8376 --- [ain-EventThread] org.apache.zookeeper.ClientCnxn          : EventThread shut down for session: 0x15e55dfd1a70000
2017-09-06 11:58:16.495  WARN 8376 --- [ry:/127.0.0.1:0] o.apache.zookeeper.server.NIOServerCnxn  : caught end of stream exception

org.apache.zookeeper.server.ServerCnxn$EndOfStreamException: Unable to read additional data from client sessionid 0x15e55dfd1a70000, likely client has closed socket
    at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:228) ~[zookeeper-3.4.9.jar:3.4.9-1757313]
    at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:203) [zookeeper-3.4.9.jar:3.4.9-1757313]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_112]

2017-09-06 11:58:16.498  INFO 8376 --- [ry:/127.0.0.1:0] o.apache.zookeeper.server.NIOServerCnxn  : Closed socket connection for client /127.0.0.1:53187 which had sessionid 0x15e55dfd1a70000
2017-09-06 11:58:16.499  INFO 8376 --- [0 cport:53184):] o.a.z.server.PrepRequestProcessor        : PrepRequestProcessor exited loop!
2017-09-06 11:58:16.499  INFO 8376 --- [   SyncThread:0] o.a.z.server.SyncRequestProcessor        : SyncRequestProcessor exited!
2017-09-06 11:58:16.500  INFO 8376 --- [           main] o.a.z.server.FinalRequestProcessor       : shutdown of request processor complete
2017-09-06 11:58:16.501  INFO 8376 --- [ry:/127.0.0.1:0] o.a.z.server.NIOServerCnxnFactory        : NIOServerCnxn factory exited run method
2017-09-06 11:58:16.506  INFO 8376 --- [ SessionTracker] o.a.zookeeper.server.SessionTrackerImpl  : SessionTrackerImpl exited loop!
2017-09-06 11:58:17.542  INFO 8376 --- [       Thread-9] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot[email protected]2de366bb: startup date [Wed Sep 06 11:58:09 IST 2017]; root of context hierarchy
2017-09-06 11:58:17.560  INFO 8376 --- [       Thread-9] o.s.c.support.DefaultLifecycleProcessor  : Stopping beans in phase 2147483647
2017-09-06 11:58:17.560  INFO 8376 --- [       Thread-9] o.s.c.support.DefaultLifecycleProcessor  : Stopping beans in phase 0

I have looked through these links where a similar exception is discussed:

I have tried using jute.maxbuffer=50000000 in zookeeper.properties file as I'm using Kafka-setup-packaged-zookeeper. This solution was mentioned in the above jira tickets. But the exception still occurred.

Any suggestions what could be the possible solution, in my case?

Apache Storm Compatibility

I tried setting up an Apache Storm Cluster, using Apache Storm 1.0.2 and Zookeeper 3.4.9. Everything worked fine, but I realized that Apache Samoa - What I'm going to use the Cluster for - is only compatible with versions of Apache Storm <1.0.0.

Thus, I downgraded all of the Apache Storm nodes to Apache Storm 0.9.4, but none of the nodes could connect to the Zookeeper. Is Apache Storm 0.9.4 only compatible with older versions of Zookeeper? If so, does anybody know what version of Zookeeper I should use?

I'm extremely new to this so forgive me for any incorrect terminology, etc, I use.

Thanks for all your help!

Unable to start Apache Zookeeper

I just tried to install Apache Zookeeper standalone in Ubuntu OS. I have installed Java environment and install Zookeeper 3.4.6.

However, when I typed JPS here are only I got.

following are the configuration for bashrc and zoo.cfg file:

[terminal~] vim .bashrc

enter image description here

[terminal~]vim /usr/local/zookeeper/conf/zoo.cfg

enter image description here

Please anyone help me. I wasted 2 days for only Zookeeper. It was really frustrated.

Failed to write pid zookeeper installing zookeeper

I was following previous posts but still not able to resolve the issue. I am trying to install zookeeper and start it to run summing-bird which is run to provide bolts/spouts to storm for online and batch. I installed zookeeper version 3.4.6 first and was getting class not found exception. After looking at the post

ClassNotFoundException for Zookeeper while building Storm

I downgraded the version to 3.3.6 and now I am not even able to start the zookeeper server. Any help will be really appreciated.

[email protected]:/users/username/zookeeper-3.3.6/bin# ./zkServer.sh start
JMX enabled by default
Using config: /users/username/zookeeper-3.3.6/bin/../conf/zoo.cfg
Starting zookeeper ... ./zkServer.sh: 93: [: /tmp/zookeeper/: unexpected  operator
./zkServer.sh: 103: ./zkServer.sh: cannot create /tmp/zookeeper/
The number of snapshots to retain in dataDir/zookeeper_server.pid: Directory   nonexistent
FAILED TO WRITE PID

This is how my zoo.cfg file looks like

# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/tmp/zookeeper/
dataLogDir=/tmp/logs/zookeeper/

# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1

server.1=10.11.10.3:2888:3888
server.2=10.11.10.4:2888:3888

This is how access looks like

drwxr-xr-x 2 username oppts-PG0    4096 Nov 25 14:35 zookeeper
drwxr-xr-x 3 root    root         4096 Nov 25 14:46 logs
drwxr-xr-x 2 root root 4096 Nov 25 14:46 logs/zookeeper