What is the relationship between dubbo and zookeeper?
What is the relationship between dubbo and zookeeper? The following article will introduce to you the relationship between dubbo and zookeeper. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.
Dubbo recommends using Zookeeper as the service registration center.
1. The role of Zookeeper:
zookeeper is used to register services and perform load balancing. Which service is provided by which machine must be known to the caller. Simple In other words, it is the correspondence between the IP address and the service name. Of course, this correspondence can also be implemented in the caller's business code through hard coding. However, if the machine that provides the service hangs up, the caller has no way of knowing. If the code is not changed, it will continue to request the dead machine to provide services. Zookeeper can detect the hung machine through the heartbeat mechanism and delete the corresponding relationship between the IP and service of the hung machine from the list. As for supporting high concurrency, simply speaking, it means horizontal expansion, increasing computing power by adding machines without changing the code. By adding new machines to register services with ZooKeeper, the more service providers there are, the more customers they can serve.
2. The role of dubbo:
Dubbo is a tool for managing the middle layer. There are many services between the business layer and the data warehouse. Service providers need scheduling, and dubbo provides a framework to solve this problem.
Note that the dubbo here is just a frame. What you put on the shelf is completely up to you, just like a car skeleton, you need to match your wheel engine. To complete the scheduling in this framework, there must be a distributed registration center to store the metadata of all services. You can use zk or others, but everyone uses zk.
3. The relationship between zookeeper and dubbo:
Dubbo abstracts the registration center so that it can connect to different storage media to provide services to the registration center. The introduction of zookeeper as a storage medium also introduces the features of zookeeper.
The first is load balancing: the carrying capacity of a single registration center is limited. When the traffic reaches a certain level, it needs to be diverted. Load balancing exists for the purpose of diverting traffic. A zookeeper cluster cooperates The corresponding web application can easily achieve load balancing;
Resource synchronization: load balancing alone is not enough, the data and resources between nodes need to be synchronized, and the zookeeper cluster naturally has Such a function;
Naming service: uses a tree structure to maintain a global service address list. When the service provider starts, it writes to the specified node directory on zookeeper. own URL address, this operation completes the release of the service
Mast: ZooKeeper can ensure that the client cannot create an existing ZNode. That is to say, if multiple clients request to create the same temporary node at the same time, only one client request will be successfully created in the end. Using this feature, you can easily conduct Master election in a distributed environment.
Distributed lock: Distributed lock is a way to control synchronous access to shared resources between distributed systems. If the client machine that currently obtains the lock crashes or restarts, the temporary node will be deleted and the lock will be released. After the business logic is executed normally, the client will actively delete the temporary node it created and release the lock.
For more related knowledge, please pay attention to PHP Chinese website! !
The above is the detailed content of What is the relationship between dubbo and zookeeper?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



As modern applications continue to evolve and the need for high availability and concurrency grows, distributed system architectures are becoming more common. In a distributed system, multiple processes or nodes run at the same time and complete tasks together, and synchronization between processes becomes particularly important. Since many nodes in a distributed environment can access shared resources at the same time, how to deal with concurrency and synchronization issues has become an important task in a distributed system. In this regard, ZooKeeper has become a very popular solution. ZooKee

This article will write a detailed example to talk about the actual development of dubbo+nacos+Spring Boot. This article will not cover too much theoretical knowledge, but will write the simplest example to illustrate how dubbo can be integrated with nacos to quickly build a development environment.

With the rapid development of the Internet, distributed systems have become one of the infrastructures in many enterprises and organizations. For a distributed system to function properly, it needs to be coordinated and managed. In this regard, ZooKeeper and Curator are two tools worth using. ZooKeeper is a very popular distributed coordination service that can help us coordinate the status and data between nodes in a cluster. Curator is an encapsulation of ZooKeeper

[[443126]] Let me start with a few words. I often think about a lot of technical "why questions" when I'm walking. Sometimes I think about a question for a long time, and it's not finished until I can convince myself of every point in the question. So I want to record these thoughts and form an article, which can be used as a new series. You may not be able to see the code in these articles, but you can get a glimpse of some problems that are easily overlooked, as well as the deeper "why" of the problem. Today we bring the first article, why should Dubbo be rewritten in Go? Dubbo, which was born in Alibaba and open sourced in 2011, has gone through 10 years. In 2019, it was rewritten in Go and open sourced. Now two years later, it has developed from the original V1.0.0 version to V3.0.0.

Preface Before introducing Dubbo, let’s first understand the basic concepts: Dubbo is an RPC framework. RPC is Remote Procedure Call (remote procedure call). The opposite is local procedure call. It is used in single application architecture and vertical application architecture before distributed architecture. They are all local procedure calls. It allows a program to call a procedure or function in another address space (usually another machine shared on a network) without the programmer having to explicitly code the details of the remote call. Remote calls between distributed architecture applications require the RPC framework to make remote calls as simple as local calls. The Dubbo framework has the following component Consumer, which calls the remote service

If you are already proficient in using Dubbo, this article is not suitable for you, but if you want to understand Dubbo and learn Dubbo, it is very suitable for you.

The implementation methods of distributed locks usually include: database, cache (such as Redis), Zookeeper, etcd. In actual development, Redis and Zookeeper are most commonly used, so this article will only talk about these two.

PHP is a very popular programming language that is widely used in web applications and server-side development. Zookeeper is a distributed coordination service used to manage, coordinate and monitor distributed applications and services. Using Zookeeper in PHP applications can improve the performance and reliability of your application. This article will introduce how to use the Zookeeper extension for PHP. 1. Install the Zookeeper extension. To use the Zookeeper extension, you need to install Zookeeper.