You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2019/06/27 08:42:13 UTC

[dubbo-website] branch master updated (d5b2314 -> ef991ad)

This is an automated email from the ASF dual-hosted git repository.

liujun pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-website.git.


    from d5b2314  Fix registry protocol description (#407)
     new f1df26c  Correct word separator to '-' (#417)
     new ef991ad  [Doc] Dubbo's Config Center model corresponding to different thirdparty products (#388)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 docs/zh-cn/dev/configcenter/design.md          |  82 +++++++++++++++++++++++++
 docs/zh-cn/user/configuration/config-center.md |   4 +-
 img/configcenter_nacos_model.jpg               | Bin 0 -> 78352 bytes
 img/configcenter_zk_model.jpg                  | Bin 0 -> 189160 bytes
 img/configcenter_zk_properties.jpg             | Bin 0 -> 92946 bytes
 img/configcenter_zk_rule.jpg                   | Bin 0 -> 131167 bytes
 img/configcenter_zk_singleitem.jpg             | Bin 0 -> 53837 bytes
 7 files changed, 84 insertions(+), 2 deletions(-)
 create mode 100644 docs/zh-cn/dev/configcenter/design.md
 create mode 100644 img/configcenter_nacos_model.jpg
 create mode 100644 img/configcenter_zk_model.jpg
 create mode 100644 img/configcenter_zk_properties.jpg
 create mode 100644 img/configcenter_zk_rule.jpg
 create mode 100644 img/configcenter_zk_singleitem.jpg


[dubbo-website] 02/02: [Doc] Dubbo's Config Center model corresponding to different thirdparty products (#388)

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-website.git

commit ef991ad2e93c26914bc3976fb0df1f13c911e95e
Author: ken.lj <ke...@gmail.com>
AuthorDate: Thu Jun 27 16:20:44 2019 +0800

    [Doc] Dubbo's Config Center model corresponding to different thirdparty products (#388)
---
 docs/zh-cn/dev/configcenter/design.md |  82 ++++++++++++++++++++++++++++++++++
 img/configcenter_nacos_model.jpg      | Bin 0 -> 78352 bytes
 img/configcenter_zk_model.jpg         | Bin 0 -> 189160 bytes
 img/configcenter_zk_properties.jpg    | Bin 0 -> 92946 bytes
 img/configcenter_zk_rule.jpg          | Bin 0 -> 131167 bytes
 img/configcenter_zk_singleitem.jpg    | Bin 0 -> 53837 bytes
 6 files changed, 82 insertions(+)

diff --git a/docs/zh-cn/dev/configcenter/design.md b/docs/zh-cn/dev/configcenter/design.md
new file mode 100644
index 0000000..ae521a8
--- /dev/null
+++ b/docs/zh-cn/dev/configcenter/design.md
@@ -0,0 +1,82 @@
+# Dubbo配置中心
+
+## 设计目的
+配置中心的核心功能是作为Key-Value存储,Dubbo框架告知配置中心其关心的key,配置中心返回该key对应的value值。
+
+按照应用场景划分,配置中心在Dubbo框架中主要承担以下职责:
+
+- 作为外部化配置中心,即存储dubbo.properties配置文件,此时,key值通常为文件名如dubbo.properties,value则为配置文件内容。
+- 存储单个配置项,如各种开关项、常量值等。
+- 存储服务治理规则,此时key通常按照"服务名+规则类型"的格式来组织,而value则为具体的治理规则。
+
+为了进一步实现对key-value的分组管理,Dubbo的配置中心还加入了namespace、group的概念,这些概念在很多专业的第三方配置中心中都有体现,通常情况下,namespace用来隔离不同的租户,group用来对统一租户的key集合做分组。
+
+当前,Dubbo配置中心实现了对Zookeeper、Nacos、Etcd、Consul、Apollo的对接,接下来我们具体看一下Dubbo抽象的配置中心是怎么映射到具体的第三方实现中的。
+
+## 实现原理
+
+### Zookeeper
+
+zookeeper提供了一个树状的存储模型,其实现原理如下:
+
+![image-20190127225608553](/img/configcenter_zk_model.jpg)
+
+namespace, group, key等分别对应不同层级的ZNode节点,而value则作为根ZNode节点的值存储。
+
+1. 外部化配置中心 dubbo.properties
+
+   ![image-20190127225608553](/img/configcenter_zk_properties.jpg)
+   
+   上图展示了两个不同作用域的dubbo.properties文件在zookeeper中的存储结构:
+   - 命名空间namespace都为:dubbo
+   - 分组group:全局级别为dubbo,所有应用共享;应用级别为应用名demo-provider,只对改应用生效
+   - key:dubbo.properties
+   
+2. 单个配置项
+
+   ![image-20190127225608553](/img/configcenter_zk_singleitem.jpg)
+   
+   设置优雅停机事件为15000:
+   - 命名空间namespace:dubbo
+   - 分组group:dubbo
+   - key:dubbo.service.shutdown.wait=15000
+     
+3. 服务治理规则
+
+    ![image-20190127225608553](/img/configcenter_zk_rule.jpg)
+    
+    上图展示了一条应用级别的条件路由规则:
+    
+    - 命名空间namespace:dubbo
+    - 分组group:dubbo
+    - key:governance-conditionrouter-consumer.condition-router,其中governance-conditionrouter-consumer为应用名,condition-router代表条件路由
+    
+    
+    > 注意:
+    >
+    > Dubbo同时支持应用、服务两种粒度的服务治理规则,对于这两种粒度,其key取值规则如下:
+    > * 应用粒度 {应用名 + 规则后缀}。如: `demo-application.configurators`、`demo-application.tag-router`等
+    > * 服务粒度 {服务接口名:[服务版本]:[服务分组] + 规则后缀},其中服务版本、服务分组是可选的,如果它们有配置则在key中体现,没被配置则用":"占位。如
+    > `org.apache.dubbo.demo.DemoService::.configurators`、`org.apache.dubbo.demo.DemoService:1.0.0:group1.configurators`
+
+### Etcd & Consul
+
+Etcd和Consul本质上也是一种类似zookeeper的树状存储结构,实现请参考zookeeper。
+
+### Nacos
+
+Nacos作为一个专业的第三方配置中心,拥有专门为配置中心设计的存储结构,包括内置的namespace、group、dataid等概念。并且这几个概念基本上与Dubbo框架抽象的配置中心是一一对应的。
+
+与Zookeeper实现的对应关系如下:
+
+![image-20190127225608553](/img/configcenter_nacos_model.jpg)
+
+参考上文关于zookeeper实现中描述的示例,这里的dataid可能为:
+* 外部化配置中心:dubbo.properties
+* 单个配置项:dubbo.service.shutdown.wait
+* 服务治理规则:org.apache.dubbo.demo.DemoService:1.0.0:group1.configurators
+
+### Apollo
+
+Apollo与Nacos类似,请参考动态配置中心使用文档中关于Apollo部分的描述。
+
diff --git a/img/configcenter_nacos_model.jpg b/img/configcenter_nacos_model.jpg
new file mode 100644
index 0000000..b6d1011
Binary files /dev/null and b/img/configcenter_nacos_model.jpg differ
diff --git a/img/configcenter_zk_model.jpg b/img/configcenter_zk_model.jpg
new file mode 100644
index 0000000..33a1b55
Binary files /dev/null and b/img/configcenter_zk_model.jpg differ
diff --git a/img/configcenter_zk_properties.jpg b/img/configcenter_zk_properties.jpg
new file mode 100644
index 0000000..0f95ca8
Binary files /dev/null and b/img/configcenter_zk_properties.jpg differ
diff --git a/img/configcenter_zk_rule.jpg b/img/configcenter_zk_rule.jpg
new file mode 100644
index 0000000..f39da96
Binary files /dev/null and b/img/configcenter_zk_rule.jpg differ
diff --git a/img/configcenter_zk_singleitem.jpg b/img/configcenter_zk_singleitem.jpg
new file mode 100644
index 0000000..641ffee
Binary files /dev/null and b/img/configcenter_zk_singleitem.jpg differ


[dubbo-website] 01/02: Correct word separator to '-' (#417)

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-website.git

commit f1df26c55f215b156a9b5f05419dddb9de0f77eb
Author: ken.lj <ke...@gmail.com>
AuthorDate: Thu Jun 27 16:29:45 2019 +0800

    Correct word separator to '-' (#417)
---
 docs/zh-cn/user/configuration/config-center.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/zh-cn/user/configuration/config-center.md b/docs/zh-cn/user/configuration/config-center.md
index ca5af6a..db5c419 100644
--- a/docs/zh-cn/user/configuration/config-center.md
+++ b/docs/zh-cn/user/configuration/config-center.md
@@ -40,7 +40,7 @@ configCenter.setAddress("zookeeper://127.0.0.1:2181");
 dubbo.registry.address=zookeeper://127.0.0.1:2181
 dubbo.registry.simplified=true
 
-dubbo.metadataReport.address=zookeeper://127.0.0.1:2181
+dubbo.metadata-report.address=zookeeper://127.0.0.1:2181
 
 dubbo.protocol.name=dubbo
 dubbo.protocol.port=20880
@@ -54,7 +54,7 @@ dubbo.application.qos.port=33333
 外部化配置默认较本地配置有更高的优先级,因此这里配置的内容会覆盖本地配置值,关于[各配置形式间的覆盖关系](./configuration-load-process.md)有单独一章说明,你也可通过以下选项调整配置中心的优先级:
 
   ```properties
-  -Ddubbo.configCenter.highestPriority=false
+  -Ddubbo.config-center.highest-priority=false
   ```
 
 - 作用域