Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update _index.md #2856

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ RpcContext.getContext().setAttachment("registry_zone", "qingdao");

### 2.2 多注册中心地址聚合
```xml
<dubbo:registry address="multiple://127.0.0.1:2181?separator=;&reference-registry=zookeeper://address11?backup=address12,address13;zookeeper://address21?backup=address22,address23" />
<dubbo:registry address="multiple://127.0.0.1:2181?separator=#&reference-registry=zookeeper://address11?backup=address12,address13#zookeeper://address21?backup=address22,address23" />
shaowYe marked this conversation as resolved.
Show resolved Hide resolved
```

这里增加了一个特殊的 multiple 协议开头的注册中心,其中:
* `multiple://127.0.0.1:2181` 并没有什么具体含义,只是一个特定格式的占位符,地址可以随意指定
* `reference-registry` 指定了要聚合的注册中心集群的列表,示例中有两个集群,分别是 `zookeeper://address11?backup=address12,address13` 和 `zookeeper://address21?backup=address22,address23`,其中还特别指定了集群分隔符 `separator=";"`
* `reference-registry` 指定了要聚合的注册中心集群的列表,示例中有两个集群,分别是 `zookeeper://address11?backup=address12,address13` 和 `zookeeper://address21?backup=address22,address23`,其中还特别指定了集群分隔符 `separator="#"`

如下图所示,不同注册中心集群的地址会被聚合到一个地址池后在消费端做负载均衡或路由选址。

Expand Down Expand Up @@ -192,4 +192,4 @@ CRM 需同时调用中文站和国际站的 PC2 服务,PC2 在中文站和国
<dubbo:registry address="10.20.141.150:9090|10.20.154.177:9010" />
<!-- 引用服务 -->
<dubbo:reference id="helloService" interface="com.alibaba.hello.api.HelloService" version="1.0.0" />
```
```
Loading