Discussion:
zookeeper connection loss exception occurs on new created ZooKeeper instance too much,why?
Isaac
2011-09-07 07:32:17 UTC
Permalink
zookeeper connection loss exception occurs on new created ZooKeeper instance
too much

code like this:
ZooKeeper zk = new ZooKeeper(connectString, 3000, defaultWatcher);
zk.exists("/"); //connection loss exception occurs here sometimes.

any one knows why?
Isaac
2011-09-07 07:48:46 UTC
Permalink
oh, i found this, operate on a zookeeper in status CONNECTING will throw a
ConnectionLossException.
maybe that's the problem.
example:
[zk: 172.27.1.1:8082(CONNECTING) 1] ls /
Exception in thread "main" org.apache.zookeeper.KeeperException$
ConnectionLossException: KeeperErrorCode = ConnectionLoss for /
at
org.apache.zookeeper.KeeperException.create(KeeperException.java:90)
at
org.apache.zookeeper.KeeperException.create(KeeperException.java:42)
at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:1243)
at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:1271)
at
org.apache.zookeeper.ZooKeeperMain.processZKCmd(ZooKeeperMain.java:700)
at
org.apache.zookeeper.ZooKeeperMain.processCmd(ZooKeeperMain.java:581)
at
org.apache.zookeeper.ZooKeeperMain.executeLine(ZooKeeperMain.java:353)
at org.apache.zookeeper.ZooKeeperMain.run(ZooKeeperMain.java:311)
at org.apache.zookeeper.ZooKeeperMain.main(ZooKeeperMain.java:270)
Post by Isaac
zookeeper connection loss exception occurs on new created ZooKeeper
instance too much
ZooKeeper zk = new ZooKeeper(connectString, 3000, defaultWatcher);
zk.exists("/"); //connection loss exception occurs here sometimes.
any one knows why?
Mahadev Konar
2011-09-07 07:58:57 UTC
Permalink
Isaac,
You should wait for the state to be connected before issuing the requests.

Take a look at the javadoc:

http://bit.ly/oC6TEb

hope that helps
mahadev
oh, i found this, operate on a zookeeper in status  CONNECTING will throw a
ConnectionLossException.
maybe that's the problem.
[zk: 172.27.1.1:8082(CONNECTING) 1] ls /
Exception in thread "main" org.apache.zookeeper.KeeperException$
ConnectionLossException: KeeperErrorCode = ConnectionLoss for /
       at
org.apache.zookeeper.KeeperException.create(KeeperException.java:90)
       at
org.apache.zookeeper.KeeperException.create(KeeperException.java:42)
       at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:1243)
       at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:1271)
       at
org.apache.zookeeper.ZooKeeperMain.processZKCmd(ZooKeeperMain.java:700)
       at
org.apache.zookeeper.ZooKeeperMain.processCmd(ZooKeeperMain.java:581)
       at
org.apache.zookeeper.ZooKeeperMain.executeLine(ZooKeeperMain.java:353)
       at org.apache.zookeeper.ZooKeeperMain.run(ZooKeeperMain.java:311)
       at org.apache.zookeeper.ZooKeeperMain.main(ZooKeeperMain.java:270)
Post by Isaac
zookeeper connection loss exception occurs on new created ZooKeeper
instance too much
ZooKeeper zk = new ZooKeeper(connectString, 3000, defaultWatcher);
zk.exists("/");  //connection loss exception occurs here sometimes.
any one knows why?
Uday Subbarayan
2011-09-07 18:17:49 UTC
Permalink
Mahadev,
            I mean the data that we store in ZK is currently persisted in a file system. The config file has the location and ZK stores the data in that location. For security reasons, we are wondering whether we can store our data in a database?

*We are fine to have the current mechanism of config file in a file system.

Thanks,
-Uday.
 
-------------------------
I do not blog but e-write:
http://uds-web.blogspot.com


