Return-Path: X-Original-To: apmail-zookeeper-user-archive@www.apache.org Delivered-To: apmail-zookeeper-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 127A1D4BF for ; Thu, 11 Oct 2012 01:15:22 +0000 (UTC) Received: (qmail 70616 invoked by uid 500); 11 Oct 2012 01:15:21 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 70559 invoked by uid 500); 11 Oct 2012 01:15:20 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Received: (qmail 70548 invoked by uid 99); 11 Oct 2012 01:15:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Oct 2012 01:15:20 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.160.42] (HELO mail-pb0-f42.google.com) (209.85.160.42) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Oct 2012 01:15:12 +0000 Received: by mail-pb0-f42.google.com with SMTP id ro2so1078039pbb.15 for ; Wed, 10 Oct 2012 18:14:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=Tchp85cmBclmvHeQ7RrzFMoIn3j6+K0VFzxs2cNmvCs=; b=aB+XpFN2+kCY9AIOHADra0Pbx4j2jLXROgsrSJqUzFljnJdurK/O2UL2orydASP2xM 0HCAZZYsdjGdSQKpJsooE17hU/pRhnCAkuBq7vFyXBtOouvWtMealeTC6DqymwzFcajT LLlELoClO77GGrfOBDDg4w6ovHSsbGdMhaja8Mj2iQkzz9oPfofqrm+KPw5KO9nLmqWa 8Wp3V3i/kFIxaEMXA8DpQ8sVJm9bugCNVZifmE79aFp2FhiaTMpPTIecQ/j6DrzTxOT2 yeEUoVP8edbIX+WJJxW4+um557VHf/kdlBPgJrrU7UZCfp3w6T+c1yIh8OBAS1qSivlA ZPCA== Received: by 10.68.129.5 with SMTP id ns5mr78479001pbb.103.1349918092256; Wed, 10 Oct 2012 18:14:52 -0700 (PDT) Received: from blueberry.local (204.11.231.122.static.etheric.net. [204.11.231.122]) by mx.google.com with ESMTPS id ky6sm1828555pbc.18.2012.10.10.18.14.50 (version=SSLv3 cipher=OTHER); Wed, 10 Oct 2012 18:14:51 -0700 (PDT) Message-ID: <50761D88.3050903@peaxy.net> Date: Wed, 10 Oct 2012 18:14:48 -0700 From: Joe Lin User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: user@zookeeper.apache.org Subject: disconnected from zk server upon client start Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQktDjpZAxH3kMxK+MykZobT7kXcZL4WcauiL7EAaM+GtsCVhJVebbNolJsp/jETR7zoeP0w X-Virus-Checked: Checked by ClamAV on apache.org Hi, I'm using the zk Java client to connect to zk server on the localhost. The client got disconnected right away after the connection is established and the session got expired. What is the reason that the server terminates the connection? Is there any flag I should specify when creating the client? The client is created with: zk = new ZooKeeper("127.0.0.1:2181", 7000, new Watcher() { @Override public void process(WatchedEvent event) { KeeperState ks = event.getState(); logger.debug("zk state:" + ks); if ( ks == KeeperState.SyncConnected ) { logger.debug("zk client connected"); com.peaxy.event.Event e = new com.peaxy.event.Event(EventType.DCS_READY, null); EventService.getInstance().publish(e); } } }); And the following is the server log: 012-10-10 18:01:20,548 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@213] - Accepted socket connection from /127.0.0.1:59703 2012-10-10 18:01:20,549 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@831] - Client attempting to renew session 0x13a4d47eea50003 at /127.0.0.1:59703 2012-10-10 18:01:20,550 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@597] - Invalid session 0x13a4d47eea50003 for client /127.0.0.1:59703, probably expired 2012-10-10 18:01:20,551 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1000] - Closed socket connection for client /127.0.0.1:59703 which had sessionid 0x13a4d47eea50003