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

What are the application scenarios of zookeeper

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

Editor to share with you what the zookeeper application scenarios are, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Interview questions

What are the usage scenarios of zookeeper?

Psychological analysis of interviewer

The topic we are talking about is a distributed system, and after talking to you about some questions related to dubbo, the interviewer has confirmed that you have some knowledge of the distributed service framework / RPC framework. Then he may start to talk to you about other issues related to distribution.

Distributed lock this thing, very commonly used, you do Java system development, distributed system, there may be some scenarios will be used. The most commonly used distributed locks are based on zookeeper.

In fact, to be honest, the general way to ask this question is to see if you know zookeeper, because zookeeper is a common basic system in distributed systems. And what is often asked is what is the usage scenario of zookeeper? See if you know some basic usage scenarios. But in fact, zookeeper dug deep nature can ask very deep.

Analysis of interview questions

Generally speaking, the usage scenarios of zookeeper are as follows. I'll just give you a few simple ones. I wish you could just say a few:

Distributed coordination

Distributed lock

Metadata / configuration information management

HA high availability

Distributed coordination

This is actually a classic use of zookeeper. To put it simply, it is like, your system A sends a request to mq, and then system B consumes the message and then processes it. So how does system A know the processing results of system B? The coordination between distributed systems can be realized by using zookeeper. After sending a request, system A can register a listener on the value of a node on zookeeper. Once system B has finished processing, it can modify the value of that node in zookeeper, and system A can immediately receive a notification and solve it perfectly.

Distributed lock

Give me a chestnut. Two consecutive modification operations are issued to a certain data, and two machines receive requests at the same time, but only one machine can execute the other machine first. Then the zookeeper distributed lock can be used at this time. After receiving the request, a machine first acquires a distributed lock on the zookeeper, that is, it can create a znode and then performs the operation; then another machine also tries to create that znode, only to find that it cannot create it, because it has been created by someone else, so it can only wait until the first machine has finished executing it.

Metadata / configuration information management

Zookeeper can be used to manage the configuration information of many systems, such as kafka, storm and many other distributed systems will choose zookeeper to manage some metadata and configuration information, including dubbo registry also supports zookeeper?

HA high availability

This should be very common. For example, many big data systems, such as hadoop, hdfs, yarn, and so on, choose to develop HA high availability mechanism based on zookeeper, that is, an important process usually acts as an active and standby process, and the main process immediately senses switching to the standby process through zookeeper.

The above is all the content of the article "what are the Application scenarios of zookeeper". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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

Development

Wechat

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

12
Report