________________________________
From: Mahadev Konar <mahadev-RYNwJFaOa9CEK/***@public.gmane.org>
To: user-jljoq6hZe7LTxqt0kkDzDmD2FQJk+8+***@public.gmane.org
Sent: Wednesday, September 7, 2011 12:58 AM
Subject: Re: zookeeper connection loss exception occurs on new created ZooKeeper instance too much,why?

Isaac,
You should wait for the state to be connected before issuing the requests.

Take a look at the javadoc:

http://bit.ly/oC6TEb

hope that helps
mahadev
oh, i found this, operate on a zookeeper in status  CONNECTING will throw a
ConnectionLossException.
maybe that's the problem.
[zk: 172.27.1.1:8082(CONNECTING) 1] ls /
Exception in thread "main" org.apache.zookeeper.KeeperException$
ConnectionLossException: KeeperErrorCode = ConnectionLoss for /
       at
org.apache.zookeeper.KeeperException.create(KeeperException.java:90)
       at
org.apache.zookeeper.KeeperException.create(KeeperException.java:42)
       at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:1243)
       at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:1271)
       at
org.apache.zookeeper.ZooKeeperMain.processZKCmd(ZooKeeperMain.java:700)
       at
org.apache.zookeeper.ZooKeeperMain.processCmd(ZooKeeperMain.java:581)
       at
org.apache.zookeeper.ZooKeeperMain.executeLine(ZooKeeperMain.java:353)
       at org.apache.zookeeper.ZooKeeperMain.run(ZooKeeperMain.java:311)
       at org.apache.zookeeper.ZooKeeperMain.main(ZooKeeperMain.java:270)
Post by Isaac
zookeeper connection loss exception occurs on new created ZooKeeper
instance too much
ZooKeeper zk = new ZooKeeper(connectString, 3000, defaultWatcher);
zk.exists("/");  //connection loss exception occurs here sometimes.
any one knows why?
Mahadev Konar
2011-09-07 18:47:10 UTC
Permalink
Uday,
I dont see why you'd want to do that? For security you could run ZK
as a user only which can access the data/snapshot dir for the ZK
servers. I am not sure how putting it in database would make it more
secure?

thanks
mahadev

On Wed, Sep 7, 2011 at 11:17 AM, Uday Subbarayan
Post by Uday Subbarayan
Mahadev,
            I mean the data that we store in ZK is currently persisted in a file system. The config file has the location and ZK stores the data in that location. For security reasons, we are wondering whether we can store our data in a database?
*We are fine to have the current mechanism of config file in a file system.
Thanks,
-Uday.
-------------------------
http://uds-web.blogspot.com
________________________________
Sent: Wednesday, September 7, 2011 12:58 AM
Subject: Re: zookeeper connection loss exception occurs on new created ZooKeeper instance too much,why?
Isaac,
You should wait for the state to be connected before issuing the requests.
http://bit.ly/oC6TEb
hope that helps
mahadev
oh, i found this, operate on a zookeeper in status  CONNECTING will throw a
ConnectionLossException.
maybe that's the problem.
[zk: 172.27.1.1:8082(CONNECTING) 1] ls /
Exception in thread "main" org.apache.zookeeper.KeeperException$
ConnectionLossException: KeeperErrorCode = ConnectionLoss for /
       at
org.apache.zookeeper.KeeperException.create(KeeperException.java:90)
       at
org.apache.zookeeper.KeeperException.create(KeeperException.java:42)
       at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:1243)
       at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:1271)
       at
org.apache.zookeeper.ZooKeeperMain.processZKCmd(ZooKeeperMain.java:700)
       at
org.apache.zookeeper.ZooKeeperMain.processCmd(ZooKeeperMain.java:581)
       at
org.apache.zookeeper.ZooKeeperMain.executeLine(ZooKeeperMain.java:353)
       at org.apache.zookeeper.ZooKeeperMain.run(ZooKeeperMain.java:311)
       at org.apache.zookeeper.ZooKeeperMain.main(ZooKeeperMain.java:270)
Post by Isaac
zookeeper connection loss exception occurs on new created ZooKeeper
instance too much
ZooKeeper zk = new ZooKeeper(connectString, 3000, defaultWatcher);
zk.exists("/");  //connection loss exception occurs here sometimes.
any one knows why?
Uday Subbarayan
2011-09-07 22:09:47 UTC
Permalink
Mahadev,
             There are couple of reasons:
a) We want to use our Web GUI to create/update/delete the data. (which is basically our own internal configuration information) This helps our operation team don't have to use any external tool for handling ZK data.
b)We have to run separate file servers for this particular usage. If it's in database, it's easy to extend our web gui and then use the existing mechanism for the data backup.

Best,
-Uday.
 


________________________________
From: Mahadev Konar <mahadev-RYNwJFaOa9CEK/***@public.gmane.org>
To: ***@zookeeper.apache.org; Uday Subbarayan <uday.subbarayan-/***@public.gmane.org>
Sent: Wednesday, September 7, 2011 11:47 AM
Subject: Re: zookeeper connection loss exception occurs on new created ZooKeeper instance too much,why?

Uday,
I dont see why you'd want to do that? For security you could run ZK
as a user only which can access the data/snapshot dir for the ZK
servers. I am not sure how putting it in database would make it more
secure?

thanks
mahadev

On Wed, Sep 7, 2011 at 11:17 AM, Uday Subbarayan
Post by Uday Subbarayan
Mahadev,
            I mean the data that we store in ZK is currently persisted in a file system. The config file has the location and ZK stores the data in that location. For security reasons, we are wondering whether we can store our data in a database?
*We are fine to have the current mechanism of config file in a file system.
Thanks,
-Uday.
-------------------------
http://uds-web.blogspot.com
________________________________
Sent: Wednesday, September 7, 2011 12:58 AM
Subject: Re: zookeeper connection loss exception occurs on new created ZooKeeper instance too much,why?
Isaac,
You should wait for the state to be connected before issuing the requests.
http://bit.ly/oC6TEb
hope that helps
mahadev
oh, i found this, operate on a zookeeper in status  CONNECTING will throw a
ConnectionLossException.
maybe that's the problem.
[zk: 172.27.1.1:8082(CONNECTING) 1] ls /
Exception in thread "main" org.apache.zookeeper.KeeperException$
ConnectionLossException: KeeperErrorCode = ConnectionLoss for /
       at
org.apache.zookeeper.KeeperException.create(KeeperException.java:90)
       at
org.apache.zookeeper.KeeperException.create(KeeperException.java:42)
       at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:1243)
       at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:1271)
       at
org.apache.zookeeper.ZooKeeperMain.processZKCmd(ZooKeeperMain.java:700)
       at
org.apache.zookeeper.ZooKeeperMain.processCmd(ZooKeeperMain.java:581)
       at
org.apache.zookeeper.ZooKeeperMain.executeLine(ZooKeeperMain.java:353)
       at org.apache.zookeeper.ZooKeeperMain.run(ZooKeeperMain.java:311)
       at org.apache.zookeeper.ZooKeeperMain.main(ZooKeeperMain.java:270)
Post by Isaac
zookeeper connection loss exception occurs on new created ZooKeeper
instance too much
ZooKeeper zk = new ZooKeeper(connectString, 3000, defaultWatcher);
zk.exists("/");  //connection loss exception occurs here sometimes.
any one knows why?
Ted Dunning
2011-09-07 22:34:04 UTC
Permalink
On Wed, Sep 7, 2011 at 3:09 PM, Uday Subbarayan
Post by Uday Subbarayan
Mahadev,
a) We want to use our Web GUI to create/update/delete the data. (which is
basically our own internal configuration information) This helps our
operation team don't have to use any external tool for handling ZK data.
This is trivial to do. Probably the easiest way would be to use a java web
framework of some kind to build a simple access interface. JSP would work
fine for this. The Python binding would also allow you to use Django.
Post by Uday Subbarayan
b)We have to run separate file servers for this particular usage. If it's
in database, it's easy to extend our web gui and then use the existing
mechanism for the data backup.
If the data is in a database, it isn't really Zookeeper. You will have
abysmal performance since Zookeeper assumes that it can scan things quickly
(as for the snapshot or resync operations). It might be possible to
re-engineer the data table underneath Zookeeper to be stored in a database
instead of in memory, but that is really fairly perverse.

Backing up Zookeeper is trivial. All you have to do is grab the snapshot
and logs.
Isaac
2011-09-08 10:55:49 UTC
Permalink
oh,i see. thanks for help. :)
Post by Mahadev Konar
Isaac,
You should wait for the state to be connected before issuing the requests.
http://bit.ly/oC6TEb
hope that helps
mahadev
Post by Isaac
oh, i found this, operate on a zookeeper in status CONNECTING will throw
a
Post by Isaac
ConnectionLossException.
maybe that's the problem.
[zk: 172.27.1.1:8082(CONNECTING) 1] ls /
Exception in thread "main" org.apache.zookeeper.KeeperException$
ConnectionLossException: KeeperErrorCode = ConnectionLoss for /
at
org.apache.zookeeper.KeeperException.create(KeeperException.java:90)
at
org.apache.zookeeper.KeeperException.create(KeeperException.java:42)
at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:1243)
at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:1271)
at
org.apache.zookeeper.ZooKeeperMain.processZKCmd(ZooKeeperMain.java:700)
at
org.apache.zookeeper.ZooKeeperMain.processCmd(ZooKeeperMain.java:581)
at
org.apache.zookeeper.ZooKeeperMain.executeLine(ZooKeeperMain.java:353)
at org.apache.zookeeper.ZooKeeperMain.run(ZooKeeperMain.java:311)
at org.apache.zookeeper.ZooKeeperMain.main(ZooKeeperMain.java:270)
Post by Isaac
zookeeper connection loss exception occurs on new created ZooKeeper
instance too much
ZooKeeper zk = new ZooKeeper(connectString, 3000, defaultWatcher);
zk.exists("/"); //connection loss exception occurs here sometimes.
any one knows why?
Joe Zou (jozou)
2011-09-13 02:23:12 UTC
Permalink
If your zookeeper cluster is ok, maybe you sessionTimeout is too small, pelease increase the sessionTimeout, eg:
ZooKeeper zk = new ZooKeeper(connectString, 12000, defaultWatcher);
Thanks
Joe Zou

-----Original Message-----
From: Isaac [mailto:***@gmail.com]
Sent: Wednesday, September 07, 2011 15:49
To: ***@zookeeper.apache.org
Subject: Re: zookeeper connection loss exception occurs on new created ZooKeeper instance too much,why?

oh, i found this, operate on a zookeeper in status CONNECTING will throw a
ConnectionLossException.
maybe that's the problem.
example:
[zk: 172.27.1.1:8082(CONNECTING) 1] ls /
Exception in thread "main" org.apache.zookeeper.KeeperException$
ConnectionLossException: KeeperErrorCode = ConnectionLoss for /
at
org.apache.zookeeper.KeeperException.create(KeeperException.java:90)
at
org.apache.zookeeper.KeeperException.create(KeeperException.java:42)
at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:1243)
at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:1271)
at
org.apache.zookeeper.ZooKeeperMain.processZKCmd(ZooKeeperMain.java:700)
at
org.apache.zookeeper.ZooKeeperMain.processCmd(ZooKeeperMain.java:581)
at
org.apache.zookeeper.ZooKeeperMain.executeLine(ZooKeeperMain.java:353)
at org.apache.zookeeper.ZooKeeperMain.run(ZooKeeperMain.java:311)
at org.apache.zookeeper.ZooKeeperMain.main(ZooKeeperMain.java:270)
Post by Isaac
zookeeper connection loss exception occurs on new created ZooKeeper
instance too much
ZooKeeper zk = new ZooKeeper(connectString, 3000, defaultWatcher);
zk.exists("/"); //connection loss exception occurs here sometimes.
any o
Loading...