AI基础进行中... Zookeeper简介 Apache ZooKeeper is an effort to develop and maintain an open-source server which enables highly reliable distributed coordination. ZooKeeper is a high-performance coordination service for distributed applications. It exposes common services - such as naming, configuration management, synchronization, and group services - in a simple interface so you don't have to write them from scratch. You can use it off-the-shelf to implement consensus, group management, leader election, and presence protocols. And you can build on it for your own, specific needs.Apache ZooKeeper致力于提供一个高可用、高性能、开源的分布式应用协调服务。它为分布式应用提供一致性保障,常用的服务包括:命名系统、配置管理、分布式同步、组服务等。你通过一些简单的接口就可以轻而易举的获得一些功能,例如一致性维护、组管理、leader选举;同样的,你可以基于它来实现自己想要的其它功能。 ZooKeeper是以Fast Paxos算法为基础的,Paxos算法存在活锁的问题,即当有多个proposer交错提交时,有可能互相排斥导致没有一个proposer能提交成功,而Fast Paxos作了一些优化,通过选举产生一个leader (领导者),只有leader才能提交proposer,具体算法可见Fast Paxos。因此,要想弄懂ZooKeeper首先得对Fast Paxos有所了解。 设计目的+ 易用性 ZooKeeper提供一种简单的层级式命名设计,就像我们PC标准的文件系统一样(文件和目录)。通过共享同一个命名目录,ZooKeeper实现多个分布式处理过程之间可以相互通信、协调。 命名空间由数据目录组成,我们称之为zn