What is the internal principle of zookeeper?
This article introduces the relevant knowledge of "what is the internal principle of zookeeper". In the operation of actual cases, many people will encounter such a dilemma. Then 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!
Zookeeper ① election mechanism (interview focus)
Half mechanism: more than half of the machines in the cluster survive and the cluster is available. So Zookeeper is suitable for installing odd-numbered servers.
Zookeeper although Master and Slave are not specified in the configuration file. However, when Zookeeper works, one node is Leader, and the other is that Follower,Leader is temporarily generated through an internal election mechanism.
The process of election:
For example, if there are three machines whose id is 1pd2, start them sequentially, and when the first one is turned on, the log of Zookeeper will report an error, because the number of starts is not half of the set: there are three machines with id for 1pd2, and start them sequentially. Started two, a total of three), the number is more than half, and then according to the size of the ID to choose Leader, then the 2nd is elected; 2.3.When the Leader already exists, you can only be a younger brother.
Principle of ② snooping (interview focus)
③ write data flow
The process by which the client writes data to the node of the zookeeper:
This is the end of the content of "what is the Internal principle of zookeeper". Thank you for your 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!