I can't comment much on this, except that this is a very odd usage pattern.
First, it isn't so unusual, but I find it a particularly bad practice to
embed ZK into your application. The problem is that you lose a lot of the
virtues of ZK in terms of coordination if ZK goes down with your
application. In a nutshell, what good is a coordination layer if it isn't
relatively permanent. For instance, one important use of a coordination
layer is to avoid multiple invocations of an expensive component on a
machine. You can't do that unless you share a ZK cluster between all
invocations of the component. Similarly, restarting you application is much
more common than restarting ZK, but by connecting the two of these, you
again lose any ability to make configuration persistent and you lose the
ability to restart one piece of your application without restarting your ZK
at the same time. This coupling between restarts of very different service
components is a very bad idea. Better to have simple components that serve
simple ends. ZK is relatively simple, very stable and does one job well.
Why mess with that?
Secondly, why in the world are you connecting to the local ZK server? Why
not to the cluster at large? By connecting to only a single server you lose
all the benefits of high availability in the ZK layer because the client
can't fail-over to other servers. Likewise, by using the local loopback
address, you make it much harder to understand your server logs. The amount
of data moved to and from a ZK cluster is typically relatively small so
there is no significant benefit to keeping the traffic local to a single
Thirdly, I suspect that associated with your somewhat idiosyncratic
architecture is some slightly odd ZK configuration. Could you post your
configuration files? Your log files make it sound like the cluster might be
confused about itself.
On Thu, Aug 5, 2010 at 1:20 PM, Vishal K <vishalm...@gmail.com> wrote:
> I am seeing a lot of these messages in our application. I would like to
> if I am doing something wrong or this is a ZK bug.
> - Server environment:zookeeper.version=3.3.0-925362
> - 3 node cluster
> - Each node has few clients that connect to the local server using
> as the host IP.
> - The application first forms a ZK cluster. Once the ZK cluster is formed,
> each node establish sessions with local ZK servers. The clients do not know
> about remote server so sessions are always with the local server.
> As soon as ZK clients connected to their respective follower, the ZK leader
> starts spitting the following messages: