In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Today, Xiaobian shared with you what is the relationship between dubbo and zookeeper. I believe many people don't know much about it. In order to let you know more, I summarized the following contents for you and looked down together. I'm sure you'll find something.
Dubbo recommends using Zookeeper as a registry for services.
1. Zookeeper's role:
Zookeeper is used to register services and perform Load Balancer. Which service is provided by which machine must be known to the caller. Simply put, it is the correspondence between ip address and service name. Of course, this correspondence can also be hardcoded into the caller's business code, but if the machine providing the service hangs up, the caller cannot know, and if the code is not changed, it will continue to request the suspended machine to provide services. Zookeeper detects dead machines through heartbeat mechanism and deletes ip and service correspondence of dead machines from the list. As for supporting high concurrency, it is simply horizontal expansion, which improves computing power by adding machines without changing the code. By adding new machines to zookeeper's registry, the service has more providers and more customers.
The role of dubbo:
Dubbo is a tool for managing the middle tier, where there are many service accesses and service providers that need to be scheduled from the business tier to the data warehouse, and dubbo provides a framework to solve this problem.
Note that the dubbo here is just a frame, as for what you put on the shelf is completely up to you, just like a car skeleton, you need to match your wheel engine. In order to complete the scheduling in this framework, there must be a distributed registry that stores the metadata of all services. You can use zk or something else, but everyone uses zk.
The relationship between zookeeper and dubbo:
Dubbo abstracts the registry so that it can externalize different storage media to provide services to the registry. Introducing zookeeper as a storage medium also introduces zookeeper features.
First, Load Balancer: The carrying capacity of a single registry is limited, and when the traffic reaches a certain level, it needs to be distributed. Load Balancer exists for distribution. A zookeeper cluster can easily achieve Load Balancer with corresponding web applications;
Resource synchronization: Load Balancer alone is not enough. Data and resources between nodes need to be synchronized. Zookeeper cluster naturally has such a function.
Naming service: The tree structure is used to maintain the global service address list. When the service provider starts, it writes its URL address to the specified node directory on zookeeper. This operation completes the service publication.
Mast: ZooKeeper ensures that clients cannot create an existing ZNode. That is, if multiple clients request to create the same temporary node at the same time, only one client request will succeed. This feature makes it easy to elect a Master in a distributed environment.
Distributed locks: Distributed locks are a way to control synchronous access to shared resources between distributed systems. If the client machine that currently obtains the lock goes down or restarts, the temporary node will be deleted and the lock will be released. After executing the business logic normally, the client will delete the temporary node it created and release the lock.
What is the relationship between dubbo and zookeeper? I hope the above content can have certain reference value for everyone and can be applied. If you like this post, share it with more people.
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.