Hi -

This is designed behaviour. In the latest version, the exception
thrown will be labeled "Responded to info probe". The server
disconnects connections that send four-letter commands deliberately -
I'm guessing because these tend to be one-shot commands and keeping a
socket around indefinitely is wasteful.

If you want to persist your connection you must serialise a connection
request and then negotiate the connection protocol with the server.
This is quite tricky to do by hand! The Java / C client shells support
this though (although they don't support the four-letter word commands
like 'ruok') and are probably easier to use if you want to send
commands interactively.

Hope this helps,

Henry

On Wed, May 13, 2009 at 2:26 AM, Qian Ye <yeqian....@gmail.com> wrote:
> Hi guys,
>
> I have a question about connecting to zookeeper by nc or telnet. I ran
> zookeeper in Multi-Server mode, and connected to the server using $nc
> 127.0.0.1 2181. So far, all works. Then I tried command "stat", it showed
> the following:
>
> Zookeeper version: 3.1.1-755636, built on 03/18/2009 16:52 GMT
> Clients:
>  /127.0.0.1:32818[1](queued=0,recved=0,sent=0)
>
> Latency min/avg/max: 1/2/3
> Received: 217
> Sent: 218
> Outstanding: 0
> Zxid: 0x4
> Mode: follower
> Node count: 4
> 2009-05-13 17:16:51,615 - WARN  [NIOServerCxn.Factory:2181:nioserverc...@417]
> - Exception causing close of session 0x0 due to java.io.IOException: closing
> 2009-05-13 17:16:51,615 - INFO  [NIOServerCxn.Factory:2181:nioserverc...@752]
> - closing session:0x0 NIOServerCnxn:
> java.nio.channels.SocketChannel[connected local=/127.0.0.1:2181 remote=/
> 127.0.0.1:32818]
>
> and return to the shell.
>
> The last two lines were issued by log4j (I think, I'm not so familiar with
> things about Java :-p). It seems that java.io.IOException was thrown for
> some reason. I'm not sure about why this happened. Could any one give me
> some help?
>
> --
> With Regards!
>
> Ye, Qian
> Made in Zhejiang University
>

Reply via email to