Zookeeper学习QA(待整理)

Q1:Zookeeper是什么,有什么作用?

ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services. All of these kinds of services are used in some form or another by distributed applications.

zookeeper 是一个分布式服务框架,提供以下服务支持

1.配置管理 (centralized service for maintaining configuration information)

当多机需要部署相同服务时,可以将配置信息储存在zookeeper的某目录节点中。当配置需要更新时,只需更新在zookeeper中的文件即可。当配置信息发生变化,每台应用机器会收到zookeeper的通知,然后将新的信息同步到本地。
配置管理结构图

2.统一命名服务(naming)
not so clear

3.分布式状态同步(distributed synchronization, group services)
分布式服务部署在多机,zookeeper能够帮你维护当前的集群中机器的服务状态,而且能够帮你选出一个“总管”,让这个总管来管理集群。同时维护和监控一个目录节点树中存储的数据的状态


更加细节一点的zookeeper定义:

It exposes a simple set of primitives that distributed applications can build upon to implement higher level services for synchronization, configuration maintenance, and groups and naming. It is designed to be easy to program to, and uses a data model styled after the familiar directory tree structure of file systems.

暴露一些元接口,让分布式应用通过实现更高级的服务来拥有同步,配置管理,集群,同一命名空间的能力。所以看起来kafka里应该是实现了对应的zookeeper的服务哟~。这里的familiar directory tree 更确切来说是files directories的关系。

Q2:什么一致性。

A1: ZooKeeper 主要是用来维护和监控一个目录节点树中存储的数据的状态

问题提出:zookeeper为什么需要在每台机器上部署呢?

zookeeper能够提供集群管理的功能。在每台机器上部署zookeeper的服务,通过半数选举的方式选出leader。当集群中有节点增加、减少,leader都需要知道,从而做出调整重新分配服务策略。

Q3:zookeeper的服务注册是什么呢

Q4:zookeeper保存的内容是什么

  1. 数据的更改(data changes)
  2. ACL(access control list)的更改
  3. timestamp
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值