Dubbo04 [Zookeeper stores data information for data]

Zookeeper, a subproject of Apacahe Hadoop, is a tree-based directory service that supports change pushing and is suitable as a registration center for Dubbo services. It is highly industrial and can be used in production environments and is recommended for use

Data Storage Structure

The storage structure of related data in dubbo in zookeeper is as follows


Process description:

  1. When the service provider starts: to/dubbo/com.foo. Write your own URL address in the BarService/providers directory
  2. When service consumer starts: subscription/dubbo/com.foo. Provider URL address in the BarService/providers directory. And to/dubbo/com.foo. Write your own URL address in the BarService/consumers directory
  3. When Monitoring Center starts: Subscription/dubbo/com.foo. All provider and consumer URL addresses in the BarService directory.

The following functions are supported:

  1. Registry can automatically delete provider information when provider is down abnormally, such as power outage
  2. Automatically restore registration data and subscription requests when the registry restarts
  3. Automatically recover registration data and subscription requests when the session expires
  4. When <dubbo:registry check="false"/> is set, failed registration and subscription requests are logged and retried regularly in the background
  5. zookeeper login information can be set by <dubbo:registry username="admin" password="1234"/>
  6. You can set the root node of zookeeper by <dubbo:registry group="dubbo"/>without setting to use a rootless tree
  7. Supports * wildcards <dubbo:reference group=""version="/> for all groups of subscriptible services and providers of all versions

Specific structure description

There are three levels of dubbo data stored in zookeeper

Sequence Number

node

Explain

1

root node

dubbo

2

First-level child nodes

Service name providing the service

3

Secondary Child Node

Fixed four child nodes:
consumers,configurators,routers,providers

Consumers

Store service consumer information

attribute

describe

application

Application Name

category

type

check

inspect

dubbo

dubbo Version

interface

Interface Name

methods

Interface Method Name

pid

Process Number

side

Consumer or server

timestamp

time stamp

Providers

Storage Service Provider

[zk: localhost:2181(CONNECTED) 10] ls /dubbo/com.bobo.service.UserService/providers
[dubbo%3A%2F%2F192.168.88.1%3A20880%2Fcom.bobo.service.UserService%3Fanyhost%3Dtrue%26application%3DdubboProvider%26dubbo%3D2.5.3%26group%3Ddubbo%26interface%3Dcom.bobo.service.Us
erService%26methods%3DsayHello%2CtestPojo%26pid%3D21088%26revision%3D1.0.0%26side%3Dprovider%26timeout%3D3000%26timestamp%3D1553650370588%26version%3D1.0.0]

attribute

describe

anyhost

true

application

Application Name

dubbo

dubbo Version

interface

Interface Name

methods

Interface Method Name

pid

Process Number

side

Consumer or server

timestamp

time stamp

Routers

Routing Rules

/dubbo/com.example.dubbo.service.CityService/routers/route://0.0.0.0/com.example.dubbo.service.CityService?category=routers&dynamic=false&enabled=true&force=false&name=cityservice&priority=10&router=condition&rule=method+=+findCityByName+&+consumer.host+=+192.168.198.1+=>+provider.port+=+20881+&+provider.port+!=+20880&runtime=false

attribute

describe

Category

type

Dynamic

Whether dynamic adjustment is required, false indicates manual adjustment is required

Enabled

Whether to start

Force

Whether to force, false means to call other callable services if they do not match

Name

Route Name

Priority

priority

Router

Conditional eligible routing

Access Control: Prohibit an ip access

/dubbo/com.example.dubbo.service.CityService/routers/route://0.0.0.0/com.example.dubbo.service.CityService?category=routers&dynamic=false&enabled=true&force=true&name=com.example.dubbo.service.CityService+blackwhitelist&priority=0&router=condition&rule=consumer.host=192.168.198.1=>false&runtime=false

attribute

describe

Category

type

Dynamic

Whether dynamic adjustment is required, false indicates manual adjustment is required

Enabled

Whether to start

Force

Whether to force, false means to call other callable services if they do not match

Name

Route Name

Priority

priority

Router

Consumer Access Forbidden with Routing Rule IP 192.168.198.1

Configrators

Load Balancing and Weight Information
load balancing

/dubbo/com.example.dubbo.service.CityService/configurators/override://0.0.0.0/com.example.dubbo.service.CityService?category=configurators&dynamic=false&enabled=true&loadbalance=random

attribute

describe

Category

type

Dynamic

Whether dynamic adjustment is required, false indicates manual adjustment is required

Enabled

Whether to start

Loadbalance

Load Balancing Strategy

weight

/dubbo/com.example.dubbo.service.CityService/configurators/override://192.168.198.1:20880/com.example.dubbo.service.CityService?category=configurators&dynamic=false&enabled=true&weight=200

attribute

describe

Category

type

Dynamic

Whether dynamic adjustment is required, false indicates manual adjustment is required

Enabled

Whether to start

Weight

weight

Tags: Java Back-end Zookeeper Dubbo Container java-zookeeper

Posted by s-mack on Sun, 14 Aug 2022 23:05:24 +0530