zookeeper快速指导

所需积分/C币:10 2017-04-07 23:00:26 156KB PDF
2
收藏 收藏
举报

zookeeper快速指导
1 introduction what? A Distributed coordination service for distributed Applications Do? synchronization, configuration maintenance, and groups and naming 1 introduction Zookeeper Ensemble Cents Lookee per Server Architecture Follower client, server Ensemble,leader Follower Clent2 Zookeeper Server Follower Cents Zookeeper Server Leader Clients Z。。 kee per Server Follower Clents zo。 ee per server Follower 1 introduction Hierarchical namespace znode: ZooKeeper节点称为 znode。每个 znode都由一个名称标识,并由路径序列 (/)分隔 stat: ZooKeeper数据模型中的每个 znode都 /consig workers 维护一个统计结构。stat只是提供 znode的 元数据。它由版木号,操作控制列表 (ACL),时间戳和数据长度组成 Znode类型: Znode分为持续性,顺序和临 /ap。1 时 lapp / p1 /app2/p2/a1 2/0282 1 introduction Session Watches session:客户端以特定时间间隔发送心跳以保持会话有效 毫秒级别 Clients Lookee per Server Follower Lookee per server watch:是一种简单的机制,可让客户端收到关于 Follower Z0 kEeper系列的更改的通知 Clents Zookeeper Serve Leader ClientCnxn Event Thread--process, SendThread--dolO zo。 kee per serv Fol ower Clents zo。 Kee per serve Follower 2 Installation 1 dOwnload Zookeeper--Http: //zookeeper. apache org/releases. html 2 Extract the tar filel --s tar-zxf zookeeper-3.4.6. tar.gz 3 Create configuration file clientPort=2182 2183 2184 data Dir=/ home/zww.zhang/z2-4/ data server2=127.00.1:3333:3334 server.3=127.0.0.1:4444:4445 server4=127.0.0.1:5555:5556 4FZserver --Zookeeper-349/bin/zkServersh start 22-4/22-4.cfg zookeeper-3.4.9/bin//zkCli sh 3 Java Binding AP org. apache zookeeper. zookeeper 1 connect-connect to the Zookeeper ensemble ZooKeeper( String connection String int sessionTimeout, Watcher watcher) 2 create-create a znode create String path, bytel data, List<ACL> acl, Create Mode create Mode) 3 exists-check whether a znode exists and its information exists(String path, boolean watcher 4 getData-get data from a particular znode getData( String path, Watcher watcher, Stat stat) 5 setData-set data in a particular znode setData(String path byte[] data, int version) 6 getChildren-get all sub-nodes available in a particular znode get children(String path Watcher watcher 7 delete -get a particular znode and all its children delete(String path, int version) 8 close-close a connection

...展开详情
试读 8P zookeeper快速指导
立即下载 低至0.43元/次 身份认证VIP会员低至7折
一个资源只可评论一次,评论内容不能少于5个字
您会向同学/朋友/同事推荐我们的CSDN下载吗?
谢谢参与!您的真实评价是我们改进的动力~
  • 签到新秀

    累计签到获取,不积跬步,无以至千里,继续坚持!
  • 分享小兵

    成功上传3个资源即可获取
关注 私信
上传资源赚积分or赚钱
最新推荐
zookeeper快速指导 10积分/C币 立即下载
1/8
zookeeper快速指导第1页
zookeeper快速指导第2页

试读结束, 可继续读1页

10积分/C币 立即下载 >