一、什么是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. Each time they are implemented there is a lot of work that goes into fixing the bugs and race conditions that are inevitable. Because of the difficulty of implementing these kinds of services, applications initially usually skimp on them, which make them brittle in the presence of change and difficult to manage. Even when done correctly, different implementations of these services lead to management complexity when the applications are deployed.
复制代码
ZooKeeper 是一个集中式服务,用于维护配置信息、命名、提供分布式同步和提供组服务。所有这些类型的服务都以某种形式被分布式应用程序使用。每次实施它们时,都会进行大量工作来修复不可避免的错误和竞争条件。由于实现这些服务比较有难度,应用程序最初通常会忽略它们,这使得它们在发生变化时变得脆弱并且难以管理。即使正确完成,这些服务的不同实现也会在部署应用程序时导致管理复杂性。
通俗来说就是相当于一个第三方协调人,被hadoop(大象)、Hive(蜜蜂)、pig(小 猪)等等分布式应用程序使用,提供的主要功能包括:配置管理、名字服务、分布式锁、集群管理。
其它角度解释:
Zookeeper从设计模式角度来理解:是一个基于观察者模式设计的分布式服务管理框架,它负责存储和管理大家都关心的数据,然后接受观察者的注册,一旦这些数据的状态发生变化,Zookeeper就将负责通知已经在Zookeeper上注册的那些观察者做出相应的反应。
举例说明:各个地方的车站将自己的票余信息发送到12306总数据库,然后用户们就可以通过12306官方APP查看某些自己关注的车票,当某个车站的车票售尽时,12306就会将相应的缺额消息发送给关心的用户。

© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
喜欢就支持一下吧
相关推荐