Skip to content

Commit

Permalink
[type:doc] refactor apollo doc (#985)
Browse files Browse the repository at this point in the history
* [type:doc] add event

* [type:doc] refactor apollo doc

* [type:doc] refactor apollo doc

* [type:doc] refactor apollo doc
  • Loading branch information
moremind authored Nov 22, 2023
1 parent 0ccb679 commit 44fe9f2
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 14 deletions.
28 changes: 17 additions & 11 deletions docs/user-guide/property-config/use-data-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,22 +334,29 @@ shenyu:

### Apollo Synchronization Config

Apollo just support Java [8,17), if you want to use apollo as data sync center, please make sure your JDK version is between [8,17).

* `Apache ShenYu` gateway config

Add these dependencies in `pom.xml`:
Download the corresponding version of the jar package from `https://repo1.maven.org/maven2/org/apache/shenyu/shenyu-spring-boot-starter-sync-data-apollo/`, and then put the jar package into the `/lib` directory.

```xml
<!-- apache shenyu data sync start use consul-->
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-spring-boot-starter-sync-data-apollo</artifactId>
<version>${project.version}</version>
</dependency>
Add these config values in yaml file:

```yaml
shenyu:
sync:
apollo:
appId: shenyu
meta: http://localhost:8080
env: dev
clusterName: test
namespace: application
```

<img src="/img/shenyu/dataSync/shenyu-data-sync-apollo-pom.png" width="80%" height="70%" />
* `Apache ShenYu Admin` config

Download the corresponding version of the jar package from `https://repo1.maven.org/maven2/org/apache/shenyu/shenyu-admin-listener-apollo/`, and then put the jar package into the `/lib` directory.

Add these config values in yaml file:

```yaml
shenyu:
Expand All @@ -368,5 +375,4 @@ shenyu:


> After the data synchronization strategy of Apache ShenYu gateway and shenyu-admin is reconfigured, the microservice needs to be restarted.
>
> the Apache ShenYu gateway and shenyu-admin must use the same synchronization strategy.
Original file line number Diff line number Diff line change
Expand Up @@ -330,3 +330,48 @@ shenyu:
> 在`Apache ShenYu`网关和`shenyu-admin` 重新配置数据同步策略后,需要重启服务。
>
> `Apache ShenYu`网关 和 `shenyu-admin` 必须使用相同的同步策略。

### Apollo同步配置

Apollo仅支持Java [8,17)版本,如果您要使用apollo作为数据同步中心,请确保您的JDK版本在[8,17)之间。

* `Apache ShenYu`网关配置

从`https://repo1.maven.org/maven2/org/apache/shenyu/shenyu-spring-boot-starter-sync-data-apollo/` 下载对应版本的jar包,然后将jar包放到`/lib`目录下。

在yaml文件中添加如下配置:

```yaml
shenyu:
sync:
apollo:
appId: shenyu
meta: http://localhost:8080
env: dev
clusterName: test
namespace: application
```

* `Apache ShenYu Admin` 配置

从`https://repo1.maven.org/maven2/org/apache/shenyu/shenyu-admin-listener-apollo/` 下载对应版本的jar包,然后将jar包放到`/lib`目录下。

在yaml文件中添加如下配置:

```yaml
shenyu:
sync:
apollo:
meta: http://localhost:8080
appId: shenyu
portalUrl: http://localhost:8070
env: dev
clusterName: test
namespace: application
token: 0fff5645fc74ee5e0d63a6389433c8c8afc0beea31eed0279ecc1c8961d12da9
```

<img src="/img/shenyu/dataSync/shenyu-data-sync-admin-apollo-yml.png" width="80%" height="70%" />

> 在`Apache ShenYu`网关和`shenyu-admin` 重新配置数据同步策略后,需要重启服务。
> `Apache ShenYu`网关 和 `shenyu-admin` 必须使用相同的同步策略。
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ description: 集群部署

### 启动 Apache ShenYu Admin

* 在你的网关管理端服务器下载并解压[apache-shenyu-${current.version}-admin-bin.tar.gz](https://archive.apache.org/dist/shenyu/2.6.0/apache-shenyu-incubating-2.6.0-admin-bin.tar.gz)
* 在你的网关管理端服务器下载并解压[apache-shenyu-${current.version}-admin-bin.tar.gz](https://archive.apache.org/dist/shenyu/2.6.0/apache-shenyu-2.6.0-admin-bin.tar.gz)

* 配置你的数据库,进入`/conf`目录,在`application.yaml`文件中修改`spring.profiles.active`节点为`mysql`, `pg` or `h2`

Expand All @@ -35,8 +35,7 @@ description: 集群部署

### 启动 Apache ShenYu Boostrap

* 在你的网关启动器服务器下载并解压[apache-shenyu-${current.version}-bootstrap-bin.tar.gz](https://archive.apache.org/dist/shenyu/2.6.0/apache-shenyu-incubating-2.6.0-bootstrap-bin.tar.gz)

* 在你的网关启动器服务器下载并解压[apache-shenyu-${current.version}-bootstrap-bin.tar.gz](https://archive.apache.org/dist/shenyu/2.6.0/apache-shenyu-2.6.0-bootstrap-bin.tar.gz)
* 配置你的数据同步方式,进入`/conf`目录,在`application.yaml`文件中修改`shenyu.sync`节点为`websocket`, `http`, `zookeeper`, `etcd`, `consul` 或者 `nacos`,这个配置必须与`ShenyYu Admin`的配置保持相同。

* 进入`bin`目录,启动ShenYu Bootstrap。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,45 @@ shenyu:



> 在`Apache ShenYu`网关和`shenyu-admin` 重新配置数据同步策略后,需要重启服务。
>
> `Apache ShenYu`网关 和 `shenyu-admin` 必须使用相同的同步策略。

### Apollo同步配置

* `Apache ShenYu` 网关配置

在`pom.xml`中添加如下依赖:

```xml
<!-- apache shenyu data sync start use apollo-->
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-spring-boot-starter-sync-data-apollo</artifactId>
<version>${project.version}</version>
</dependency>
```

<img src="/img/shenyu/dataSync/shenyu-data-sync-apollo-pom.png" width="80%" height="70%" />

在yaml文件中添加如下配置:

```yaml
shenyu:
sync:
apollo:
meta: http://localhost:8080
appId: shenyu
portalUrl: http://localhost:8070
env: dev
clusterName: test
namespace: application
token: 0fff5645fc74ee5e0d63a6389433c8c8afc0beea31eed0279ecc1c8961d12da9
```

<img src="/img/shenyu/dataSync/shenyu-data-sync-admin-apollo-yml.png" width="80%" height="70%" />


> 在`Apache ShenYu`网关和`shenyu-admin` 重新配置数据同步策略后,需要重启服务。
>
> `Apache ShenYu`网关 和 `shenyu-admin` 必须使用相同的同步策略。

0 comments on commit 44fe9f2

Please sign in to comment.