You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by Dave Cahill <dc...@midokura.com> on 2013/05/01 04:16:54 UTC

Dumping and loading Zookeeper data

Hi,

I've been looking at a few options for dumping and loading Zookeeper data.
If anyone here can provide insight on the current state of tools and what I
should use, that would be great.

First, I tried zktreeutil from the zookeeper-bin (3.4.5) package:
zktreeutil -z localhost:2181 -E

I can connect to that address using telnet and another zookeeper dumping
tool
(guano), but zktreeutil gives me:

[zktreeutil] zooKeeper exception caught: Unable to connect to ZK running at
'localhost:2181'; state=999
terminate called after throwing an instance of '2013-05-01
10:55:38,990:18626(0x7f7240369700):ZOO_INFO@check_events@1703: initiated
connection to server [127.0.0.1:2181]
zktreeutil::ZooKeeperException'
  what():  Unable to connect to ZK running at 'localhost:2181'; state=999
Aborted (core dumped)

The above is running Ubuntu 12.04.1 LTS (Precise).

I noticed that there were several patches submitted to zktree-util ([1] and
[2]), but it seems none of them have been accepted - is the tool deprecated?

I then tried guano [3]. This tool dumped the zookeeper data to a folder
structure rather than XML, but it did seem to work. If I don't find other
options, I'll go with this, but since it's outside zookeeper core and was
last updated 10 months ago, I wasn't sure about it.

At StackOverflow [4], someone mentioned zkConfig.py, a "contributed project
when you install zookeeper", but I can't seem to find it in the current
code.
I did find zk_dump_tree.py in the current source code checkout, but it
seems
to use a separate REST server, which doesn't seem ideal.

That's as far as I've gotten in my investigation - kind of a confusing
picture, so any insights appreciated!

Thanks,
Dave.



[1] ZOOKEEPER-1218, Apr 2012 -
https://issues.apache.org/jira/browse/ZOOKEEPER-1218
[2] ZOOKEEPER-1445, May 2012 -
https://issues.apache.org/jira/browse/ZOOKEEPER-1445
[3] https://github.com/dietrichf/guano
[4] http://stackoverflow.com/questions/6394140/how-do-you-backup-zookeeper

Re: Dumping and loading Zookeeper data

Posted by Dave Cahill <dc...@midokura.com>.
Thanks Ivan!

Actually, when I realized how little code was involved, I ended up writing
a simple dump and load tool on top of python-zookeeper instead of using
other libraries. :)

Thanks,
Dave.


On Mon, May 6, 2013 at 9:37 PM, Ivan Kelly <iv...@apache.org> wrote:

> On Wed, May 01, 2013 at 11:16:54AM +0900, Dave Cahill wrote:
> > I then tried guano [3]. This tool dumped the zookeeper data to a folder
> > structure rather than XML, but it did seem to work. If I don't find other
> > options, I'll go with this, but since it's outside zookeeper core and was
> > last updated 10 months ago, I wasn't sure about it.
> If it uses the stock ZK client, it doesn't really matter if its
> outside core. The main api will stay compatible, if there are
> compatibility issues, you can just bump the version number in the pom.
>
> -Ivan
>

Re: Dumping and loading Zookeeper data

Posted by Ivan Kelly <iv...@apache.org>.
On Wed, May 01, 2013 at 11:16:54AM +0900, Dave Cahill wrote:
> I then tried guano [3]. This tool dumped the zookeeper data to a folder
> structure rather than XML, but it did seem to work. If I don't find other
> options, I'll go with this, but since it's outside zookeeper core and was
> last updated 10 months ago, I wasn't sure about it.
If it uses the stock ZK client, it doesn't really matter if its
outside core. The main api will stay compatible, if there are
compatibility issues, you can just bump the version number in the pom.

-Ivan