MelodyYN 2022-02-13 08:26:31 阅读数:608
Zookeeper by Distributed applications provide coordination services Of Apache project . Understand... From a design pattern perspective , It is a distributed service management framework based on observer pattern . It is responsible for storing and managing specified data , Then accept the observer's registration . Once the state of these data changes ,Zookeeper I'm responsible for informing you that it's already in Zookeeper The observers who registered on responded accordingly .
Zookeeper = file system + A notification mechanism .
1、Zookeeper: A leader (Leader）, Multiple followers (Follower） A cluster of .
2、 As long as there is More than half of the nodes survive ,Zookeeper The cluster can service normally .
3、 Global data consistency : Every Server Save a copy of the same data ,Client No matter which one is connected to Server, The data are consistent .
4、 The update request sequence goes on , From the same Client The update requests of are executed in the order in which they are sent .
5、 Atomicity of data updates , A data update is either successful , Or failure .
6、 The real time , Within a certain time frame ,Client Can read the latest data .
ZooKeeper The structure of the data model and Unix File systems are very similar , As a whole, it can be seen as a tree , Each node is called a ZNode. every last ZNode By default, it can store 1MB The data of , Every ZNode Can be uniquely identified by its path .
The services provided include : Unified naming service 、 Unified configuration management 、 Unified cluster management 、 Server node dynamic up and down 、 Soft load balancing, etc .
In a distributed environment , Often need to apply / Service integration — name , Easy to identify .
In distributed environment , Master the status of each node in real time be necessary ,ZooKeeper It can realize real-time monitoring of node state changes .
copyright：author[MelodyYN]，Please bring the original link to reprint, thank you. https://en.javamana.com/2022/02/202202130826298242.html