File tree Expand file tree Collapse file tree 5 files changed +56
-25
lines changed
i18n/zh-cn/docusaurus-plugin-content-docs/current Expand file tree Collapse file tree 5 files changed +56
-25
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,10 @@ sidebar_position: 5
4
4
5
5
# Use OpenSergo with Spring Cloud Alibaba
6
6
7
- [ Spring Cloud Alibaba] ( https://spring.io/projects/spring-cloud-alibaba ) 作为一种一站式的微服务解决方案,通过基于 Spring Cloud 微服务标准为用户提供了微服务应用构建过程中的如服务注册与发现、限流降级、分布式事务与分布式消息等在内的完整微服务解决方案。过去几年被国内大量中小企业所采用,帮助大量企业更加方便地拥抱微服务。
8
-
9
- Spring Cloud Alibaba 社区提供对接 OpenSergo 的模块 ` spring-cloud-starter-opensergo-adapter ` 。以 Spring Cloud Alibaba 的流量路由能力为例,首先我们需要导入Spring Cloud Alibaba 2.2.10-RC1版本下的流量路由以及 OpenSergo 对接模块的相关依赖,我们在 Maven 中引入依赖:
7
+ Spring Cloud Alibaba provides module ` spring-cloud-starter-opensergo-adapter ` for integration with OpenSergo traffic routing and fault-tolerance spec.
10
8
11
9
``` xml
12
- <dependencyManagement >
10
+ <dependencyManagement >
13
11
<dependencies >
14
12
<dependency >
15
13
<groupId >com.alibaba.cloud</groupId >
@@ -31,19 +29,4 @@ Spring Cloud Alibaba 社区提供对接 OpenSergo 的模块 `spring-cloud-starte
31
29
<artifactId >spring-cloud-starter-opensergo-adapter</artifactId >
32
30
</dependency >
33
31
</dependencies >
34
- ```
35
-
36
- 在` application.properties ` 配置文件给消费者配置 OpenSergo 控制面以及 Nacos 注册中心的相关信息:
37
-
38
- ``` yaml
39
- spring.application.name=service-consumer
40
- server.port=18083
41
- management.endpoints.web.exposure.include=*
42
- spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
43
- spring.cloud.nacos.discovery.fail-fast=true
44
- spring.cloud.nacos.username=nacos
45
- spring.cloud.nacos.password=nacos
46
- spring.cloud.opensergo.endpoint={opensergo-control-plane}:10246
47
- ```
48
-
49
- 启动应用后,即可编写 TrafficRouter 等 CR YAML 来动态配置流控容错规则,通过 kubectl apply 到集群中即可生效。
32
+ ```
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ Sentinel 社区提供对接 OpenSergo spec 的动态数据源模块 `sentinel-da
21
21
</dependency >
22
22
```
23
23
24
- 然后在项目合适的位置(如 Spring 初始化 hook 或 Sentinel ` InitFunc ` 中)中创建并注册 Sentinel OpenSergo 数据源。在应用启动前,确保 OpenSergo 控制面及 CRD 已经部署在 Kubernetes 集群中。
24
+ 然后在项目合适的位置(如 Spring 初始化 hook 或 Sentinel ` InitFunc ` 中)中创建并注册 Sentinel OpenSergo 数据源。在应用启动前,确保 OpenSergo 控制面及 CRD 已经部署在 Kubernetes 集群中,可以参考 [ 控制面快速部署文档 ] ( ../opensergo-control-plane.md ) 。
25
25
26
26
``` java
27
27
// 传入 OpenSergo Control Plane 的 endpoint,以及希望监听的应用名.
Original file line number Diff line number Diff line change @@ -4,4 +4,50 @@ sidebar_position: 2
4
4
5
5
# Spring Cloud Alibaba 快速接入 OpenSergo
6
6
7
- (TBD...)
7
+ [ Spring Cloud Alibaba] ( https://spring.io/projects/spring-cloud-alibaba ) 作为一种一站式的微服务解决方案,通过基于 Spring Cloud 微服务标准为用户提供了微服务应用构建过程中的如服务注册与发现、限流降级、分布式事务与分布式消息等在内的完整微服务解决方案。过去几年被国内大量中小企业所采用,帮助大量企业更加方便地拥抱微服务。
8
+
9
+ Spring Cloud Alibaba 社区提供对接 OpenSergo 的模块 ` spring-cloud-starter-opensergo-adapter ` 。以 Spring Cloud Alibaba 的流量路由能力为例,首先我们需要导入 Spring Cloud Alibaba 2.2.10-RC1 版本下的流量路由以及 OpenSergo 对接模块的相关依赖,我们在 Maven 中引入依赖:
10
+
11
+ ``` xml
12
+ <dependencyManagement >
13
+ <dependencies >
14
+ <dependency >
15
+ <groupId >com.alibaba.cloud</groupId >
16
+ <artifactId >spring-cloud-alibaba-dependencies</artifactId >
17
+ <version >2.2.10-RC1</version >
18
+ <type >pom</type >
19
+ <scope >import</scope >
20
+ </dependency >
21
+ </dependencies >
22
+ </dependencyManagement >
23
+
24
+ <dependencies >
25
+ <dependency >
26
+ <groupId >com.alibaba.cloud</groupId >
27
+ <artifactId >spring-cloud-starter-alibaba-governance-routing</artifactId >
28
+ </dependency >
29
+ <dependency >
30
+ <groupId >com.alibaba.cloud</groupId >
31
+ <artifactId >spring-cloud-starter-opensergo-adapter</artifactId >
32
+ </dependency >
33
+ </dependencies >
34
+ ```
35
+
36
+ 在 ` application.properties ` 配置文件给消费者配置 OpenSergo 控制面以及 Nacos 注册中心的相关信息:
37
+
38
+ ``` yaml
39
+ spring.application.name=service-consumer
40
+ server.port=18083
41
+ management.endpoints.web.exposure.include=*
42
+
43
+ spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
44
+ spring.cloud.nacos.discovery.fail-fast=true
45
+ spring.cloud.nacos.username=nacos
46
+ spring.cloud.nacos.password=nacos
47
+
48
+ # 在此处配置 OpenSergo 控制面的 endpoint
49
+ spring.cloud.opensergo.endpoint={opensergo-control-plane}:10246
50
+ ```
51
+
52
+ 在应用启动前,确保 OpenSergo 控制面及 CRD 已经部署在 Kubernetes 集群中,可以参考[ 控制面快速部署文档] ( ../opensergo-control-plane.md ) 。启动应用后,即可编写 [ TrafficRouter] ( https://github.com/opensergo/opensergo-specification/blob/main/specification/zh-Hans/traffic-routing.md ) 等 CR YAML 来动态配置流量路由规则,通过 kubectl apply 到集群中即可生效。
53
+
Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ OpenSergo Dashbaord 依赖 Java 环境来运行。如果您是从代码开始构
21
21
### 从 Github 上下载源码方式
22
22
23
23
1 . 下载代码:` git clone https://github.com/opensergo/opensergo-dashboard.git `
24
- 2 . 在 ` opensergo-dashboard-server/src/main/resources/application.yaml ` 中指定mysql的地址
25
- * mysql的表结构见 [ schema.sql] ( https://github.com/opensergo/opensergo-dashboard/blob/main/opensergo-dashboard-server/src/main/resources/schema.sql )
24
+ 2 . 在 ` opensergo-dashboard-server/src/main/resources/application.yaml ` 中指定 MySQL 的实例地址,需要准备好对应的 MySQL 实例及表结构。
25
+ * MySQL 的表结构见 [ schema.sql] ( https://github.com/opensergo/opensergo-dashboard/blob/main/opensergo-dashboard-server/src/main/resources/schema.sql )
26
26
3 . 构建
27
27
* ` mvn clean package -Dmaven.test.skip=true `
28
28
4 . 启动
@@ -38,6 +38,8 @@ cd opensergo-dashboard-$version
38
38
./bin/startup.sh
39
39
```
40
40
41
+ > 注意:需要准备好对应的 MySQL 实例及表结构。
42
+
41
43
## 3. 访问
42
44
43
45
访问 ` http://localhost:8080/ ` 即可访问 OpenSergo Dashboard。
Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ sidebar_position: 3
7
7
OpenSergo 主要包含以下几部分:
8
8
9
9
* [ ** OpenSergo Spec** ] ( https://github.com/opensergo/opensergo-specification ) :Spec 以统一的一套配置/DSL 定义微服务治理规则与配置,确保开发者可以用同一套标准对不同框架、不同协议、不同语言的微服务架构进行统一治理管控。
10
+ * [ ** OpenSergo 控制平面** ] ( https://github.com/opensergo/opensergo-control-plane ) :OpenSergo 提供 Control Plane 作为统一微服务治理管控组件,承载 OpenSergo CRD 配置转换与下发的职责。
10
11
* ** OpenSergo SDK** :OpenSergo 多语言 SDK 提供统一的 OpenSergo 适配层,供各个开源框架/组件接入到 OpenSergo 生态中。目前社区已提供 [ Java SDK] ( https://github.com/opensergo/opensergo-java-sdk ) 和 [ Go SDK] ( https://github.com/opensergo/opensergo-go-sdk ) 。
11
- * [ ** OpenSergo 控制面** ] ( https://github.com/opensergo/opensergo-control-plane ) :OpenSergo 提供 Control Plane 作为 OpenSergo CRD 的统一管控组件,承载配置转换与下发的职责。
12
12
* ** 数据面(各框架生态)** :各个接入 OpenSergo 生态的微服务框架/组件,都可以通过统一的 OpenSergo CRD 进行服务治理管控。
13
13
14
14
![ structue] ( ../resources/opensergo-project-structure.jpg )
You can’t perform that action at this time.
0 commit comments