diff --git a/docs/index.md b/docs/index.md index f2caa6cf826..6ed8b63106b 100755 --- a/docs/index.md +++ b/docs/index.md @@ -125,7 +125,7 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR If you want to customize, see [custom-plugin](https://shenyu.apache.org/docs/developer/custom-plugin/) . ---- +--- # Selector & Rule @@ -137,7 +137,7 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR The selector and the rule match only once, and the match is returned. So the coarsest granularity should be sorted last. ---- +--- # Data Caching & Data Sync @@ -161,14 +161,14 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR ---- +--- # Contributor and Support * [How to Contribute](https://shenyu.apache.org/community/contributor-guide) * [Mailing Lists](mailto:dev@shenyu.apache.org) ---- +--- # Known Users diff --git a/docs/user-guide/discovery/_category_.json b/docs/user-guide/discovery/_category_.json index 78b365b8a3f..7c0997e003e 100644 --- a/docs/user-guide/discovery/_category_.json +++ b/docs/user-guide/discovery/_category_.json @@ -1,4 +1,4 @@ { - "label": "discovery", + "label": "Discovery", "position": 4 } diff --git a/docs/user-guide/discovery/discovery-mode.md b/docs/user-guide/discovery/discovery-mode.md index 9064cac76a9..80837a074b5 100644 --- a/docs/user-guide/discovery/discovery-mode.md +++ b/docs/user-guide/discovery/discovery-mode.md @@ -1,190 +1,191 @@ --- title: Discovery keywords: [ "Discovery" ] -description: Discovery Modules +description: Discovery --- -# 1. Overview +# Discovery -## 1.1 Module Name +## 1. Overview -Discovery - -## 1.2 Design +### 1.1 Module Name -Design drawing -![discovery-design.png](/img/shenyu/plugin/discovery/discovery-design.png) +Discovery -DataBase Design -![db-design.png](/img/shenyu/plugin/discovery/db-design.png) +### 1.2 Design -## 1.3 Notes +- Module Design Diagram +![discovery-design.png](/img/shenyu/plugin/discovery/discovery-design.png) -The 'Discovery' gateway admin service actively listens to register to the gateway service. The shenyu gateway has the ability to actively discover the changes of the proxy service list -'Discovery' can be at the selector level or the plugin level. -The 'Discovery' plugin is currently introduced as a TCP ,Divide,Websocket,Grpc Plugin. -### 1.3.1 Listener mode -LOCAL , ZOOKEEPER , NACOS(To be supported) , ERURKA(To be supported) .... +- Database Design -LOCAL mode: relies heavily on manually maintaining the upstream list to push to the gateway +![db-design.png](/img/shenyu/plugin/discovery/db-design.png) -ZOOKEEPER mode: Listen for temporary node changes in the specified node in zk for data -### 1.3.2 Scope of action +### 1.3 Module Functionality -Plugin-level: THIS APPLIES TO THE entire PLUGIN. All CHOICES MADE BY the PLUGIN will default to the current listening mode -Selector level: This applies to the current selector. There are different selectors that use different listening modes under the current plugin +The Discovery module endows the ShenYu Gateway with the ability to actively perceive and respond to changes in the list of services being proxied. +By actively listening to the admin service of the Discovery Gateway, the ShenYu Gateway can promptly track changes in the services being proxied. +This functionality is designed to be flexible and can be configured at either **the selector level or the plugin level**, as needed. +Currently, plugins that have incorporated the Discovery feature include TCP, Divide, Websocket and gRPC plugins. -# 2. How to use -## 2.1 Plug-in level Configuration +### 1.4 Listening Mode -1. In the plugin that supports the Discovery module click 'Discovery configuration' to select the listening mode for the response - Take Zookeeper as an example +LOCAL, ZOOKEEPER, NACOS, EUREKA, ETCD - ![config_zk_plugin.png](/img/shenyu/plugin/discovery/config_zk_plugin.png) +- LOCAL Mode: Primarily relies on manual maintenance of the upstream list and pushing it to the gateway. +- ZOOKEEPER Mode: Monitors changes in ephemeral nodes under a specified node in ZooKeeper to obtain data. +- NACOS Mode: Listens for changes in instances under a specified service name in Nacos to obtain data. +- EUREKA Mode: Listens for changes in instances under a specified service name in Eureka to obtain data. +- ETCD Mode: Obtains data by monitoring changes in key-value pairs under specified nodes in etcd. -2. In the selector, click 'Add' on the new selector page and click 'DiscoveryConfig' to find the Type type to force the plugin-level listener that you just configured - In this case, we need to listen to the 'ListenerNode' : /shenyu/discovery as an example +### 1.5 Scope of Effect - ![add_listener_node.png](/img/shenyu/plugin/discovery/add_listener_node.png) +- Plugin Level: Impacts the entire plugin, +and all selectors under that plugin will default to the current listening mode. +- Selector Level: Applies to the current selector, +allowing different selectors under the same plugin to use different listening modes. - Note: In this Handler configuration, shenyu specifies that the upstream registration data is sent in the following json form +## 2. Usage - ```json - { - "url": "127.0.0.1::6379", // upstream's url - "protocol": "tcp", // upstream's protocol - "status": 0, // upstream's (0, healthy, 1 unhealthy) - "weight": 10 // Used when calculating load balancing - } - ``` +### 2.1 Plugin-Level Configuration - You can alias the handler if your service alias is different from the json format defined by shenyu - In the above image, I need to change the status to healthy. The other is to save the original json-key form +#### 2.1.1 Service Discovery Configuration -3. See plugin for details on how to configure selector properties +- In plugins that support the Discovery module (currently, only the TCP plugin supports plugin-level discovery +configuration on the admin console page; other plugins can configure plugin-level discovery through shenyu-client, +as described in the "Using Shenyu-client" section below), click on `Discovery Configuration`. In the popup form, +select the desired listening mode and fill in the service discovery name, registration server URL, registry configuration parameters, etc.: -## 2.2 Selector level configuration -Similar to plug-in level configuration. Combine the '1', '2' steps above -![discovery-seletor-config.png](/img/shenyu/plugin/discovery/discovery-seletor-config.png) +![config-discovery-plugin-en.png](/img/shenyu/plugin/discovery/config-discovery-plugin-en.png) -Note: When using selector levels. It has to be reconfigured each time +![config-discovery-plugin-modal-en.png](/img/shenyu/plugin/discovery/config-discovery-plugin-modal-en.png) -If you choose the LOCAL mode, you don't need to log into a registry and manually maintain the upstream list +#### 2.1.2 Usage within Selectors -![discovery-local-mode.png](/img/shenyu/plugin/discovery/discovery-local-mode.png) +- To add a new selector, click on `Add Selector`. In the new selector page, you will notice that the `Type` field enforces the previously configured plugin-level listening mode, +indicating that the added selector will also adopt the same configuration. +At this point, simply input the desired `ListeningNode`: -# 3. Configuration + ![add-selector-under-plugin-discovery-en.png](/img/shenyu/plugin/discovery/add-selector-under-plugin-discovery-en.png) -## 3.1 Registration Information Configuration +- The `Handler` here refers to ShenYu's specified JSON format for transmitting upstream registration data, +as shown below: + - url: URL of the upstream + - protocol: communication protocol of the upstream + - status: status of the upstream node (0 for healthy, 1 for unhealthy) + - weight: Used for load balancing calculations -### 3.1.1 Basic Configuration -![common-config.png](/img/shenyu/plugin/discovery/common-config.png) + ```json + { + "url": "127.0.0.1::6379", + "protocol": "tcp", + "status": 0, + "weight": 10 + } + ``` -- Type registered Type [LOCAL | ZOOKEEPER] -- ListenerNode registers listeners like '/shenyu/discovery' -- Handler handles aliasing of upstream registration information -- ServerList registry link url +- If your service alias does not match ShenYu's defined JSON format, +you can perform alias mapping in `Handler`. +For example, as shown in the above image, +if you need to change `status` to "healthy" while keeping other keys unchanged, +follow these steps: create a new alias, map `status` to `healthy`, +and retain the original JSON keys' format. +- Configure the remaining properties for the selector according to the specific plugin's documentation. +### 2.2 Selector-Level Configuration -### 3.1.2 Detailed explanation of data +- In plugins that support the Discovery module, click on `Add Selector`. +In the `Discovery Config` tab, configure the fields such as type, +listening node, server URL list, and registry properties. +This configuration only applies to the current selector and must be reconfigured each time a new selector is added. -- The `upstream` registration data is : +![add-selector-en.png](/img/shenyu/plugin/discovery/add-selector-en.png) -```json -{ - "protocol": "tcp", - "url": "127.0.0.1:6379", - "status": 0, - "weight": 1, - "props": "{}" -} -``` +- For the Divide, gRPC, and Websocket plugins, +the `Import Background Discovery Config` function on the selector creation page +allows you to import and use the backend configuration if the service connecting to the ShenYu Gateway +was configured with shenyu-discovery-related properties (see usage with shenyu-client). +As shown in the following image, click `Import Background Discovery Config` to view the backend configuration: -- If the registered data format is different from the default json format, you can set an alias in the "Conversion process": +![config-import-en.png](/img/shenyu/plugin/discovery/config-import-en.png) -```json -{ - "${yourProtocol}": "tcp", - "${yourUrl}": "127.0.0.1:6379", - "${yourStatus}": 1, - "${yourWeight}": 1, - "${yourProps}": "{}" -} -``` +- If you confirm the import, clicking the `Import` button in the backend configuration popup will automatically populate the form with the backend service discovery properties. +At this point, you only need to configure the listening node: -## 3.2 Configuration in different modes +![after-import-en.png](/img/shenyu/plugin/discovery/after-import-en.png) -### 3.1 LOCAL +> **Note**: If you confirm importing the backend configuration, +the backend service discovery properties will be automatically filled in the form and will continue to use the previous discovery object. +In this case, modifying service discovery properties in the form will be ineffective, and the backend configuration will be retained. -Only the selector level is supported in LOCAL mode -No need to specify a link registry configuration just manually maintain the upstream list +- If you choose the LOCAL mode, there is no need to connect to a registry, and users must manually maintain the upstream list. -![discovery-local-mode.png](/img/shenyu/plugin/discovery/discovery-local-mode.png) -### 3.2 ZOOKEEPER +## 3. Configuration in Different Modes -ZOOKEEPER mode supports both the plugin level and the selector level +### 3.1 Local Mode +- Local mode only supports configuration at the **selector level**. +There is no need to connect to a registry, and users must manually maintain the upstream list. +This list is an editable table. Click the `Edit` button for each row in the table to modify each parameter of the upstream: -SEE `shenyu-discovery-zookeeper#ZookeeperDiscoveryService#init` +![local-selector-en.png](/img/shenyu/plugin/discovery/local-selector-en.png) -```json -{ - "baseSleepTimeMilliseconds": "1000", - "maxRetries": "3", - "maxSleepTimeMilliseconds": "1000", - "connectionTimeoutMilliseconds": "1000", - "sessionTimeoutMilliseconds": "1000", - "namespace": "", - "digest": null -} -``` +### 3.2 ZooKeeper/Nacos/Eureka/Etcd Modes -- You can search for the dictionary name as "zookeeper" in `shenyu-admin` --> BasicConfig --> Dictionary, - and modify the dictionary value corresponding to the default properties - ( __Note__: The dictionary type and dictionary name cannot be modified): +- In the ZooKeeper/Nacos/Eureka/Etcd modes, service discovery configuration is supported at both the plugin level and the selector level. +- For each registry property under these modes, taking ZooKeeper as an example, users can go to `shenyu-admin` --> `BasicConfig` --> `Dictionary`, +search for the dictionary name "zookeeper", and edit the dictionary values corresponding to the default properties +(**Note**: You cannot modify the dictionary type and dictionary name). +- In these modes, the gateway dynamically retrieves service instance information from the registry. Additions, removals, modifications, +and other changes to service instances will be displayed in real-time in the upstream list. +![zk_dict_en.png](/img/shenyu/plugin/tcp/zk_dict_en.png) -![zk_dict.png](/img/shenyu/plugin/tcp/zk_dict_zh.png) +## 4. Using Shenyu-client -# 4.Using with Shenyu-client +### 4.1 Introduction +- To use Shenyu-client, you need to depend on the corresponding mode's registry middleware: ZooKeeper, Nacos, Etcd, Eureka. +These modes can automatically detect service up and down events through ShenYu Admin. +- Additionally, if you are using the local mode, you will need to manually maintain the upstream list. +- For detailed instructions on using Shenyu-client, refer to the Shenyu-client module documentation. -## 4.1 Overview +### 4.2 Local Mode Example -To use with shenyu-client, you need to depend on middleware such as zookeeper, nacos, etcd, eureka for automatic sensing of online and offline status. -For local mode, you need to manually maintain the upstream list. +#### 4.2.1 Using Shenyu-client -## 4.2 Examples +- Shenyu-client defaults to the Local mode, so there is no need for any special discovery configuration. +It will automatically register the current service. +- For services that are automatically registered, you can manually add, modify, +or delete them in the upstream list on the page: -For details on using shenyu-client, see the shenyu-client module. +![local-selector-en.png](/img/shenyu/plugin/discovery/local-selector-en.png) +#### 4.2.2 Without Using Shenyu-client -### 4.2.1 Local Example -Local mode does not require configuration of the registry. +- If you are not using Shenyu-client, you can manually add, modify, +or delete service information on the `Discovery Config` tab under `Add Selector`: -1.If you choose to use shenyu-client to automatically register in Local mode and register the current list: +![add-selector-local-en.png](/img/shenyu/plugin/discovery/add-selector-local-en.png) -![divide-local-discovery-success.png.png](/img/shenyu/plugin/discovery/divide-local-discovery-success.png) +- Configure other selector information: -2. If you do not use shenyu-client, you can configure it manually: +![add-selector-basic-en.png](/img/shenyu/plugin/discovery/add-selector-basic-en.png) -![config_local_selector.png](/img/shenyu/plugin/discovery/config_local_selector.png) +- Configure rules: -Manually configure Selector -![config_local_selector_2.png](/img/shenyu/plugin/discovery/config_local_selector_2.png) -Manually configure Rule -![config_local_selector_3.png](/img/shenyu/plugin/discovery/config_local_selector_3.png) +![rule-en.png](/img/shenyu/plugin/discovery/rule-en.png) -Test connection: +- Test Connection ```text curl http://localhost:9195/http/hello @@ -192,49 +193,57 @@ curl http://localhost:9195/http/hello hello! I'm Shenyu-Gateway System. Welcome!% ``` +### 4.2 Zookeeper Mode Example -### 4.2.2 Zookeeper Example - -Take Divide as an example. +(Taking the Divide plugin as an example) -Add dependencies: +- Add Dependencies ```xml - - org.apache.shenyu - shenyu-discovery-zookeeper - ${project.version} - - - - org.apache.shenyu - shenyu-spring-boot-starter-client-http - + + + org.apache.shenyu + shenyu-discovery-zookeeper + ${project.version} + + + + org.apache.shenyu + shenyu-spring-boot-starter-client-http + + ``` +- Add the Following Configuration in application.yml + ```yaml shenyu: - discovery: - enable: true - type: zookeeper - serverList: ${your.zookeeper.ip}:{your.zookeeper.port} - registerPath: /shenyu/discovery/demo_http_common - props: - baseSleepTimeMilliseconds: 1000 - maxRetries: 4 - maxSleepTimeMilliseconds: 5000 - connectionTimeoutMilliseconds: 60000 - sessionTimeoutMilliseconds: 8 + discovery: + enable: true + type: zookeeper + serverList: ${your.zookeeper.ip}:{your.zookeeper.port} + registerPath: /shenyu/discovery/demo_http_common + props: + baseSleepTimeMilliseconds: 1000 + maxRetries: 4 + maxSleepTimeMilliseconds: 5000 + connectionTimeoutMilliseconds: 60000 + sessionTimeoutMilliseconds: 8 ``` -Start the shenyu-examples-http project. +- Start the shenyu-examples-http service. +- Once the service registration is successful, +you can view the list of automatically registered service instances on the selector page: + +![zk-selector-en.png](/img/shenyu/plugin/discovery/zk-selector-en.png) -The above indicates successful registration. -![divide-zookeeper-discovery-success.png](/img/shenyu/plugin/discovery/divide-zookeeper-discovery-success.png) +- Users can click on `Edit` in the service instance list to edit the service instance information +(Note that in non-Local mode, the URL is maintained by the registry and cannot be manually edited): -![divide-zookeeper-discovery-success_2.png](/img/shenyu/plugin/discovery/divide-zookeeper-discovery-success_2.png) -Test connection: +![edit-zk-upstream-en.png](/img/shenyu/plugin/discovery/edit-zk-upstream-en.png) + +- Test Connection ```text curl http://localhost:9195/http/hello @@ -242,41 +251,45 @@ curl http://localhost:9195/http/hello hello! I'm Shenyu-Gateway System. Welcome!% ``` -### 4.2.3 Etcd Example +### 4.3 Etcd Mode Example -Add dependencies: +- Add Dependencies ```xml - - org.apache.shenyu - shenyu-discovery-etcd - ${project.version} - - - - org.apache.shenyu - shenyu-spring-boot-starter-client-http - + + + org.apache.shenyu + shenyu-discovery-etcd + ${project.version} + + + + org.apache.shenyu + shenyu-spring-boot-starter-client-http + + ``` +- Add the Following Configuration in application.yml + ```yaml shenyu: discovery: enable: true + protocol: http:// type: etcd serverList: http://${your.etcd.host}:${your.etcd.port} - registerPath: shenyu_discovery_demo_http_common + registerPath: /shenyu/test/http_common props: etcdTimeout: 3000 etcdTTL: 5 ``` -Start shenyu-examples-http. +- Start the shenyu-examples-http service. Similarly, on the selector page, +you can see the list of automatically registered service instances and edit them as needed: +![etcd-selector-en.png](/img/shenyu/plugin/discovery/etcd-selector-en.png) -The above indicates successful registration. -![divide-etcd-discovery-success.png](/img/shenyu/plugin/discovery/divide-etcd-discovery-success.png) - -Test connection: +- Test Connection ```text curl http://localhost:9195/http/hello @@ -284,27 +297,33 @@ curl http://localhost:9195/http/hello hello! I'm Shenyu-Gateway System. Welcome!% ``` -### 4.2.4 Eureka Example +### 4.4 Eureka Mode Example -Add dependencies: +- Add Dependencies ```xml - - org.apache.shenyu - shenyu-discovery-eureka - ${project.version} - - - - org.apache.shenyu - shenyu-spring-boot-starter-client-http - + + + org.apache.shenyu + shenyu-discovery-eureka + ${project.version} + + + + org.apache.shenyu + shenyu-spring-boot-starter-client-http + + ``` +- Add the Following Configuration in application.yml + (in this context, `registerPath` can be understood as the name of the service to be monitored): + ```yaml shenyu: discovery: enable: true + protocol: http:// type: eureka serverList: http://${your.eureka.host}:${your.eureka.port}/eureka registerPath: shenyu_discovery_demo_http_common @@ -313,10 +332,12 @@ shenyu: eurekaClientRegistryFetchIntervalSeconds: 10 ``` -The above indicates successful registration. -![divide-eureka-discovery-success.png](/img/shenyu/plugin/discovery/divide-eureka-discovery-success.png) +- Start the shenyu-examples-http service. Similarly, on the selector page, +you can see the list of automatically registered service instances and edit them as needed: -The above indicates successful registration. +![eureka-selector-en.png](/img/shenyu/plugin/discovery/eureka-selector-en.png) + +- Test Connection ```text curl http://localhost:9195/http/hello @@ -324,25 +345,46 @@ curl http://localhost:9195/http/hello hello! I'm Shenyu-Gateway System. Welcome!% ``` -### 4.2.4 Nacos Example +### 4.5 Nacos Mode Example + +- Add Dependencies ```xml - - org.apache.shenyu - shenyu-discovery-nacos - ${project.version} - - - - org.apache.shenyu - shenyu-spring-boot-starter-client-http - + + + org.apache.shenyu + shenyu-discovery-eureka + ${project.version} + + + + org.apache.shenyu + shenyu-spring-boot-starter-client-http + + +``` + +- Add the Following Configuration in application.yml +(Here, `registerPath` can also be understood as the name of the service to be monitored.) + +```yaml +shenyu: + discovery: + enable: true + protocol: http:// + type: nacos + serverList: ${your.nacos.host}:${your.nacos.port} + registerPath: shenyu_discovery_demo_http_common + props: + groupName: SHENYU_GROUP ``` -The above indicates successful registration. -![divide-nacos-discovery-success.png](/img/shenyu/plugin/discovery/divide-nacos-discovery-success.png) +- Start the shenyu-examples-http service. Similarly, on the selector page, +you can view the list of automatically registered service instances and edit them as needed. + +![nacos-selector-en.png](/img/shenyu/plugin/discovery/nacos-selector-en.png) -The above indicates successful registration. +- Test Connection ```text curl http://localhost:9195/http/hello @@ -350,16 +392,31 @@ curl http://localhost:9195/http/hello hello! I'm Shenyu-Gateway System. Welcome!% ``` +> **Note**:Configuring service discovery using Shenyu-client essentially configures service discovery at the plugin level. +Under the same service discovery mode, there is, in fact, only one discovery object +(meaning you can only configure the same set of type, server URL, and service discovery parameters), while multiple listening nodes can be configured. + + +![ws-selector-en.png](/img/shenyu/plugin/discovery/ws-selector-en.png) + +> **Note**:In the Divide and gRPC plugins, you can modify the protocol by configuring the protocol in the application.yml file. +The default protocol for the Websocket plugin is 'ws'. -## 4.3 Changing Weight and Status -status : 0 Healthy , 1 Unhealthy -weight : Weight. For details, see the weight algorithm in the shenyu-loadbalancer module. +## 5. Considerations -![change-weight-status.png](/img/shenyu/plugin/discovery/change-weight-status.png) +- In local mode, you can manually modify all parameters of the upstream on the service list page. +- In non-local modes, you can manually modify parameters other than URL and start time. +- Manually changing the status (open/close) and weight of service instances only affects the current plugin. +- For the same plugin, when configuring discovery-related parameters through Shenyu-client in the backend, it essentially configures service discovery at the plugin level. Although you can manually add selectors on the console page to configure selector-level service discovery, in reality, there is only one discovery object (meaning you can only configure the same set of type, server URL, and service discovery parameters), while multiple listening nodes can be configured. -## 4.4 Test report + + +## 6. Test Report [Test Report](https://www.yuque.com/eureca/pgotw1/hkqkk5laubspgwl3#UojLR) + + + diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/index.md b/i18n/zh/docusaurus-plugin-content-docs/current/index.md index 3a27ffdc761..7d01a934b3a 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/index.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/index.md @@ -120,7 +120,7 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR 如果要自定义,见[自定义插件](https://shenyu.apache.org/docs/developer/custom-plugin/) ---- +--- # Selector & Rule @@ -132,7 +132,7 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR Selector和Rule只匹配一次,然后返回匹配结果。因此最粗的粒度应该最后排序。 ---- +--- # Data Caching & Data Sync @@ -156,14 +156,14 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR ---- +--- # 贡献与支持 * [贡献方式](https://shenyu.apache.org/community/contributor-guide) * [邮件我们](mailto:dev@shenyu.apache.org) ---- +--- # 已知用户 diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/discovery/discovery-mode.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/discovery/discovery-mode.md index 735c2b71436..38724ae89a6 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/discovery/discovery-mode.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/discovery/discovery-mode.md @@ -1,183 +1,171 @@ --- -title: Discovery模块 +title: 服务发现模块 keywords: [ "Discovery" ] -description: Discovery模块 +description: 服务发现模块模块 --- -# 1. 概述 +# 服务发现模块 -## 1.1 模块名称 +## 1. 概述 + +### 1.1 模块名称 Discovery -## 1.2 设计 +### 1.2 设计 -设计图 +- 模块设计图 ![discovery-design.png](/img/shenyu/plugin/discovery/discovery-design.png) -数据库设计 -![db-design.png](/img/shenyu/plugin/discovery/db-design.png) -## 1.3 说明 -`Discovery`网关admin服务主动监听 注册到网管服务. 使得shenyu网关具备主动发现被代理服务列表的变化 -`Discovery` 可以针对 选择器级别, 也可以针对 插件级别. -目前 引入 `Discovery` 插件为 TCP 插件. +- 数据库设计 -### 1.3.1 监听模式 +![db-design.png](/img/shenyu/plugin/discovery/db-design.png) -LOCAL , ZOOKEEPER , NACOS , ERURKA , ETCD -LOCAL 模式 : 主要依靠手动维护 upstream 列表 推送到网管 +### 1.3 模块功能 -ZOOKEEPER 模式 : 监听 zk 下指定节点下的 临时节点变化来获取数据 +Discovery 模块赋予了 ShenYu 网关一种主动感知和响应被代理服务列表变化的能力。 +通过 Discovery 网关 admin 服务的主动监听,ShenYu 网关能够及时掌握被代理服务的变动情况。 +这一功能的设计具有灵活性,可以根据需要在**选择器级别**或**插件级别**进行配置。 +目前,已经引入了 Discovery 功能的插件包括 TCP 插件、Divide 插件、Websocket 插件和 gRPC 插件。 -### 1.3.2 作用范围 -插件级: 作用于整个插件,该插件下所以的选择都会默认使用当前监听模式 -选择器级别: 作用于当前选择器,当前插件下有不同选择器使用不同的监听模式 +### 1.4 监听模式 -# 2. 使用 +LOCAL, ZOOKEEPER, NACOS, EUREKA, ETCD -## 2.1 插件级别配置 +- LOCAL 模式: 主要依靠手动维护 upstream 列表,并推送到网关; +- ZOOKEEPER 模式: 监听 ZooKeeper 中指定节点下临时节点的变化来获取数据; +- NACOS 模式:监听 Nacos 中指定服务名称下实例的变化来获取数据; +- EUREKA 模式: 监听 Eureka 中指定服务名称下实例的变化来获取数据; +- ETCD 模式:通过监听 etcd 中指定节点键值对的变化来获取数据。 -1. 在支持Discovery模块的插件中 点击 `Discovery configuration` 选择响应的监听模式 - 下图以`Zookeeper`为例 - ![config_zk_plugin.png](/img/shenyu/plugin/discovery/config_zk_plugin.png) +### 1.5 作用范围 -2. 在选择器中使用 点击 `Add` 在新增选择器页面点击 `DiscoveryConfig` 发现Type 类型强制选择刚才配置的插件级监听模块 - 此时 收入需要监听的 `ListenerNode` 我们以 : /shenyu/discovery 为例 +- 插件级别:影响整个插件,所有该插件下的选择器都将默认采用当前的监听模式; +- 选择器级别:适用于当前选择器,对于当前插件下的不同选择器,可以使用不同的监听模式。 - ![add_listener_node.png](/img/shenyu/plugin/discovery/add_listener_node.png) +## 2. 使用 - 注意: 这里的 Handler 配置, shenyu 规定的upstream 注册数据是以下 json 形式发送 +### 2.1 插件级别配置 - ```json - { - "url": "127.0.0.1::6379", // upstream 的 url - "protocol": "tcp", // upstream 的 通信协议 - "status": 0, // upstream 节点的状态 (0, healthy, 1 unhealthy) - "weight": 10 // 计算负载均衡时使用 - } - ``` +#### 2.1.1 服务发现配置 - 如果 你的服务 别名和shenyu 定义的 json 格式不同时候 可以在 handler 起别名 - 如上图 我需要吧status 改为 healthy. 其他为改 保存 原有 json-key 的形式 +- 在支持 Discovery 模块的插件中(当前只有 TCP 插件支持在admin控制台页面,进行插件级别 discovery 配置,其他插件可以通过 shenyu-client 进行插件级别 discovery 配置,见下文中的“配合Shenyu-client使用”), 点击 `服务发现配置`, 在弹出的表单中,选择需要的监听模式, + 并填写服务发现名称、注册服务器URL、注册中心配置参数等: -3. 进行后续selector属性配置 详情见具体plugin -## 2.2 选择器级别配置 +![config-discovery-plugin-zh.png](/img/shenyu/plugin/discovery/config-discovery-plugin-zh.png) -类似于插件级别配置. 把 上述的 `1`,`2` 步骤合并在一起 -![discovery-seletor-config.png](/img/shenyu/plugin/discovery/discovery-seletor-config.png) +![config-discovery-plugin-modal-zh.png](/img/shenyu/plugin/discovery/config-discovery-plugin-modal-zh.png) -注意: 使用选择器级别时候. 每次都必须重新配置 +#### 2.1.2 在选择器中使用 -若选择了 LOCAL 模式 则无需接入注册中心, 手动维护upstream列表 +- 点击 `添加选择器`,在新增选择器页面中,我们发现 `类型` 强制选择刚才配置的插件级监听模式,表示所添加的选择器也将采用相同的配置。 + 此时,仅需输入需要监听的 `监听节点` : -![discovery-local-mode.png](/img/shenyu/plugin/discovery/discovery-local-mode.png) + ![add-selector-under-plugin-discovery-zh.png](/img/shenyu/plugin/discovery/add-selector-under-plugin-discovery-zh.png) -# 3. 配置 +- 这里的 `转换处理` 是指,ShenYu 规定的 upstream 注册数据是以下 JSON 格式传输,包括: + - url: upstream 的 url + - protocol: upstream 的通信协议 + - status: upstream 节点的状态 (0: healthy, 1: unhealthy) + - weight: 权重,计算负载均衡时使用 + -## 3.1 注册信息配置 + ```json + { + "url": "127.0.0.1::6379", + "protocol": "tcp", + "status": 0, + "weight": 10 + } + ``` -### 3.1.1 基本配置 +- 如果您的服务别名与ShenYu定义的JSON格式不匹配,您可以在 `转换处理` 中进行别名映射。 + 例如,如上图所示,如果您需要将"status"改为"healthy",而保留其他键不变, + 进行如下操作:起一个新的别名,将"status"映射为"healthy", + 同时保留原有JSON键的形式。 +- 进行选择器剩余的属性的配置,详情见具体插件对应的文档。 -![common-config.png](/img/shenyu/plugin/discovery/common-config.png) +### 2.2 选择器级别配置 -- Type 注册类型 [LOCAL|ZOOKEEPER] -- ListenerNode 注册的监听节点 如`/shenyu/discovery` -- Handler 处理 upstream 注册信息的别名问题 -- ServerList 注册中心链接url +- 在支持 Discovery 模块的插件中,点击 `添加选择器`,在 `服务发现` 标签页中, + 配置类型、监听节点、服务器URL列表、注册中心参数等字段内容,配置内容仅对当前选择器有效,每次新增选择器需要重新配置。 -### 3.1.2 数据详解 +![add-selector-zh.png](/img/shenyu/plugin/discovery/add-selector-zh.png) -- upstream 注册数据为: +- 对于Divide、gRPC、Websocket插件,添加选择器页面有 `导入后台服务发现配置` 功能, + 指的是,如果服务接入 ShenYu 网关时配置了 shenyu-discovery 相关的属性(见配合shenyu-client使用),可以选择导入并沿用后台的配置,如下图我们首先点击 `导入后台服务发现配置` 查看后台配置: -```json -{ - "protocol": "tcp", - "url": "127.0.0.1:6379", - "status": 0, - "weight": 1, - "props": "{}" -} -``` +![config-import-zh.png](/img/shenyu/plugin/discovery/config-import-zh.png) -- 若注册的数据与默认的json格式不同时,可以在“转换处理”中设置别名: +- 如果确认导入,点击后台配置弹出框中的 `导入` 按钮后,后台的服务发现属性将会自动填充进表单, + 此时仅需要再配置监听节点: -```json -{ - "${yourProtocol}": "tcp", - "${yourUrl}": "127.0.0.1:6379", - "${yourStatus}": 1, - "${yourWeight}": 1, - "${yourProps}": "{}" -} -``` +![after-import-zh.png](/img/shenyu/plugin/discovery/after-import-zh.png) -## 3.2 不同模式下的配置 +> **注意**:如果确认导入后台配置,后台的服务发现属性将会自动填充进表单,并沿用之前的discovery对象, +此时,在表单中修改服务发现属性将无效,依然保持后台配置。 -### 3.1 LOCAL +- 若选择了 LOCAL 模式,则无需接入注册中心,用户需要手动维护 upstream 列表。 -LOCAL模式下 只支持 选择器级别 -无需指定链接 注册中心配置 只需手动维护 upstream 列表 -![discovery-local-mode.png](/img/shenyu/plugin/discovery/discovery-local-mode.png) -### 3.2 ZOOKEEPER +## 3. 不同模式下的配置 -ZOOKEEPER模式下 支持 插件级别 和 选择器级别 +### 3.1 local模式 -详情见 `shenyu-discovery-zookeeper#ZookeeperDiscoveryService#init` +- local模式只支持**选择器级别**的配置。无需接入注册中心,用户需要手动维护 upstream 列表。这里的列表是一个可编辑表格, + 点击表格每行的 `编辑` 按钮,可以对 upstream 的每个参数进行修改: -```json -{ - "baseSleepTimeMilliseconds": "1000", - "maxRetries": "3", - "maxSleepTimeMilliseconds": "1000", - "connectionTimeoutMilliseconds": "1000", - "sessionTimeoutMilliseconds": "1000", - "namespace": "", - "digest": null -} -``` +![local-selector-zh.png](/img/shenyu/plugin/discovery/local-selector-zh.png) + +### 3.2 ZooKeeper/Nacos/Eureka/Etcd模式 + +- ZooKeeper/Nacos/Eureka/Etcd模式下,支持插件级别和选择器级别的服务发现配置。 +- 针对每个模式下的注册中心属性,以zookeeper为例,用户可以在`shenyu-admin` --> 基础配置 --> 字典管理 中,搜索字典名称为“zookeeper”,对默认属性对应的字典值进行修改编辑 + (**注意**:不可修改字典类型和字典名称)。 +- 这些模式下,网关会动态地从注册中心获取服务实例信息,服务实例的新增、下线、修改等,将会实时显示在 upstream 列表中。 -- 用户可以在`shenyu-admin` --> 基础配置 --> 字典管理 中,搜索字典名称为“zookeeper”,对默认属性对应的字典值进行修改编辑 - (__注意__:不可修改字典类型和字典名称): ![zk_dict.png](/img/shenyu/plugin/tcp/zk_dict_zh.png) -# 4.配合 Shenyu-client 使用 +## 4. 配合 Shenyu-client 使用 + +### 4.1 介绍 + +- 与 shenyu-client 配合使用需要依赖对应模式的注册中心中间件:zookeeper,nacos,etcd,eureka,这些模式可以通过Shenyu Admin实现自动感知服务的上线和下线。 +- 另外,如果您使用了 local 模式,则需要手动维护upstream列表。 +- shenyu-client 使用详见 shenyu-client 模块。 -## 4.1 概括 +### 4.2 Local 模式示例 -配合shenyu-client使用 需要依赖 -使用中间件 zookeeper, nacos , etcd, eureka 模式 依赖admin 自动感知上下线 -使用local模式 需要 手动维护 upstream列表 +#### 4.2.1 使用shenyu-client -## 4.2 示例 +- shenyu-client 默认为 Local模式,无需进行特殊的 discovery 配置,便可以自动把当前服务注册上去; +- 对于自动注册上来的服务,可以手动在页面的upstream列表进行添加、修改和删除: -shenyu-client 使用详情见 shenyu-client 模块 +![local-selector-zh.png](/img/shenyu/plugin/discovery/local-selector-zh.png) -### 4.2.1 Local示例 +#### 4.2.2 不使用shenyu-client -Local模式 不需要配置注册中心 -1.如果选择使用shenyu-client自动注册为Local模式并且把当前列表注册上去 +- 如果不使用shenyu-client,也可以手动在 `添加选择器` 的 `服务发现` 标签页上添加、修改、删除服务信息: -![divide-local-discovery-success.png.png](/img/shenyu/plugin/discovery/divide-local-discovery-success.png) +![add-selector-local-zh.png](/img/shenyu/plugin/discovery/add-selector-local-zh.png) -2. 如果不使用shenyu-client 你可以自己手动配置 +- 配置选择器其他信息: -![config_local_selector.png](/img/shenyu/plugin/discovery/config_local_selector.png) +![add-selector-basic-zh.png](/img/shenyu/plugin/discovery/add-selector-basic-zh.png) -手动自行添加 -![config_local_selector_2.png](/img/shenyu/plugin/discovery/config_local_selector_2.png) -手动配置Rule -![config_local_selector_3.png](/img/shenyu/plugin/discovery/config_local_selector_3.png) +- 配置规则: -测试连接 +![rule-zh.png](/img/shenyu/plugin/discovery/rule-zh.png) + +- 测试连接 ```text curl http://localhost:9195/http/hello @@ -185,49 +173,53 @@ curl http://localhost:9195/http/hello hello! I'm Shenyu-Gateway System. Welcome!% ``` -### 4.2.2 Zookeeper示例 - -以 Divide为例 +### 4.2 Zookeeper模式示例 -添加依赖 +(以 Divide 插件为例) +- 添加依赖 ```xml - - + + org.apache.shenyu shenyu-discovery-zookeeper ${project.version} - + - -org.apache.shenyu -shenyu-spring-boot-starter-client-http - + + org.apache.shenyu + shenyu-spring-boot-starter-client-http + + ``` +- application.yml 中添加如下配置 + ```yaml shenyu: - discovery: - enable: true - type: zookeeper - serverList: ${your.zookeeper.ip}:{your.zookeeper.port} - registerPath: /shenyu/discovery/demo_http_common - props: - baseSleepTimeMilliseconds: 1000 - maxRetries: 4 - maxSleepTimeMilliseconds: 5000 - connectionTimeoutMilliseconds: 60000 - sessionTimeoutMilliseconds: 8 + discovery: + enable: true + type: zookeeper + serverList: ${your.zookeeper.ip}:{your.zookeeper.port} + registerPath: /shenyu/discovery/demo_http_common + props: + baseSleepTimeMilliseconds: 1000 + maxRetries: 4 + maxSleepTimeMilliseconds: 5000 + connectionTimeoutMilliseconds: 60000 + sessionTimeoutMilliseconds: 8 ``` -启动项目 shenyu-examples-http +- 启动服务 shenyu-examples-http +- 服务注册成功,在选择器页面可以看到自动注册上来的服务实例列表: -上述说明组册成功 -![divide-zookeeper-discovery-success.png](/img/shenyu/plugin/discovery/divide-zookeeper-discovery-success.png) +![zk-selector-zh.png](/img/shenyu/plugin/discovery/zk-selector-zh.png) -![divide-zookeeper-discovery-success_2.png](/img/shenyu/plugin/discovery/divide-zookeeper-discovery-success_2.png) +- 用户可以点击服务实例列表中的 `编辑`,对服务实例信息进行编辑(非Local模式下,URL由注册中心维护,不可手动编辑): -测试连接 +![edit-zk-upstream-zh.png](/img/shenyu/plugin/discovery/edit-zk-upstream-zh.png) + +- 测试连接 ```text curl http://localhost:9195/http/hello @@ -235,42 +227,45 @@ curl http://localhost:9195/http/hello hello! I'm Shenyu-Gateway System. Welcome!% ``` -### 4.2.3 Etcd示例 +### 4.3 Etcd示例 -添加依赖 +- 添加依赖 ```xml - - + + org.apache.shenyu shenyu-discovery-etcd ${project.version} - + - -org.apache.shenyu -shenyu-spring-boot-starter-client-http - + + org.apache.shenyu + shenyu-spring-boot-starter-client-http + + ``` +- application.yml 中添加如下配置 + ```yaml shenyu: - discovery: - enable: true - type: etcd - serverList: http://${your.etcd.host}:${your.etcd.port} - registerPath: shenyu_discovery_demo_http_common - props: - etcdTimeout: 3000 - etcdTTL: 5 + discovery: + enable: true + protocol: http:// + type: etcd + serverList: http://${your.etcd.host}:${your.etcd.port} + registerPath: /shenyu/test/http_common + props: + etcdTimeout: 3000 + etcdTTL: 5 ``` -启动shenyu-examples-http +- 启动服务 shenyu-examples-http,同样地,在选择器页面可以看到自动注册上来的服务实例列表,并可进行编辑: -上述说明组册成功 -![divide-etcd-discovery-success.png](/img/shenyu/plugin/discovery/divide-etcd-discovery-success.png) +![etcd-selector-zh.png](/img/shenyu/plugin/discovery/etcd-selector-zh.png) -测试连接 +- 测试连接 ```text curl http://localhost:9195/http/hello @@ -278,40 +273,45 @@ curl http://localhost:9195/http/hello hello! I'm Shenyu-Gateway System. Welcome!% ``` -### 4.2.4 Eureka示例 +### 4.4 Eureka示例 -添加依赖 +- 添加依赖 ```xml - - + + org.apache.shenyu shenyu-discovery-eureka ${project.version} - + - -org.apache.shenyu -shenyu-spring-boot-starter-client-http - + + org.apache.shenyu + shenyu-spring-boot-starter-client-http + + ``` +- application.yml 中添加如下配置(此处的 `registerPath` 可以理解为需要监听的服务的名称) + ```yaml shenyu: - discovery: - enable: true - type: eureka - serverList: http://${your.eureka.host}:${your.eureka.port}/eureka - registerPath: shenyu_discovery_demo_http_common - props: - eurekaClientRefreshInterval: 10 - eurekaClientRegistryFetchIntervalSeconds: 10 + discovery: + enable: true + protocol: http:// + type: eureka + serverList: http://${your.eureka.host}:${your.eureka.port}/eureka + registerPath: shenyu_discovery_demo_http_common + props: + eurekaClientRefreshInterval: 10 + eurekaClientRegistryFetchIntervalSeconds: 10 ``` -上述说明组册成功 -![divide-eureka-discovery-success.png](/img/shenyu/plugin/discovery/divide-eureka-discovery-success.png) +- 启动服务 shenyu-examples-http,同样地,在选择器页面可以看到自动注册上来的服务实例列表,并可进行编辑: -测试连接 +![eureka-selector-zh.png](/img/shenyu/plugin/discovery/eureka-selector-zh.png) + +- 测试连接 ```text curl http://localhost:9195/http/hello @@ -319,26 +319,42 @@ curl http://localhost:9195/http/hello hello! I'm Shenyu-Gateway System. Welcome!% ``` -### 4.2.4 Nacos示例 +### 4.5 Nacos示例 ```xml - - + + org.apache.shenyu - shenyu-discovery-nacos + shenyu-discovery-eureka ${project.version} - + - -org.apache.shenyu -shenyu-spring-boot-starter-client-http - + + org.apache.shenyu + shenyu-spring-boot-starter-client-http + + ``` -上述说明组册成功 -![divide-nacos-discovery-success.png](/img/shenyu/plugin/discovery/divide-nacos-discovery-success.png) +- application.yml 中添加如下配置(此处的 `registerPath` 同样可以理解为需要监听的服务的名称) -测试连接 +```yaml +shenyu: + discovery: + enable: true + protocol: http:// + type: nacos + serverList: ${your.nacos.host}:${your.nacos.port} + registerPath: shenyu_discovery_demo_http_common + props: + groupName: SHENYU_GROUP +``` + +- 启动服务 shenyu-examples-http,同样地,在选择器页面可以看到自动注册上来的服务实例列表,并可进行编辑: + +![nacos-selector-zh.png](/img/shenyu/plugin/discovery/nacos-selector-zh.png) + +- 测试连接 ```text curl http://localhost:9195/http/hello @@ -346,15 +362,28 @@ curl http://localhost:9195/http/hello hello! I'm Shenyu-Gateway System. Welcome!% ``` -## 4.3 修改权重和状态 +> **注意**:通过shenyu-client配置服务发现,本质上是配置插件级别的服务发现,同一种服务发现模式下, +实际上只有一个discovery对象(即:只能够配置同一套类型-服务器URL-服务发现参数),监听节点可以有多个。 + + +![ws-selector-zh.png](/img/shenyu/plugin/discovery/ws-selector-zh.png) + +> **注意**:Divide插件和Grpc插件中,可以通过在application.yml文件中配置protocol来修改协议,Websocket +插件的协议默认均为ws + + + +## 5. 注意事项 -status : 0 健康 , 1 不健康 +- local 模式下,可以在服务列表页面上手动对 upstream 的所有参数进行修改; +- 非local模式下,可以对除URL、开始时间以外的参数进行手动修改; +- 手动修改服务实例的状态(status:open/close),权重(weight),仅对当前插件生效; +- 对于同一插件,后台通过shenyu-client配置discovery相关参数后,本质上是配置插件级别的服务发现, +控制台页面上可以手动添加选择器以配置选择器级别的服务发现,但实际上只有一个discovery对象(即:只能够配置同一套类型-服务器URL-服务发现参数),监听节点可以有多个。 -weight : 权重 详情见 权重算法 shenyu-loadbalancer 模块 -![change-weight-status.png](/img/shenyu/plugin/discovery/change-weight-status.png) -## 4.4 测试报告 +## 6. 测试报告 [测试报告](https://www.yuque.com/eureca/pgotw1/hkqkk5laubspgwl3#UojLR) diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.5.0/index.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.5.0/index.md index c87aa01a9c3..3f98882b18d 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/version-2.5.0/index.md +++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.5.0/index.md @@ -116,7 +116,7 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR 如果要自定义,见[自定义插件](https://shenyu.apache.org/docs/developer/custom-plugin/) ---- +--- # Selector & Rule @@ -128,7 +128,7 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR Selector和Rule只匹配一次,然后返回匹配结果。因此最粗的粒度应该最后排序。 ---- +--- # Data Caching & Data Sync @@ -152,14 +152,14 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR ---- +--- # 贡献与支持 * [贡献方式](https://shenyu.apache.org/community/contributor-guide) * [邮件我们](mailto:dev@shenyu.apache.org) ---- +--- # 已知用户 diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.5.1/index.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.5.1/index.md index 3a27ffdc761..7d01a934b3a 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/version-2.5.1/index.md +++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.5.1/index.md @@ -120,7 +120,7 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR 如果要自定义,见[自定义插件](https://shenyu.apache.org/docs/developer/custom-plugin/) ---- +--- # Selector & Rule @@ -132,7 +132,7 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR Selector和Rule只匹配一次,然后返回匹配结果。因此最粗的粒度应该最后排序。 ---- +--- # Data Caching & Data Sync @@ -156,14 +156,14 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR ---- +--- # 贡献与支持 * [贡献方式](https://shenyu.apache.org/community/contributor-guide) * [邮件我们](mailto:dev@shenyu.apache.org) ---- +--- # 已知用户 diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.6.0/index.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.6.0/index.md index c3ff795ed39..5de08269bd5 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/version-2.6.0/index.md +++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.6.0/index.md @@ -120,7 +120,7 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR 如果要自定义,见[自定义插件](https://shenyu.apache.org/docs/developer/custom-plugin/) ---- +--- # Selector & Rule @@ -132,7 +132,7 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR Selector和Rule只匹配一次,然后返回匹配结果。因此最粗的粒度应该最后排序。 ---- +--- # Data Caching & Data Sync @@ -156,14 +156,14 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR ---- +--- # 贡献与支持 * [贡献方式](https://shenyu.apache.org/community/contributor-guide) * [邮件我们](mailto:dev@shenyu.apache.org) ---- +--- # 已知用户 diff --git a/static/img/shenyu/plugin/discovery/add-selector-basic-en.png b/static/img/shenyu/plugin/discovery/add-selector-basic-en.png new file mode 100644 index 00000000000..471711156f4 Binary files /dev/null and b/static/img/shenyu/plugin/discovery/add-selector-basic-en.png differ diff --git a/static/img/shenyu/plugin/discovery/add-selector-basic-zh.png b/static/img/shenyu/plugin/discovery/add-selector-basic-zh.png new file mode 100644 index 00000000000..dcc2367f2a9 Binary files /dev/null and b/static/img/shenyu/plugin/discovery/add-selector-basic-zh.png differ diff --git a/static/img/shenyu/plugin/discovery/add-selector-en.png b/static/img/shenyu/plugin/discovery/add-selector-en.png new file mode 100644 index 00000000000..94a540ab3fb Binary files /dev/null and b/static/img/shenyu/plugin/discovery/add-selector-en.png differ diff --git a/static/img/shenyu/plugin/discovery/add-selector-local-en.png b/static/img/shenyu/plugin/discovery/add-selector-local-en.png new file mode 100644 index 00000000000..7aab0ad395b Binary files /dev/null and b/static/img/shenyu/plugin/discovery/add-selector-local-en.png differ diff --git a/static/img/shenyu/plugin/discovery/add-selector-local-zh.png b/static/img/shenyu/plugin/discovery/add-selector-local-zh.png new file mode 100644 index 00000000000..a56fc4c6688 Binary files /dev/null and b/static/img/shenyu/plugin/discovery/add-selector-local-zh.png differ diff --git a/static/img/shenyu/plugin/discovery/add-selector-under-plugin-discovery-en.png b/static/img/shenyu/plugin/discovery/add-selector-under-plugin-discovery-en.png new file mode 100644 index 00000000000..ed8ea8befaa Binary files /dev/null and b/static/img/shenyu/plugin/discovery/add-selector-under-plugin-discovery-en.png differ diff --git a/static/img/shenyu/plugin/discovery/add-selector-under-plugin-discovery-zh.png b/static/img/shenyu/plugin/discovery/add-selector-under-plugin-discovery-zh.png new file mode 100644 index 00000000000..491a6175896 Binary files /dev/null and b/static/img/shenyu/plugin/discovery/add-selector-under-plugin-discovery-zh.png differ diff --git a/static/img/shenyu/plugin/discovery/add-selector-zh.png b/static/img/shenyu/plugin/discovery/add-selector-zh.png new file mode 100644 index 00000000000..eea30602245 Binary files /dev/null and b/static/img/shenyu/plugin/discovery/add-selector-zh.png differ diff --git a/static/img/shenyu/plugin/discovery/after-import-en.png b/static/img/shenyu/plugin/discovery/after-import-en.png new file mode 100644 index 00000000000..26bc185ed4c Binary files /dev/null and b/static/img/shenyu/plugin/discovery/after-import-en.png differ diff --git a/static/img/shenyu/plugin/discovery/after-import-zh.png b/static/img/shenyu/plugin/discovery/after-import-zh.png new file mode 100644 index 00000000000..4aebf598002 Binary files /dev/null and b/static/img/shenyu/plugin/discovery/after-import-zh.png differ diff --git a/static/img/shenyu/plugin/discovery/config-discovery-plugin-en.png b/static/img/shenyu/plugin/discovery/config-discovery-plugin-en.png new file mode 100644 index 00000000000..613833c9d92 Binary files /dev/null and b/static/img/shenyu/plugin/discovery/config-discovery-plugin-en.png differ diff --git a/static/img/shenyu/plugin/discovery/config-discovery-plugin-modal-en.png b/static/img/shenyu/plugin/discovery/config-discovery-plugin-modal-en.png new file mode 100644 index 00000000000..70a368de2ec Binary files /dev/null and b/static/img/shenyu/plugin/discovery/config-discovery-plugin-modal-en.png differ diff --git a/static/img/shenyu/plugin/discovery/config-discovery-plugin-modal-zh.png b/static/img/shenyu/plugin/discovery/config-discovery-plugin-modal-zh.png new file mode 100644 index 00000000000..fc7a540039d Binary files /dev/null and b/static/img/shenyu/plugin/discovery/config-discovery-plugin-modal-zh.png differ diff --git a/static/img/shenyu/plugin/discovery/config-discovery-plugin-zh.png b/static/img/shenyu/plugin/discovery/config-discovery-plugin-zh.png new file mode 100644 index 00000000000..0ba2069012e Binary files /dev/null and b/static/img/shenyu/plugin/discovery/config-discovery-plugin-zh.png differ diff --git a/static/img/shenyu/plugin/discovery/config-import-en.png b/static/img/shenyu/plugin/discovery/config-import-en.png new file mode 100644 index 00000000000..eb13eb884ab Binary files /dev/null and b/static/img/shenyu/plugin/discovery/config-import-en.png differ diff --git a/static/img/shenyu/plugin/discovery/config-import-zh.png b/static/img/shenyu/plugin/discovery/config-import-zh.png new file mode 100644 index 00000000000..2028f333924 Binary files /dev/null and b/static/img/shenyu/plugin/discovery/config-import-zh.png differ diff --git a/static/img/shenyu/plugin/discovery/edit-zk-upstream-en.png b/static/img/shenyu/plugin/discovery/edit-zk-upstream-en.png new file mode 100644 index 00000000000..a11ba47278a Binary files /dev/null and b/static/img/shenyu/plugin/discovery/edit-zk-upstream-en.png differ diff --git a/static/img/shenyu/plugin/discovery/edit-zk-upstream-zh.png b/static/img/shenyu/plugin/discovery/edit-zk-upstream-zh.png new file mode 100644 index 00000000000..f1a62ff1be4 Binary files /dev/null and b/static/img/shenyu/plugin/discovery/edit-zk-upstream-zh.png differ diff --git a/static/img/shenyu/plugin/discovery/etcd-selector-en.png b/static/img/shenyu/plugin/discovery/etcd-selector-en.png new file mode 100644 index 00000000000..c9bbc48266b Binary files /dev/null and b/static/img/shenyu/plugin/discovery/etcd-selector-en.png differ diff --git a/static/img/shenyu/plugin/discovery/etcd-selector-zh.png b/static/img/shenyu/plugin/discovery/etcd-selector-zh.png new file mode 100644 index 00000000000..e66d21ec080 Binary files /dev/null and b/static/img/shenyu/plugin/discovery/etcd-selector-zh.png differ diff --git a/static/img/shenyu/plugin/discovery/eureka-selector-en.png b/static/img/shenyu/plugin/discovery/eureka-selector-en.png new file mode 100644 index 00000000000..f3c9ffbc09a Binary files /dev/null and b/static/img/shenyu/plugin/discovery/eureka-selector-en.png differ diff --git a/static/img/shenyu/plugin/discovery/eureka-selector-zh.png b/static/img/shenyu/plugin/discovery/eureka-selector-zh.png new file mode 100644 index 00000000000..d82389dbb7c Binary files /dev/null and b/static/img/shenyu/plugin/discovery/eureka-selector-zh.png differ diff --git a/static/img/shenyu/plugin/discovery/local-selector-en.png b/static/img/shenyu/plugin/discovery/local-selector-en.png new file mode 100644 index 00000000000..5748f62f264 Binary files /dev/null and b/static/img/shenyu/plugin/discovery/local-selector-en.png differ diff --git a/static/img/shenyu/plugin/discovery/local-selector-zh.png b/static/img/shenyu/plugin/discovery/local-selector-zh.png new file mode 100644 index 00000000000..ae003db6930 Binary files /dev/null and b/static/img/shenyu/plugin/discovery/local-selector-zh.png differ diff --git a/static/img/shenyu/plugin/discovery/nacos-selector-en.png b/static/img/shenyu/plugin/discovery/nacos-selector-en.png new file mode 100644 index 00000000000..26a50b56411 Binary files /dev/null and b/static/img/shenyu/plugin/discovery/nacos-selector-en.png differ diff --git a/static/img/shenyu/plugin/discovery/nacos-selector-zh.png b/static/img/shenyu/plugin/discovery/nacos-selector-zh.png new file mode 100644 index 00000000000..38f4c4ad3b9 Binary files /dev/null and b/static/img/shenyu/plugin/discovery/nacos-selector-zh.png differ diff --git a/static/img/shenyu/plugin/discovery/rule-en.png b/static/img/shenyu/plugin/discovery/rule-en.png new file mode 100644 index 00000000000..b0abff52f08 Binary files /dev/null and b/static/img/shenyu/plugin/discovery/rule-en.png differ diff --git a/static/img/shenyu/plugin/discovery/rule-zh.png b/static/img/shenyu/plugin/discovery/rule-zh.png new file mode 100644 index 00000000000..b5391a220d5 Binary files /dev/null and b/static/img/shenyu/plugin/discovery/rule-zh.png differ diff --git a/static/img/shenyu/plugin/discovery/ws-selector-en.png b/static/img/shenyu/plugin/discovery/ws-selector-en.png new file mode 100644 index 00000000000..f7a7b2341f0 Binary files /dev/null and b/static/img/shenyu/plugin/discovery/ws-selector-en.png differ diff --git a/static/img/shenyu/plugin/discovery/ws-selector-zh.png b/static/img/shenyu/plugin/discovery/ws-selector-zh.png new file mode 100644 index 00000000000..9d41a8aad05 Binary files /dev/null and b/static/img/shenyu/plugin/discovery/ws-selector-zh.png differ diff --git a/static/img/shenyu/plugin/discovery/zk-selector-en.png b/static/img/shenyu/plugin/discovery/zk-selector-en.png new file mode 100644 index 00000000000..99346ddd810 Binary files /dev/null and b/static/img/shenyu/plugin/discovery/zk-selector-en.png differ diff --git a/static/img/shenyu/plugin/discovery/zk-selector-zh.png b/static/img/shenyu/plugin/discovery/zk-selector-zh.png new file mode 100644 index 00000000000..83a55dc621c Binary files /dev/null and b/static/img/shenyu/plugin/discovery/zk-selector-zh.png differ diff --git a/versioned_docs/version-2.5.0/index.md b/versioned_docs/version-2.5.0/index.md index afbbd9bff41..8fbb0087e35 100644 --- a/versioned_docs/version-2.5.0/index.md +++ b/versioned_docs/version-2.5.0/index.md @@ -121,7 +121,7 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR If you want to customize, see [custom-plugin](https://shenyu.apache.org/docs/developer/custom-plugin/) . ---- +--- # Selector & Rule @@ -133,7 +133,7 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR The selector and the rule match only once, and the match is returned. So the coarsest granularity should be sorted last. ---- +--- # Data Caching & Data Sync @@ -157,14 +157,14 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR ---- +--- # Contributor and Support * [How to Contribute](https://shenyu.apache.org/community/contributor-guide) * [Mailing Lists](mailto:dev@shenyu.apache.org) ---- +--- # Known Users diff --git a/versioned_docs/version-2.5.1/index.md b/versioned_docs/version-2.5.1/index.md index 54227ab1860..d12f52adb25 100644 --- a/versioned_docs/version-2.5.1/index.md +++ b/versioned_docs/version-2.5.1/index.md @@ -125,7 +125,7 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR If you want to customize, see [custom-plugin](https://shenyu.apache.org/docs/developer/custom-plugin/) . ---- +--- # Selector & Rule @@ -137,7 +137,7 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR The selector and the rule match only once, and the match is returned. So the coarsest granularity should be sorted last. ---- +--- # Data Caching & Data Sync @@ -161,14 +161,14 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR ---- +--- # Contributor and Support * [How to Contribute](https://shenyu.apache.org/community/contributor-guide) * [Mailing Lists](mailto:dev@shenyu.apache.org) ---- +--- # Known Users diff --git a/versioned_docs/version-2.6.0/index.md b/versioned_docs/version-2.6.0/index.md index f2caa6cf826..6ed8b63106b 100644 --- a/versioned_docs/version-2.6.0/index.md +++ b/versioned_docs/version-2.6.0/index.md @@ -125,7 +125,7 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR If you want to customize, see [custom-plugin](https://shenyu.apache.org/docs/developer/custom-plugin/) . ---- +--- # Selector & Rule @@ -137,7 +137,7 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR The selector and the rule match only once, and the match is returned. So the coarsest granularity should be sorted last. ---- +--- # Data Caching & Data Sync @@ -161,14 +161,14 @@ curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndR ---- +--- # Contributor and Support * [How to Contribute](https://shenyu.apache.org/community/contributor-guide) * [Mailing Lists](mailto:dev@shenyu.apache.org) ---- +--- # Known Users