You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by xi...@apache.org on 2021/07/14 03:11:06 UTC
[incubator-shenyu-website] branch main updated: 添加Nacos和Etcd数据同步说明 (#98)
This is an automated email from the ASF dual-hosted git repository.
xiaoyu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu-website.git
The following commit(s) were added to refs/heads/main by this push:
new 7eeea51 添加Nacos和Etcd数据同步说明 (#98)
7eeea51 is described below
commit 7eeea51e4b9875f54c3b5151f7d3941dc7932c21
Author: 萧 <12...@qq.com>
AuthorDate: Wed Jul 14 11:10:59 2021 +0800
添加Nacos和Etcd数据同步说明 (#98)
---
content/zh/projects/shenyu/data-sync/index.md | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/content/zh/projects/shenyu/data-sync/index.md b/content/zh/projects/shenyu/data-sync/index.md
index c329c56..f69f27a 100644
--- a/content/zh/projects/shenyu/data-sync/index.md
+++ b/content/zh/projects/shenyu/data-sync/index.md
@@ -81,12 +81,22 @@ description: 数据同步
### Nacos同步原理
-`Nacos`数据同步原理介绍。如果您想深入了解代码实现,请参考源码 `NacosSyncDataService`。
+`Nacos`的同步原理与Zookeeper基本类似,主要依赖于`Nacos`的`配置管理`,各个配置节点的路径与Zookeeper类似。
+
+`ShenYu`网关会监听配置的节点,启动时,如果`Nacos`中不存在配置节点,将同步全量的数据写入`Nacos`中,后序数据发送变更时,全量更新`Nacos`中的配置节点,与此同时,`ShenYu`网关会监听配置信息的节点,一旦有信息变更时,会更新本地缓存。
+
+如果您想深入了解代码实现,请参考源码 `NacosSyncDataService`和`Nacos`的[官方文档](https://nacos.io/zh-cn/docs/sdk.html)。
### Etcd同步原理
-`Etcd` 数据同步原理介绍。如果您想深入了解代码实现,请参考源码 `EtcdSyncDataService`。
+`Etcd` 数据同步原理与Zookeeper类似,主要依赖于`Etcd`的`watch`机制,各个配置节点路径与`Zookeeper`相同。
+
+`Etcd`的原生API使用稍有点复杂,所有对其进行了一定的封装。
+
+`ShenYu`网关会监听配置的节点,启动时,如果`Etcd`中不存在配置节点,将同步全量的数据写入`Etcd`中,后序数据发送变更时,增量更新`Etcd`中的配置节点,与此同时,`ShenYu`网关会监听配置信息的节点,一旦有信息变更时,会更新本地缓存。
+
+如果您想深入了解代码实现,请参考源码 `EtcdSyncDataService`。
## 配置使用