dubbo simple understanding

dubbo simple understanding

Understanding dubbo

Dubbo is Alibaba's open source distributed service framework. Its biggest feature is that it is structured in a layered manner. In this way, the various layers can be decoupled (or loosely coupled to the maximum). From the point of view of service model, Dubbo adopts a very simple model, either the provider provides services or the consumer consumes services, so based on this, the service provider and service consumer can be abstracted (Consumer) Two roles.

The provider server provides data, the
consumer client obtains data --------------calls the provider's interface to obtain data

Dubbo is a Kaiyuan distributed service framework widely used by many domestic Internet companies. Even from an international perspective, it is a very comprehensive SOA basic framework. As an important technology, Dangdang has implemented some new functions for Dubbo according to its own needs, and named it Dubbox (ie Dubbo eXtensions).

dubbo–maven– versions provided by two companies (early ali, new version of apache)
Insert picture description here

What does Dubbo do

  1. Transparent remote method call, just like calling a local method to call a remote method, only simple configuration, no API intrusion
    .
  2. The soft load balancing and fault tolerance mechanism can replace hardware load balancers such as F5 in the intranet, reducing costs and reducing single points.
  3. Automatic registration and discovery of services eliminates the need to write down the address of the service provider. The registration center queries the IP
    address of the service provider based on the interface name , and can smoothly add or delete service providers.
  4. Dubbo adopts the all-Spring configuration method, transparent access to the application, without any API intrusion to the application, just use Spring to load the Dubbo configuration, and Dubbo is loaded based on Spring's Schema extension.

dubbo principle

Insert picture description here
Glossary:

Provider: The provider of the exposed service.
Consumer: The service consumer who calls the remote service.
Registry: Service registry and discovery center.
Monitor: Count the number of services and calls, and call the time monitoring center. (It can be displayed on the console page of dubbo control center)
Container: The container in which the service runs.

Calling relationship:

0. The server is responsible for starting, loading, and running the provider (for example, in the tomcat container, starting the dubbo server).
1. When the provider starts, register the service it provides with the registration center.
2. When consumers start, they subscribe to the registration center for the services they need.
3. The registry returns the provider address list to the consumer. If there is a change, the registry will push the changed data to the consumer based on the long connection.
4. Consumers, from the remote interface list, call the remote interface, dubbo will select one provider to call based on the load balancing algorithm, and if the call fails, choose another one.
5. Consumers and providers accumulate the number of calls and call time in memory, and send statistical data to the monitoring center every minute. (It can be seen in the visual interface of dubbo control center)

Dubbo distributed cluster model

Insert picture description here

Dubbo Control Center

Summarize
the main functions of the Dubbo management console: Service governance The
management console mainly includes:

Routing rules,
dynamic configuration,
service degradation,
access control
, weight adjustment,
load balancing and other management functions

The dubbo management center is a written java project, we only need to start the java project, this management center, we can see and use it.
Start the project in
two ways:

  1. Mark the project into a war package, put it in a designated container (such as tomcat), and then start the tomcat external service.
  2. Type the project into a jar package, and use the java command to start the java -jar jar package name.

Guess you like

Origin blog.csdn.net/qq_39095899/article/details/107323021