In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
1. What is zookeeper?
Zookeeper is a distributed, open source distributed application coordination service, an open source implementation of google chubby, and an important component of hadoop and hbase. It is a software that provides consistency services for distributed applications, including configuration maintenance, domain name services, distributed synchronization, group services and so on.
2. What are the functions of zookeeper?
Cluster management: monitor the survival status of nodes, run requests, etc.
Primary node election: after the primary node is dead, you can start a new round of primary election from the standby node. The primary node election is about the election process, which can be completed by using zookeeper.
Distributed locks: zookeeper provides two kinds of locks: exclusive lock and shared lock. Exclusive lock means that only one thread can use the resource at a time, and the shared lock is read lock sharing and read-write mutual exclusion, that is, multiple threads can read the same resource at the same time, and only one thread can use the write lock if you want to use it. Zookeeper can control distributed locks.
Naming service: in a distributed system, by using a naming service, client applications can obtain information such as the address and provider of a resource or service based on a specified name.
3. How many deployment modes does zookeeper have?
There are three deployment models for zookeeper:
Stand-alone deployment: running on a cluster
Cluster deployment: multiple clusters running
Pseudo-cluster deployment: a cluster starts multiple zookeeper instances to run.
4. How does zookeeper ensure that the states of master and slave nodes are synchronized?
The core of zookeeper is atomic broadcasting, which ensures synchronization between server. The protocol that implements this mechanism is called the zab protocol. There are two modes of zab protocol, namely, recovery mode (primary) and broadcast mode (synchronization). When the service starts or after the leader crashes, the zab enters the recovery mode, and when the leader is elected and most of the server finishes synchronizing with the leader, the recovery mode ends. State synchronization ensures that leader and server have the same system state.
5. Why should there be a master node in the cluster?
In a distributed environment, some business logic only needs to be executed by one machine in the cluster, and other machines can share this result, which can greatly reduce duplicate computing and improve performance, so the master node is needed.
6. There are three servers in the cluster, and one of the nodes is down. Can zookeeper still be used at this time?
Can continue to use, odd-numbered servers as long as no more than half of the server down can continue to use.
7. Tell me about the notification mechanism of zookeeper?
The client will establish a watcher event for a znode. When the znode changes, these clients will be notified by the zookeeper, and then the client can make business changes according to the znode change.
Conclusion
Encourage yourself and encourage each other with these words. The harder you work, the luckier you are. If you are not the official second generation, the rich second generation or the red second generation, then please remember: diligence is the only shortcut to change your destiny.
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.