You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by 吴靖 <qh...@126.com> on 2013/03/20 08:15:16 UTC

Confused with zookeeper!!!

hi, guys!


 I am new to zookeeper.  and I 'm quite confused with zookeeper, as i know zookeeper is a  coordination service for distributed applications. In Hbase,Zookeeper keeps all the meta data of the Hbase nodes,so all the node can see the same meta data, this is the coordination service.
  but what confused me is how to used zookeeper ? for example If  we have a distributed system, and we need to unify the configuration files for all nodes, how can we use the zookeeper? Just put the configuration files in zookeeper(znode) and let the distributed nodes read from zookeeper?


thank you !

Re: Confused with zookeeper!!!

Posted by nileader <ni...@gmail.com>.
Thanks Chris. And I can tell you some useful links in Chinese.

First, you will need to have a overview for zookeeper: 《分布式服务框架 Zookeeper
-- 管理分布式环境中的数据》
http://www.ibm.com/developerworks/cn/opensource/os-cn-zookeeper/

Then,you may have no alternative but to want to do this thing, so
《ZooKeeper管理员指南——部署与管理ZooKeeper》will help you to build you own zookeeper
cluster. http://rdc.taobao.com/team/jm/archives/2318

Next,you just want to use zookeeper in you program, Now, 《ZooKeeper Java
API 使用样例》http://nileader.blog.51cto.com/1381108/795265

After you can use zookeepr in a simple way, you need to know typical scene
for zookeepr, so, 《ZooKeeper典型应用场景一览》
http://rdc.taobao.com/team/jm/archives/1232


Finally,zookeeper home page, it's always useful! http://zookeeper.apache.org



*nileader* ni掌櫃的個人郵箱
*MSN*: nileader@gmail.com
*Weibo*:http://weibo.com/nileader
————————————————————————————————————————————————————————————————————————
This email (including any attachments) is confidential and may be legally
privileged, private information of correct recipient and nileader. If you
received this email in error, please delete it immediately and do not copy
it or use it for any purpose or disclose its contents to any other person.
Thank you.
*
本電郵(包括任何附件)可能含有機密資料並受法律保護,屬於ni掌櫃和正確收件人之間的私有信息。如您不是正確的收件人,請您立即刪除本郵件。請不要將本電郵進行複製並用作任何其它用途,或透露本郵件之內容。謝謝。
*


2013/3/21 Chris Brinley <Ch...@morningstar.com>

> As someone recently new to zookeeper myself I can see the confusion. Here
> is what I can suggest and I'm sure others will have far more experienced
> input:
>
> To keep things simple I will skip over some details and features.
>
> Zookeeper is essentially an in memory replicated tree. This means any data
> you can represent as a tree can be placed in zookeeper and clients can
> register to listen for changes to that tree. Mapping a basic XML document
> to this model is probably easiest to understand.
> Each node in zookeeper can represent a tag in the xml with the same sort
> of hierarchy.
>
> The nodes themselves can have arbitrary data associated with them, though
> off hand I'm not sure what the size and type limitations are.
> But continuing this example the nodes of XML usually have attributes
> associated with them and maybe some content between the open/close tags.
> If you were mapping this onto zookeeper one option would be to put those
> attributes and perhaps even the content between open/close tags as node
> data. You could of course make a sub-node in the tree to represent the
> content between open/close tags.
>
> That's essentially it. Some of the practical challenges will likely center
> around how your apps currently read config data. These are the areas that
> need to be translated into zookeeper compatible logic. Also where today
> you may start and read config once to fully take advantage of zookeeper
> you'd likely want to react dynamically as state changes in zoookeeper,
> though this can obviously be a latter phase as much difficulty can be
> hidden here. Depending on how you abstract configuration load/read in your
> code today this may or may not represent a big migration challenge.
>
> I'm sure there are many follow on questions but hopefully this gives you
> some context to start with.
> Also if you brand new to zookeeper you might want to checkout Curator
> which can help lower the learning curve by handling some of the
> housekeeping required of the client. This client also implements some
> common usage patterns (few of which you listed in your question).
>
> Regards,
>
> On 3/20/13 2:15 AM, "吴靖" <qh...@126.com> wrote:
>
> >hi, guys!
> >
> >
> > I am new to zookeeper.  and I 'm quite confused with zookeeper, as i
> >know zookeeper is a  coordination service for distributed applications.
> >In Hbase,Zookeeper keeps all the meta data of the Hbase nodes,so all the
> >node can see the same meta data, this is the coordination service.
> >  but what confused me is how to used zookeeper ? for example If  we have
> >a distributed system, and we need to unify the configuration files for
> >all nodes, how can we use the zookeeper? Just put the configuration files
> >in zookeeper(znode) and let the distributed nodes read from zookeeper?
> >
> >
> >thank you !
>
>

Re: Confused with zookeeper!!!

Posted by Chris Brinley <Ch...@morningstar.com>.
As someone recently new to zookeeper myself I can see the confusion. Here
is what I can suggest and I'm sure others will have far more experienced
input:

To keep things simple I will skip over some details and features.

Zookeeper is essentially an in memory replicated tree. This means any data
you can represent as a tree can be placed in zookeeper and clients can
register to listen for changes to that tree. Mapping a basic XML document
to this model is probably easiest to understand.
Each node in zookeeper can represent a tag in the xml with the same sort
of hierarchy.

The nodes themselves can have arbitrary data associated with them, though
off hand I'm not sure what the size and type limitations are.
But continuing this example the nodes of XML usually have attributes
associated with them and maybe some content between the open/close tags.
If you were mapping this onto zookeeper one option would be to put those
attributes and perhaps even the content between open/close tags as node
data. You could of course make a sub-node in the tree to represent the
content between open/close tags.

That's essentially it. Some of the practical challenges will likely center
around how your apps currently read config data. These are the areas that
need to be translated into zookeeper compatible logic. Also where today
you may start and read config once to fully take advantage of zookeeper
you'd likely want to react dynamically as state changes in zoookeeper,
though this can obviously be a latter phase as much difficulty can be
hidden here. Depending on how you abstract configuration load/read in your
code today this may or may not represent a big migration challenge.

I'm sure there are many follow on questions but hopefully this gives you
some context to start with.
Also if you brand new to zookeeper you might want to checkout Curator
which can help lower the learning curve by handling some of the
housekeeping required of the client. This client also implements some
common usage patterns (few of which you listed in your question).

Regards,

On 3/20/13 2:15 AM, "吴靖" <qh...@126.com> wrote:

>hi, guys!
>
>
> I am new to zookeeper.  and I 'm quite confused with zookeeper, as i
>know zookeeper is a  coordination service for distributed applications.
>In Hbase,Zookeeper keeps all the meta data of the Hbase nodes,so all the
>node can see the same meta data, this is the coordination service.
>  but what confused me is how to used zookeeper ? for example If  we have
>a distributed system, and we need to unify the configuration files for
>all nodes, how can we use the zookeeper? Just put the configuration files
>in zookeeper(znode) and let the distributed nodes read from zookeeper?
>
>
>thank you !