You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Helen Williamson <he...@mindcandy.com> on 2012/11/06 18:20:42 UTC

How much logging is normal if a zookeeper ensemble isn't up?

Hiya,

I'm working on integrating zookeeper into a scala application and have
noticed a large amount of logging if *none* of the servers in the zookeeper
ensemble are available. Is this normal in this circumstance?

The logging seems to be coming from ClientCnxn and is in the form of:
10:43:51.636 TKD [run-main-SendThread(localhost:2181)] WARN
 org.apache.zookeeper.ClientCnxn - Session 0x0 for server null, unexpected
error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.6.0_37]
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:599)
~[na:1.6.0_37]
at
org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:286)
~[zookeeper-3.4.3.jar:3.4.3-1240972]
I've configured the ensemble to have 5 servers (but have obviously not
started any). I've attached an example of some of the logging output. As
you can see, initially just a couple of messages are sent. Then it looks
like ClientCnxn starts to try all the servers all the time.

Any suggestions?

Thanks, Helen
*
*

Re: How much logging is normal if a zookeeper ensemble isn't up?

Posted by Skye Wanderman-Milne <sk...@cloudera.com>.
Hi Helen,

This is normal. The ZooKeeper client will repeatedly try to connect to all
the servers you specify until it successfully connects to one. It logs
every unsuccessful attempt, leading to the noisy output you're seeing.
You'll have to start at least three servers in your ensemble in order for
the client to successfully connect (zk servers reject incoming connections
until they're part of a quorum) -- maybe you can run a local standalone
server for development purposes if you don't want to start your ensemble?

Skye

On Tue, Nov 6, 2012 at 9:20 AM, Helen Williamson <
helen.williamson@mindcandy.com> wrote:

> Hiya,
>
> I'm working on integrating zookeeper into a scala application and have
> noticed a large amount of logging if *none* of the servers in the
> zookeeper ensemble are available. Is this normal in this circumstance?
>
> The logging seems to be coming from ClientCnxn and is in the form of:
> 10:43:51.636 TKD [run-main-SendThread(localhost:2181)] WARN
>  org.apache.zookeeper.ClientCnxn - Session 0x0 for server null, unexpected
> error, closing socket connection and attempting reconnect
> java.net.ConnectException: Connection refused
> at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.6.0_37]
> at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:599)
> ~[na:1.6.0_37]
>  at
> org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:286)
> ~[zookeeper-3.4.3.jar:3.4.3-1240972]
>  I've configured the ensemble to have 5 servers (but have obviously not
> started any). I've attached an example of some of the logging output. As
> you can see, initially just a couple of messages are sent. Then it looks
> like ClientCnxn starts to try all the servers all the time.
>
> Any suggestions?
>
> Thanks, Helen
> *
> *
>