Zookeeper What are scenarios?

Interview questions

zookeeper What are the usage scenarios?

Interviewer psychological analysis

Now talk topic is a distributed system, after the interviewer talk to you over some of the problems associated dubbo, we have confirmed that you have some basic knowledge of the distributed service framework / RPC framework of. Then he may begin to tell you to talk to other issues related to the distributed.

Distributed lock this thing, very common, you do Java development systems, distributed systems, there may be some scenes will be used. The most commonly used distributed lock is implemented based on zookeeper.

In fact, tell the truth, ask this question, the general is to see if you understand the zookeeper, zookeeper in a distributed system because it is a common base system. And ask if that is often asked what is the zookeeper usage scenario? Look Do you know some basic usage scenarios. But in fact, it deepened the zookeeper is natural to ask deep, deep.

Face questions analysis

Generally speaking, zookeeper usage scenarios below, I give you a few simple, we can say that a few like:

  • Distributed Coordination
  • Distributed Lock
  • Metadata / configuration information management
  • HA HA

Distributed Coordination

In fact, this is a classic zookeeper usage, simply, like you A system sends a request to the mq, then B system after the news consumption process. A system that knows how to deal with the results of B system? Zookeeper can be achieved by coordination between distributed systems. A system can then send a request on the zookeeper register a listener for the value of a node , once finished on the B-block processing zookeeper modify the value of that node, A system can be immediately notified, the perfect solution.

Distributed Lock

For chestnuts. Issued consecutive two data modification operations on one, two machines received a request, but only one machine to another machine executing the re-execution. So then you can use the distributed lock zookeeper, a machine receives a lock on a distributed request a zookeeper after the first, is that we can to create a znode, then perform the operation; then another machine also try to create the znode, it was found that they can not be created because someone else is created, you can only wait, ranking a machine to perform over their own re-executed.

Metadata / configuration information management

zookeeper can be used as a management configuration information of many systems, such kafka, storm and so many would prefer to use a distributed system zookeeper to do some metadata, configuration management information, including dubbo registry also does not support the zookeeper it?

HA HA

This should be very common, such as hadoop, hdfs, yarn and many large data systems are selected based zookeeper to develop HA high availability mechanisms, is an important process will generally call the shots prepared two main processes hung up immediately perceived by zookeeper switch to the backup process.

 

Guess you like

Origin blog.csdn.net/u014513171/article/details/93033956