Skip to content
robb edited this page Oct 20, 2025 · 6 revisions

此处存放历史版本的文档

Dubbo Admin支持2.7版本功能

数据源对接

  • 支持ConfigCenter配置
  • 注册中心,配置中心,元数据中心分开
  • 兼容老版本的用法

元数据

  • 服务提供者: IP, PORT, Timeout, Serialization
  • 服务消费者: IP, PORT, Application Name
  • 从元数据中心获取服务的元数据信息,展示在服务详情中(服务名,方法名,方法名,方法参数,方法返回值)
  • 多protocol暴露服务时,在服务详情中展示

动态配置规则

  • 支持应用维度的动态规则配置
  • 一个应用只能有一条应用维度的动态配置
  • 一个服务只能有一条服务维度的动态配置
  • 动态配置包含不同的参数,有些参数单独作为功能点拆出,每个维度只能有一条相同功能点的规则

路由规则

  • 支持应用维度的路由规则配置

  • 一个应用只有一条应用维度的路由规则

  • 一个服务只有一条服务维度的路由规则

  • 标签路由

    • 支持给服务端打上特定的标签,客户端调用的时候,指定标签,服务端会在标签范围内进行路由,具体的配置规则如下
    scope: '?' 
    force: false
    runtime: true
    enabled: true
    priority: 1
    key: governance-tagrouter-provider
    tags:
      - name: tag1
        addresses: ["instance ip:20881"] 
      - name: tag2
        addresses: ["instance ip:20880"] 

其他

兼容性

  • 所有的应用和 Admin 的数据源必须一致
  • 升级到2.7以后,老的配置信息还在原来的注册中心上
  • 只有2.7的服务可以发布标签路由

配置发布

  • 面向Provider的配置:
    • 应用级别: 找到应用内的任意一个服务,如果是2.7的直接发,2.6的拒绝
    • 服务级别: 2.7的服务直接发,2.6的拒绝
  • 面向Consumer的配置
    • 应用级别: 直接放到应用的Consumer下
    • 服务级别: 遍历服务consumer的版本,2.7的发到配置中心,2.6的按照老的格式发到zk

配置读取

  • 2.6版本的服务,从注册中心上读取,2.7版本的服务, 从配置的数据源读取和原来的注册中心读取

Dubbo admin configuration

English version

configurations in application.properties

  • admin.config-center
    • recommanded, the address of configuration center: admin.config-center="zookeeper://127.0.0.1:2181
    • the address of registry center and metadata center need to be configured in configuration center
    • zookeeper
      • path: /dubbo/config/dubbo/dubbo.properties
      • content:
      dubbo.registry.address=zookeeper://127.0.0.1:2181
      dubbo.metadata-report.address=zookeeper://127.0.0.1:2181
  • admin.registry.address
    • not recommanded, the address of registry center: admin.registry.address="zookeeper://127.0.0.1:2181"
    • if this configuration is applied instead of dubbo.configcenter, both registry and configuration centers will use the above address in Dubbo Admin, in which case the metadata center will not be actived. Thus, some features, like the service test, are not available anymore.

中文版

application.properties配置项说明

admin.config-center 推荐使用,配置中心地址,比如admin.config-center="zookeeper://127.0.0.1:2181" 需要在配置中心中,配置注册中心和元数据中心地址配置格式如下: zookeeper path: /dubbo/config/dubbo/dubbo.properties content: dubbo.registry.address=zookeeper://127.0.0.1:2181 dubbo.metadata-report.address=zookeeper://127.0.0.1:2181 admin.registry.address 不推荐使用,老版本的配置中心地址,比如:admin.registry.address="zookeeper://127.0.0.1:2181" 如使用该配置,Dubbo Admin会将其作为注册中心和配置中心使用,元数据中心将无法使用,会影响服务测试等功能。

dubbo-monitor-simple

基本用法

  • 启动com.alibaba.dubbo.monitor.simple.MonitorStarter#main
  • 需要进行监控的服务,在xml中配置<dubbo:monitor protocol="registry"/>
  • 打开监控页面http://localhost:8080可以看到服务调用相关的统计

实现原理

dubbo-monitor-simple
  • dubbo-monitor-simple启动的时候,发布服务:com.alibaba.dubbo.monitor.MonitorService(实现类:com.alibaba.dubbo.monitor.simple.SimpleMonitorService),只实现了collect方法,将RPC调用过来的URL存到queue里面
  • com.alibaba.dubbo.monitor.simple.SimpleMonitorService启动了两个线程,分别执行writedraw方法,writequeue里面取出URL进行统计分析,结果写文件,draw方法把这些结果画成折线图,存本地图片文件
  • com.alibaba.dubbo.monitor.simple.pages.ChartsPageHandlercom.alibaba.dubbo.monitor.simple.pages.StatisticsPageHandler负责在页面上渲染展示这些数据
Dubbo应用
  • Dubbo服务在配置了<dubbo:monitor protocol="registry"/>标签后,调用经过com.alibaba.dubbo.monitor.support.MonitorFilter时,会进行结果收集操作。
  • 最终在调用到com.alibaba.dubbo.monitor.dubbo.DubboMonitor#collect,该方法将调用过程中的统计信息存放在statisticsMap中。并且,有另一个线程定期(默认为60秒)调用dubbo-monitor-simple暴露的com.alibaba.dubbo.monitor.MonitorService服务,将这些信息发送给monitor。

Dubbo-montitor-simple实现的过程借助了dubbo服务调用:Monitor端暴露服务,Dubbo应用通过配置去消费这些服务,消费的过程就是自身服务数据上报的过程。
Dubbo-monitor-simple的代码在本项目的master分支

The compatibility of service governance

English Version

  • The mainstream version of Dubbo are Dubbo 2.6 and Dubbo 2.7
  • The most different of these two version are configuration center: Dubbo 2.6 puts all data on register center, Dubbo 2.7 divided it into registry center, configuration center and metadata center.
  • Dubbo Admin's manipulation of configuration is the same as Dubbo 2.7, please refer to Dubbo Admin configuration . It also compatible with Dubbo 2.7, here 'compatible' means:
    • Service scope configuration will register to both Dubbo 2.7 and Dubbo 2.6,thus, the client of Dubbo 2.6 can receive and parse it.
    • Application scope configuration(including tag router) will register to Dubbo 2.7 only, because this is the new feature in Dubbo 2.7
    • Dubbo Admin will read configurations in the protocol of Dubbo 2.7 only, so the legacy rules on your registry center will not display on Dubbo Admin,and can not be manipulated either。

中文版

  • 目前Dubbo主要版本有两个:Dubbo 2.7和Dubbo 2.6
  • 两个版本最大的差异,在于配置管理中心。Dubbo 2.6版本所有数据都存在注册中心上,Dubbo 2.7版本分成了注册中心,配置中心,和元数据中心。
  • Dubbo Admin对于配置管理的操作,配置方式和Dubbo 2.7的模式一样,详见Dubbo Admin配置说明,并且兼容Dubbo 2.6的版本,这里的“兼容”是指:
    • 服务级别的配置,都会按照Dubbo 2.7和Dubbo 2.6两种格式分别写入,保证Dubbo 2.6的服务能够正确解析对应的规则
    • 应用级别的配置(包括标签路由),只会按照Dubbo 2.7的格式写入,因为Dubbo 2.6中没有这个特性
    • Dubbo Admin只会按照Dubbo 2.7的格式去读取配置,因此所有在Admin上配置规则都可以读到,但是之前在注册中心上遗留的Dubbo 2.6格式的规则,不会展示在Dubbo Admin,也不能在Dubbo Admin上进行操作。