Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Overview and characteristics of zookeeper

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "Overview and characteristics of zookeeper". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

What is zookeeper?

Apache ZooKeeper is a software project of Apache Software Foundation. It is essentially a centralized service from distributed system to hierarchical key-value storage, which is used to provide distributed configuration services, synchronization services and naming registry for large distributed systems. ZooKeeper is a subproject of Hadoop, but it is itself a top-level Apache project.

Zookeeper is understood from the perspective of design pattern: it is a distributed service management framework based on the observer pattern, which is responsible for storing and managing the data that everyone cares about, and then accepts the registration of the observers. Once the state of the data changes, Zookeeper will be responsible for notifying the observers who have registered on the Zookeeper to respond accordingly, thus implementing a similar Master/Slave management pattern in the cluster.

2. Characteristics

1. Zookeeper: a leader (leader) and multiple followers (floower) form a cluster.

2. Leader is responsible for initiating and deciding votes and updating the status of the system.

3. Follwer is used to receive customer requests and return the results to the client, and participate in voting during the election of Leader.

4. As long as more than half of the nodes in the cluster survive, the zookeeper cluster can serve normally.

5. Global data uniqueness: each server keeps a copy of the same data, and the data is consistent no matter which server the client connects to.

6. Update requests are performed sequentially, and update requests from the same client are executed in the order in which they are sent.

7. Data update atomicity, a data update is either successful or failed.

8. Real-time, in a certain time range, client can read the latest data.

III. Data structure

The structure of the ZooKeeper data model is very similar to that of the Unix file system, which can be regarded as a tree as a whole, and each node is called a ZNode. Each ZNode can store 1MB data by default, and each ZNode can be uniquely identified by its path.

IV. Application scenarios

The services provided include: unified naming service, unified configuration management, unified cluster management, dynamic online and offline service nodes. Soft load balancing, etc.

1. Unified naming service

In the distributed environment, it is often necessary to name the application / service uniformly, which is easy to identify.

For example, IP is not easy to remember, but domain name is easy to remember.

two。 Unified configuration management

In a distributed environment, it is generally required that the configuration information of all nodes in a cluster is the same, such as kafka cluster. After the configuration file is modified, it needs to be quickly synchronized to each node, which can write the configuration information to a Znode on the zookeeper, and each client server listens to the Znode.

3. Server dynamic online and offline

4. Soft load balancing

This is the end of the introduction of "Overview and characteristics of zookeeper". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report