In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "what are the advantages of hadoop Zookeeper". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn what are the advantages of hadoop Zookeeper.
(1) the role of Zookeeper in Hadoop cluster
Zookeeper is a distributed management and cooperation framework. Zookeeper clusters are used to ensure the high availability of Hadoop clusters. (high availability means that services can be provided normally even if some servers in the cluster are down. )
(2) the principle of ensuring high availability of Zookeeper
The principle that Zookeeper cluster can ensure the high availability of NameNode services is that there are two NameNode services in Hadoop cluster, and both NameNode send heartbeats to Zookeeper regularly to tell Zookeeper that I am alive and can provide services. Only one of them is in Action state at a certain time, and the other is in Standby state. Once Zookeeper cannot detect the heartbeat sent by Action NameNode, it switches to NameNode in Standby state and sets it to Action state, so there is always one in the cluster.
NameNode is used to achieve the goal of high availability of NameNode.
(3) the election mechanism of Zookeeper
Zookeeper cluster can also ensure its own high availability. The principle of ensuring its own high availability is that each machine in Zookeeper cluster is divided into two roles: Leader and Follower. When writing data, it is necessary to write Leader,Leader first, and then notify Follower to write. When the client reads the number, because the data is all the same, it can be read from any machine. Here the Leader role has the hidden danger of a single point of failure, and high availability is to solve the hidden danger of a single point of failure. Zookeeper solves the problem of single point of failure of Leader from the mechanism. Which machine is Leader is not fixed, and Leader is elected. The election process is that when any machine in the cluster discovers that there is no Leader in the cluster
Recommend yourself as Leader, and other machines agree that when more than half of the machines agree that it is Leader, the election is over, so the machine data in the Zookeeper cluster must be odd. In this way, even when the Leader machine goes down, a new Leader will be elected quickly, ensuring the high availability of the Zookeeper cluster itself.
(4) write high availability
All write operations in the cluster notify Leader,Leader first and then Follower to write. In fact, when more than half of the machines write successfully, the write is considered successful, so even if some machines are down, the write is successful.
(5) read high availability
When the zookeeperk client reads the data, it can read any machine in the cluster. So the downtime of some machines does not affect reading. Zookeeper servers must be odd, because zookeeper has an electoral system, and its roles are: leader, follower and observer. The purpose of the election is to ensure the consistency of data in the cluster.
At this point, I believe you have a deeper understanding of "what are the advantages of hadoop Zookeeper". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.