diff --git a/docs/design/register-center-design.md b/docs/design/register-center-design.md index f54a50089d7..7640e99aa50 100644 --- a/docs/design/register-center-design.md +++ b/docs/design/register-center-design.md @@ -4,9 +4,13 @@ keywords: ["Client Access"] description: Application Client Access --- -Application client access means to access your microservice to ShenYu gateway, currently supports HTTP, Dubbo, Spring Cloud, gRPC, Motan, Sofa, Tars and other protocols access. +> *Notice* +> After ShenYu version 2.6.1, the ShenYu register just support http type, and the middleware register type has been removed. +> So, please use the http register type to register your service. +> ShenYu Register Center isn't microservice register center, it just register metadata, selector data, rule data to shenyu-admin, and then shenyu-admin will sync data to shenyu-gateway. + -Connecting the application client to ShenYu gateway is realized through the registration center, which involves the registration of the client and the synchronization of the server data. The registry supports HTTP, ZooKeeper, Etcd, Consul, and Nacos. +Application client access means to access your microservice to ShenYu gateway, currently supports HTTP, Dubbo, Spring Cloud, gRPC, Motan, Sofa, Tars and other protocols access. Refer to the client access configuration in the user documentation for [Application Client Access Config](../user-guide/property-config/register-center-access.md) . @@ -19,7 +23,7 @@ Refer to the client access configuration in the user documentation for [Applicat ![](/img/shenyu/register/client.png) -Declare the registry client type, such as HTTP or ZooKeeper, in your microservice configuration. Use SPI to load and initialize the corresponding registry client when the application starts, implement the post-processor interface associated with the Spring Bean, get the service interface information to register in it, and place the obtained information into Disruptor. +Declare the registry client type, such as HTTP, in your microservice configuration. Use SPI to load and initialize the corresponding registry client when the application starts, implement the post-processor interface associated with the Spring Bean, get the service interface information to register in it, and place the obtained information into Disruptor. The Registry client reads data from the Disruptor and registers the interface information with shenyu-admin, where the Disruptor decouples data from operations for scaling. @@ -27,7 +31,7 @@ The Registry client reads data from the Disruptor and registers the interface in ![](/img/shenyu/register/server.png) -Declare the registry server type, such as HTTP or ZooKeeper, in the Shenyu-Admin configuration. When shenyu-admin is started, it will read the configuration type, load and initialize the corresponding registry server, and when the registry server receives the interface information registered by shenyu-client, it will put it into Disruptor, which will trigger the registration processing logic to update the interface information and publish a synchronous event. +Declare the registry server type, such as HTTP in the Shenyu-Admin configuration. When shenyu-admin is started, it will read the configuration type, load and initialize the corresponding registry server, and when the registry server receives the interface information registered by shenyu-client, it will put it into Disruptor, which will trigger the registration processing logic to update the interface information and publish a synchronous event. Disruptor provides data and operations decoupling for expansion. If there are too many registration requests, resulting in abnormal registration, there is also a data buffer role. @@ -37,93 +41,6 @@ The principle of HTTP service registration is relatively simple. After Shenyu-Cl After receiving the request, shenyu-admin will update the data and publish the data synchronization event to synchronize the interface information to ShenYu Gateway. -## Zookeeper Registry - -Zookeeper storage struct is: - -``` -shenyu - ├──regsiter - ├ ├──metadata - ├ ├ ├──${rpcType} - ├ ├ ├ ├────${contextPath} - ├ ├ ├ ├──${ruleName} : save metadata data of MetaDataRegisterDTO - ├ ├──uri - ├ ├ ├──${rpcType} - ├ ├ ├ ├────${contextPath} - ├ ├ ├ ├──${ip:port} : save uri data of URIRegisterDTO - ├ ├ ├ ├──${ip:port} -``` - -shenyu-client starts up, the service interface information (MetaDataRegisterDTO/URIRegisterDTO) wrote above the Zookeeper nodes. - -shenyu-admin uses the Watch mechanism of Zookeeper to monitor events such as data update and deletion, and triggers the corresponding registration processing logic after data changes. Upon receipt of a change to the MetadataregisterDTO node, the data change and data synchronization event publication of the selector and rule is triggered. Upon receipt of a UriRegisterDTO node change, the upstream of the selector is triggered to publish an update and data synchronization event. - -## Etcd Registry - -Etcd storage struct is: - -``` -shenyu - ├──regsiter - ├ ├──metadata - ├ ├ ├──${rpcType} - ├ ├ ├ ├────${contextPath} - ├ ├ ├ ├──${ruleName} : save metadata data of MetaDataRegisterDTO - ├ ├──uri - ├ ├ ├──${rpcType} - ├ ├ ├ ├────${contextPath} - ├ ├ ├ ├──${ip:port} : save uri data of URIRegisterDTO - ├ ├ ├ ├──${ip:port} -``` - -shenyu-client starts up, the service interface information (MetaDataRegisterDTO/URIRegisterDTO) wrote in Ephemeral way above Etcd of the node. - -shenyu-admin uses Etcd's Watch mechanism to monitor events such as data update and deletion, and triggers the corresponding registration processing logic after data changes. Upon receipt of a change to the MetadataregisterDTO node, the data change and data synchronization event publication of the selector and rule is triggered. Upon receipt of a UriRegisterDTO node change, the upstream of the selector is triggered to publish an update and data synchronization event. - -## Consul Registry - -Consul register client will save URIRegisterDTO to service instance metadata, and URIRegisterDTO will disappear with service unregister. - -![](/img/shenyu/register/Consul-ui.png) - -And Consul register client will save MetaDataRegisterDTO to Key/Value store, storage struct is: - -``` -shenyu - ├──regsiter - ├ ├──metadata - ├ ├ ├──${rpcType} - ├ ├ ├ ├────${contextPath} - ├ ├ ├ ├──${ruleName} : save metadata data of MetaDataRegisterDTO - -``` - -When shenyu-client is started, The service interface information (MetaDataRegisterDTO/URIRegisterDTO) on the Metadata of the ServiceInstance (URIRegisterDTO) and Key-Value (MetaDataRegisterDTO), Store as described above. - -shenyu-admin senses the update and deletion of data by monitoring the change of index of Catalog and KeyValue, and triggers the corresponding registration processing logic after the change of data. Upon receipt of a change to the MetadataregisterDTO node, the data change and data synchronization event publication of the selector and rule is triggered. Upon receipt of a UriRegisterDTO node change, the upstream of the selector is triggered to publish an update and data synchronization event. - -## Nacos Register - -Nacos registration is divided into two parts: URI and Metadata. URI is registered by instance. In case of service exception, the relevant URI data node will be deleted automatically and send events to the subscriber, and the subscriber will carry out relevant offline processing. Metadata is registered by configuration without any related up-down operation. When a URI instance is registered, the Metadata configuration will be published accordingly. The subscriber monitors data changes and carries out update processing. - -The URI instance registration command rules are as follows: - -``` -shenyu.register.service.${rpcType} -``` - - -Listens on all RpcType nodes initially, and the `${contextPath}` instances registered under them are distinguished by IP and Port, and carry their corresponding contextPath information. After the URI instance is offline, it triggers the update and data synchronization event publication of the selector's upstream. - -When the URI instance goes online, the corresponding Metadata data will be published. The node name command rules are as follows: - -``` -shenyu.register.service.${rpcType}.${contextPath} -``` - -The subscriber side continues to listen for all Metadata configurations, triggering selector and rule data changes and data synchronization events after the initial subscription and configuration update. - ## SPI | *SPI Name* | *Description* | @@ -133,10 +50,6 @@ The subscriber side continues to listen for all Metadata configurations, trigger | *Implementation Class* | *Description* | | -------------------------------- | --------------------------- | | HttpClientRegisterRepository | Http client register repository | -| ZookeeperClientRegisterRepository| Zookeeper client register repository | -| EtcdClientRegisterRepository | Etcd client register repository | -| ConsulClientRegisterRepository | Consul client register repository | -| NacosClientRegisterRepository | Nacos client register repository | | *SPI Name* | *Description* | @@ -146,7 +59,3 @@ The subscriber side continues to listen for all Metadata configurations, trigger | *Implementation Class* | *Description* | | -------------------------------- | ----------------------------- | | ShenyuHttpRegistryController | Http server repository | -| ZookeeperServerRegisterRepository| Zookeeper server registry repository | -| EtcdServerRegisterRepository | Etcd server registry repository | -| ConsulServerRegisterRepository | Consul server registry repository | -| NacosServerRegisterRepository | Nacos server registry repository | diff --git a/docs/user-guide/property-config/register-center-access.md b/docs/user-guide/property-config/register-center-access.md index 00e8de15a08..e3f23d21ed0 100644 --- a/docs/user-guide/property-config/register-center-access.md +++ b/docs/user-guide/property-config/register-center-access.md @@ -4,10 +4,12 @@ keywords: ["register center"] description: register center access --- +> *Notice* +> After ShenYu version 2.6.1, the ShenYu register just support http type, and the middleware register type has been removed. +> So, please use the http register type to register your service. +> ShenYu Register Center isn't microservice register center, it just register metadata, selector data, rule data to shenyu-admin, and then shenyu-admin will sync data to shenyu-gateway. -Application client access means to access your microservice to ShenYu gateway, currently supports HTTP, Dubbo, Spring Cloud, gRPC, Motan, Sofa, Tars and other protocols access. - -Connecting the application client to ShenYu gateway is realized through the registration center, which involves the registration of the client and the synchronization of the server data. The registry supports HTTP, ZooKeeper, Etcd, Consul, and Nacos. +Application client access means to access your microservice to ShenYu gateway, currently supports HTTP, Dubbo, Spring Cloud, gRPC, Motan, Sofa, Tars and other protocols access. Currently, ShenYu just support HTTP register type. This article describes how to configure the application client to access the Apache ShenYu gateway. For related principles, see [Application Client Access](../../design/register-center-design) in the design document . @@ -42,6 +44,9 @@ shenyu: register: registerType: http serverLists: http://localhost:9095 + props: + username: admin + password: 123456 client: http: props: @@ -57,356 +62,9 @@ shenyu: # isFull: set true means providing proxy for your entire service, or only a few controller. apply to springmvc/springcloud ``` - - - - - -### Zookeeper Registry Config - -> Please pay attention! From ShenYu 2.5.0, ShenYu will no longer support Zookeeper 3.4.x or below version. If you're already using Zookeeper, You need to use Zookeeper with a higher version and initialize the data. - -#### shenyu-admin config - -First add the related dependencies to the `pom` file (already added by default) : - -```xml - - org.apache.shenyu - shenyu-register-server-zookeeper - ${project.version} - -``` - - - - -* In the `yml` file, set the register type to `zookeeper` and enter the service address and parameters of `zookeeper`. The configuration information is as follows: - -```yaml -shenyu: - register: - registerType: zookeeper - serverLists: localhost:2181 - props: - sessionTimeout: 5000 - connectionTimeout: 2000 -``` - - - - -#### shenyu-client config - -The following shows the configuration information registered by `zookeeper` when the `Http` service accesses the `Apache ShenYu` gateway as a client. Other clients (such as `Dubbo` and `Spring Cloud`) can be configured in the same way. - - -* First add dependencies to the `pom` file: - - -```xml - - - org.apache.shenyu - shenyu-register-server-zookeeper - ${shenyu.version} - -``` - - - -* Then set the register type to `zookeeper` in `yml` and enter the service address and related parameters as follows: - -```yaml -shenyu: - register: - registerType: zookeeper - serverLists: localhost:2181 - client: - http: - props: - contextPath: /http - appName: http - port: 8189 - isFull: false -# registerType : register type, set zookeeper -# serverList: when register type is zookeeper,set zookeeper address list -# port: your project port number; apply to springmvc/tars/grpc -# contextPath: your project's route prefix through shenyu gateway, such as /order ,/product etc,gateway will route based on it. -# appName:your project name,the default value is`spring.application.name`. -# isFull: set true means providing proxy for your entire service, or only a few controller. apply to springmvc/springcloud -``` - - - - -### Etcd Registry Config - -#### shenyu-admin config - -First add the related dependencies to the `pom` file (already added by default) : - -```xml - - org.apache.shenyu - shenyu-register-server-etcd - ${project.version} - -``` - - - - -* Then set register type to `etcd` in `yml` and enter `etcd` service address and parameters. The configuration information is as follows: + -```yaml -shenyu: - register: - registerType: etcd - serverLists : http://localhost:2379 - props: - etcdTimeout: 5000 - etcdTTL: 5 -``` - - - -#### shenyu-client config - -The following shows the configuration information registered by `Etcd` when the `Http` service accesses the `Apache ShenYu` gateway as a client. Other clients (such as `Dubbo` and `Spring Cloud`) can be configured in the same way. - - -* First add dependencies to the `pom` file: - - -```xml - - - org.apache.shenyu - shenyu-register-server-etcd - ${shenyu.version} - -``` - - - - -* Then set the register type to `etcd` in `yml` and enter the `etcd` service address and related parameters as follows: - -```yaml -shenyu: - register: - registerType: etcd - serverLists: http://localhost:2379 - client: - http: - props: - contextPath: /http - appName: http - port: 8189 - isFull: false -# registerType : register type, set etcd -# serverList: when register type is etcd, add etcd address list -# port: your project port number; apply to springmvc/tars/grpc -# contextPath: your project's route prefix through shenyu gateway, such as /order ,/product etc,gateway will route based on it. -# appName:your project name,the default value is`spring.application.name`. -# isFull: set true means providing proxy for your entire service, or only a few controller. apply to springmvc/springcloud -``` - - - - - -### Consul Registry Config - -#### shenyu-admin config - -First add the related dependencies to the `pom` file : - -```xml - - - org.apache.shenyu - shenyu-register-server-consul - ${project.version} - - - - - com.ecwid.consul - consul-api - ${consul.api.version} - - - -``` - - - -* In the `yml` file to configure the registry as `consul`, the unique configuration of consul is configured under the props node, the configuration information is as follows: - - -```yaml -shenyu: - register: - registerType: consul - serverLists: localhost:8500 - props: - delay: 1 - wait-time: 55 - name: shenyuAdmin - instanceId: shenyuAdmin - hostName: localhost - port: 8500 - tags: test1,test2 - preferAgentAddress: false - enableTagOverride: false - -# registerType : register type, set consul. -# serverLists: consul client agent address (sidecar deployment (single machine or cluster), or the address of consul server agent (only one node of consul server agent can be connected, if it is a cluster, then there will be a single point of failure)) -# delay: The interval of each polling of monitoring metadata, in seconds, the default value is 1 second. -# wait-time: The waiting time for each polling of metadata monitoring, in seconds, the default value is 55 second. -# instanceId: Required, Consul needs to find specific services through instanceId. -# name: The name where the service is registered to consul. -# hostName: When registering the type for consul, fill in the address of the registered service instance. The service instance address registered in the registry will not be used for client calls, so this configuration does not need to be filled in. Port and preferAgentAddress are the same. -# port: When registering the type for consul, fill in the port of the registered service instance. -# tags: Corresponding to the tags configuration in the consul configuration -# preferAgentAddress:Using the address corresponding to the agent on the consul client side as the address of the registered service instance will override the manual configuration of hostName -# enableTagOverride:Corresponding to the enableTagOverride configuration in the consul configuration - -``` - - -#### shenyu-client config - -Register configuration information through the `Consul` method (the registry of the springCloud service itself can be selected at will, and there will be no conflict with the registry selected by shenyu, eureka is used in the example). - - -* First add dependencies to the `pom` file: - -```xml - - - org.apache.shenyu - shenyu-register-client-consul - ${shenyu.version} - -``` - - -* Then set the register type to `consul` in `yml` and config `shenyu.register.props`, and related parameters as follows: - -```yaml -shenyu: - register: - registerType: consul - serverLists: localhost:8500 - props: - name: shenyuSpringCloudExample - instanceId: shenyuSpringCloudExample - hostName: localhost - port: 8500 - tags: test1,test2 - preferAgentAddress: false - enableTagOverride: false -client: - springCloud: - props: - contextPath: /springcloud - port: 8884 -# registerType : register type, set consul. -# serverLists: consul client agent address (sidecar deployment (single machine or cluster), or the address of consul server agent (only one node of consul server agent can be connected, if it is a cluster, then there will be a single point of failure)) -# delay: The interval of each polling of monitoring metadata, in seconds, the default value is 1 second. -# wait-time: The waiting time for each polling of metadata monitoring, in seconds, the default value is 55 second. -# instanceId: Required, Consul needs to find specific services through instanceId. -# name: The name where the service is registered to consul. -# hostName: When registering the type for consul, fill in the address of the registered service instance. The service instance address registered in the registry will not be used for client calls, so this configuration does not need to be filled in. Port and preferAgentAddress are the same. -# port: When registering the type for consul, fill in the port of the registered service instance. -# tags: Corresponding to the tags configuration in the consul configuration -# preferAgentAddress:Using the address corresponding to the agent on the consul client side as the address of the registered service instance will override the manual configuration of hostName -# enableTagOverride:Corresponding to the enableTagOverride configuration in the consul configuration -``` - - - -### Nacos Registry Config - -#### shenyu-admin config - -First add the related dependencies to the `pom` file (already added by default) : - -```xml - - org.apache.shenyu - shenyu-register-server-nacos - ${project.version} - -``` - - - - -* Then in the `yml` file, configure the registry as `nacos`, fill in the related `nacos` service address and parameters, and `nacos` namespace (need to be consistent with `shenyu-client`), the configuration information is as follows: - - -```yaml -shenyu: - register: - registerType: nacos - serverLists : localhost:8848 - props: - nacosNameSpace: ShenyuRegisterCenter -``` - - - - -#### shenyu-client config - -The following shows the configuration information registered by `Nacos` when the `Http` service accesses the `Apache ShenYu` gateway as a client. Other clients (such as `Dubbo` and `Spring Cloud`) can be configured in the same way. - - -* First add dependencies to the `pom` file: - -```xml - - org.apache.shenyu - shenyu-register-client-nacos - ${shenyu.version} - -``` - - - - -* Then in `yml` configure registration mode as `nacos`, and fill in `nacos` service address and related parameters, also need `nacos` namespace (need to be consistent with `shenyu-admin`), IP (optional, then automatically obtain the local IP address) and port, configuration information is as follows: - -```yaml -shenyu: - register: - registerType: nacos - serverLists: localhost:8848 - props: - nacosNameSpace: ShenyuRegisterCenter - client: - http: - props: - contextPath: /http - appName: http - port: 8188 - isFull: false -# registerType : register type, set nacos -# serverList: when register type is nacos, add nacos address list -# port: your project port number; apply to springmvc/tars/grpc -# contextPath: your project's route prefix through shenyu gateway, such as /order ,/product etc,gateway will route based on it. -# appName:your project name,the default value is`spring.application.name`. -# isFull: set true means providing proxy for your entire service, or only a few controller. apply to springmvc/springcloud -# nacosNameSpace: nacos namespace -``` - - - ### Register different type API at same time > follow example use the http and dubbo. @@ -416,8 +74,11 @@ the `yml` configuration like follow: ```yaml shenyu: register: - registerType: nacos - serverLists: localhost:8848 + registerType: http + serverLists: localhost:9195 + props: + username: admin + password: 123456 client: http: props: @@ -444,97 +105,5 @@ shenyu: # nacosNameSpace: nacos namespace ``` -### Apollo Registry Config - -#### shenyu-admin config - -First add the related dependencies to the `pom` file (already added by default) : - -```xml - - org.apache.shenyu - shenyu-register-server-apollo - ${project.version} - -``` - - - - -* Then in the `yml` file, configure the registry as `apollo`, fill in the related `apollo` service address and parameters, and `apollo` namespace (need to be consistent with `shenyu-client`), the configuration information is as follows: - - -```yaml -shenyu: - register: - registerType: apollo #etcd #consul - serverLists: http://localhost:8080 #http://localhost:2379 #localhost:8848 - props: - env: dev - appId: shenyu - namespaceName: application - clusterName: default - token: 0fff5645fc74ee5e0d63a6389433c8c8afc0beea31eed0279ecc1c8961d12da9 - portalUrl: http://localhost:8070 -``` - - - - -#### shenyu-client config - -The following shows the configuration information registered by `apollo` when the `Http` service accesses the `Apache ShenYu` gateway as a client. Other clients (such as `Dubbo` and `Spring Cloud`) can be configured in the same way. - - -* First add dependencies to the `pom` file: - -```xml - - org.apache.shenyu - shenyu-register-client-apollo - ${shenyu.version} - -``` - - - - -* Then in `yml` configure registration mode as `apollo`, and fill in `apollo` service address and related parameters, also need `apollo` namespace (need to be consistent with `shenyu-admin`), IP (optional, then automatically obtain the local IP address) and port, configuration information is as follows: - -```yaml -shenyu: - register: - registerType: apollo #etcd #consul - serverLists: http://localhost:8080 #http://localhost:2379 #localhost:8848 - props: - env: dev - appId: shenyu - namespace: application - clusterName: default - token: 0fff5645fc74ee5e0d63a6389433c8c8afc0beea31eed0279ecc1c8961d12da9 - portalUrl: http://localhost:8070 - client: - http: - props: - contextPath: /http - appName: http - port: 8188 - isFull: false -# registerType : register type, set apollo -# serverList: when register type is apollo, add apollo address list -# env: apollo namespace -# appId: apollo appId -# namespaceName: apollo namespaceName -# clusterName: apollo clusterName -# token: apollo openapi token -# portalUrl: apollo openapi portalUrl like http://localhost:8070 -# port: your project port number; apply to springmvc/tars/grpc -# contextPath: your project's route prefix through shenyu gateway, such as /order ,/product etc,gateway will route based on it. -# appName:your project name,the default value is`spring.application.name`. -# isFull: set true means providing proxy for your entire service, or only a few controller. apply to springmvc/springcloud - -``` - - -In conclusion, this paper mainly describes how to connect your microservices (currently supporting `Http`, `Dubbo`, `Spring Cloud`, `gRPC`, `Motan`, `Sofa`, `Tars` and other protocols) to the `Apache ShenYu` gateway. the Apache ShenYu gateway support registry has `Http`, `Zookeeper`, `Etcd`, `Consul`, `Nacos`, `Apollo` and so on. This paper introduces the different ways to register configuration information when `Http` service is used as the client to access `Apache ShenYu` gateway. +In conclusion, this paper mainly describes how to connect your microservices (currently supporting `Http`, `Dubbo`, `Spring Cloud`, `gRPC`, `Motan`, `Sofa`, `Tars` and other protocols) to the `Apache ShenYu` gateway. the Apache ShenYu gateway support registry has `Http` This paper introduces the different ways to register configuration information when `Http` service is used as the client to access `Apache ShenYu` gateway. diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/design/register-center-design.md b/i18n/zh/docusaurus-plugin-content-docs/current/design/register-center-design.md index 25e775ed345..834068aeb27 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/design/register-center-design.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/design/register-center-design.md @@ -4,10 +4,15 @@ keywords: ["客户端接入"] description: 客户端接入原理 --- +> *注意* +> 在Apache ShenYu version 2.6.1, ShenYu注册中心只支持http类型,中间件注册类型已经被移除。 +> 所以,请使用http注册类型来注册你的服务。 +> ShenYu注册中心不是微服务注册中心,它只是将元数据、选择器数据、规则数据注册到shenyu-admin,然后shenyu-admin将数据同步到shenyu-gateway。 + 应用客户端接入是指将你的微服务接入到`Apache ShenYu`网关,当前支持`Http`、 `Dubbo`、 `Spring Cloud`、 `gRPC`、 `Motan`、 `Sofa`、 `Tars`等协议的接入。 -将应用客户端接入到`Apache ShenYu`网关是通过注册中心来实现的,涉及到客户端注册和服务端同步数据。注册中心支持`Http`、`Zookeeper`、`Etcd`、`Consul`和`Nacos`。 +将应用客户端接入到`Apache ShenYu`网关是通过注册中心来实现的,涉及到客户端注册和服务端同步数据。注册中心支持`Http`。 @@ -21,7 +26,7 @@ description: 客户端接入原理 ![](/img/shenyu/register/client.png) -在你的微服务配置中声明注册中心客户端类型,如`Http`或`Zookeeper`。 +在你的微服务配置中声明注册中心客户端类型,如`Http`。 应用程序启动时使用`SPI`方式加载并初始化对应注册中心客户端,通过实现`Spring Bean`相关的后置处理器接口,在其中获取需要进行注册的服务接口信息,将获取的信息放入`Disruptor`中。 注册中心客户端从`Disruptor`中读取数据,并将接口信息注册到`shenyu-admin`,`Disruptor`在其中起数据与操作解耦的作用,利于扩展。 @@ -30,7 +35,7 @@ description: 客户端接入原理 ![](/img/shenyu/register/server.png) -在`shenyu-admin`配置中声明注册中心服务端类型,如`Http`或`Zookeeper`。当`shenyu-admin`启动时,读取配置类型,加载并初始化对应的注册中心服务端,注册中心服务端收到`shenyu-client`注册的接口信息后,将其放入`Disruptor`中,然后会触发注册处理逻辑,将服务接口信息更新并发布同步事件。 +在`shenyu-admin`配置中声明注册中心服务端类型,如`Http`。当`shenyu-admin`启动时,读取配置类型,加载并初始化对应的注册中心服务端,注册中心服务端收到`shenyu-client`注册的接口信息后,将其放入`Disruptor`中,然后会触发注册处理逻辑,将服务接口信息更新并发布同步事件。 `Disruptor`在其中起到数据与操作解耦,利于扩展。如果注册请求过多,导致注册异常,也有数据缓冲作用。 @@ -40,89 +45,6 @@ description: 客户端接入原理 `shenyu-admin` 收到请求后进行数据更新和数据同步事件发布,将接口信息同步到`Apache ShenYu`网关。 -### Zookeeper注册原理 - -`Zookeeper`存储结构如下: - -``` -shenyu - ├──regsiter - ├ ├──metadata - ├ ├ ├──${rpcType} - ├ ├ ├ ├────${contextPath} - ├ ├ ├ ├──${ruleName} : save metadata data of MetaDataRegisterDTO - ├ ├──uri - ├ ├ ├──${rpcType} - ├ ├ ├ ├────${contextPath} - ├ ├ ├ ├──${ip:port} : save uri data of URIRegisterDTO - ├ ├ ├ ├──${ip:port} -``` - -`shenyu-client`启动时,将服务接口信息(`MetaDataRegisterDTO/URIRegisterDTO`)写到如上的`zookeeper`节点中。 - -`shenyu-admin`使用`Zookeeper`的`Watch`机制,对数据的更新和删除等事件进行监听,数据变更后触发对应的注册处理逻辑。在收到`MetaDataRegisterDTO`节点变更后,触发`selector`和`rule`的数据变更和数据同步事件发布。收到`URIRegisterDTO`节点变更后,触发`selector`的`upstream`的更新和数据同步事件发布。 - -## Etcd注册原理 - -`Etcd`的键值存储结构如下: - -``` -shenyu - ├──regsiter - ├ ├──metadata - ├ ├ ├──${rpcType} - ├ ├ ├ ├────${contextPath} - ├ ├ ├ ├──${ruleName} : save metadata data of MetaDataRegisterDTO - ├ ├──uri - ├ ├ ├──${rpcType} - ├ ├ ├ ├────${contextPath} - ├ ├ ├ ├──${ip:port} : save uri data of URIRegisterDTO - ├ ├ ├ ├──${ip:port} -``` - -`shenyu-client`启动时,将服务接口信息(`MetaDataRegisterDTO/URIRegisterDTO`)以`Ephemeral`方式写到如上的`Etcd`节点中。 - -`shenyu-admin`使用`Etcd`的`Watch`机制,对数据的更新和删除等事件进行监听,数据变更后触发对应的注册处理逻辑。在收到`MetaDataRegisterDTO`节点变更后,触发`selector`和`rule`的数据变更和数据同步事件发布。收到`URIRegisterDTO`节点变更后,触发`selector`的`upstream`的更新和数据同步事件发布。 - -## Consul注册原理 - -`Consul`的`Metadata`和`URI`分两部分存储,`URIRegisterDTO`随着服务注册记录在服务的`metadata`里,服务下线时随着服务节点一起消失。 - -`Consul`的`MetaDataRegisterDTO`存在`Key/Value`里,键值存储结构如下: - -``` -shenyu - ├──regsiter - ├ ├──metadata - ├ ├ ├──${rpcType} - ├ ├ ├ ├────${contextPath} - ├ ├ ├ ├──${ruleName} : save metadata data of MetaDataRegisterDTO - -``` - -`shenyu-client`启动时,将服务接口信息(`MetaDataRegisterDTO/URIRegisterDTO`)分别放在`ServiceInstance`的`Metadata`(`URIRegisterDTO`)和`KeyValue`(`MetaDataRegisterDTO`),按照上述方式进行存储。 - -`shenyu-admin`通过监听`Catalog`和`KeyValue`的`index`的变化,来感知数据的更新和删除,数据变更后触发对应的注册处理逻辑。在收到`MetaDataRegisterDTO`节点变更后,触发`selector`和`rule`的数据变更和数据同步事件发布。收到`URIRegisterDTO`节点变更后,触发`selector`的`upstream`的更新和数据同步事件发布。 - -## Nacos注册原理 - -`Nacos`注册分为两部分:`URI` 和 `Metadata`。`URI` 使用实例注册方式,在服务异常的情况下,相关`URI`数据节点会自动进行删除,并发送事件到订阅端,订阅端进行相关的下线处理。`Metadata` 使用配置注册方式,没有相关上下线操作,当有`URI`实例注册时,会相应的发布`Metadata`配置,订阅端监听数据变化,进行更新处理。 - -`URI`实例注册命令规则如下: - -``` -shenyu.register.service.${rpcType} -``` - -初始监听所有的`RpcType`节点,其下的`${contextPath}`实例会对应注册到其下,根据`IP`和`Port`进行区分,并携带其对应的`contextPath`信息。`URI` 实例上下线之后,触发`selector`的`upstream`的更新和数据同步事件发布。 - -`URI` 实例上线时,会发布对应的 `Metadata` 数据,其节点名称命令规则如下: - -``` -shenyu.register.service.${rpcType}.${contextPath} -``` - -订阅端会对所有的`Metadata`配置继续监听,当初次订阅和配置更新后,触发`selector`和`rule`的数据变更和数据同步事件发布。 ### SPI扩展 @@ -133,10 +55,6 @@ shenyu.register.service.${rpcType}.${contextPath} | *已知实现类* | *详细说明* | | -------------------------------- | --------------------------- | | HttpClientRegisterRepository | 基于Http请求的实现 | -| ZookeeperClientRegisterRepository| 基于Zookeeper注册的实现 | -| EtcdClientRegisterRepository | 基于Etcd注册的实现 | -| ConsulClientRegisterRepository | 基于Consul注册的实现 | -| NacosClientRegisterRepository | 基于Nacos注册的实现 | | *SPI 名称* | *详细说明* | @@ -146,8 +64,4 @@ shenyu.register.service.${rpcType}.${contextPath} | *已知实现类* | *详细说明* | | -------------------------------- | ----------------------------- | | ShenyuHttpRegistryController | 使用Http服务接口来处理客户端注册请求 | -| ZookeeperServerRegisterRepository| 使用Zookeeper来处理客户端注册节点 | -| EtcdServerRegisterRepository | 使用Etcd来处理客户端注册节点 | -| ConsulServerRegisterRepository | 使用Consul来处理客户端注册节点 | -| NacosServerRegisterRepository | 使用Nacos来处理客户端注册节点 | diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/property-config/register-center-access.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/property-config/register-center-access.md index 232af74c365..9bc42753601 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/property-config/register-center-access.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/property-config/register-center-access.md @@ -3,10 +3,15 @@ title: 客户端接入配置 description: 客户端接入配置 --- +> *注意* +> 在Apache ShenYu version 2.6.1, ShenYu注册中心只支持http类型,中间件注册类型已经被移除。 +> 所以,请使用http注册类型来注册你的服务。 +> ShenYu注册中心不是微服务注册中心,它只是将元数据、选择器数据、规则数据注册到shenyu-admin,然后shenyu-admin将数据同步到shenyu-gateway。 + 应用客户端接入是指将你的微服务接入到`Apache ShenYu`网关,当前支持`Http`、 `Dubbo`、 `Spring Cloud`、 `gRPC`、 `Motan`、 `Sofa`、 `Tars`等协议的接入。 -将应用客户端接入到`Apache ShenYu`网关是通过注册中心来实现的,涉及到客户端注册和服务端同步数据。注册中心支持`Http`、`Zookeeper`、`Etcd`、`Consul`和`Nacos`。 +将应用客户端接入到`Apache ShenYu`网关是通过注册中心来实现的,涉及到客户端注册和服务端同步数据。注册类型支持`Http`。 本篇文章介绍将应用客户端接入到`Apache ShenYu`网关,应该如何配置。相关原理请参考设计文档中的 [客户端接入原理](../../design/register-center-design) 。 @@ -48,10 +53,15 @@ shenyu: registerType: http serverLists: http://localhost:9095 props: - contextPath: /http - appName: http - port: 8188 - isFull: false + username: admin + password: 123456 + client: + http: + props: + contextPath: /http + appName: http + port: 8188 + isFull: false # registerType : 服务注册类型,填写 http # serverList: 为http注册类型时,填写Shenyu-Admin项目的地址,注意加上http://,多个地址用英文逗号分隔 # port: 你本项目的启动端口,目前springmvc/tars/grpc需要进行填写 @@ -61,339 +71,7 @@ shenyu: ``` - - -### Zookeeper方式注册配置 - -> 请注意,从 ShenYu 2.5.0 起将不再支持 Zookeeper 3.4.x 或更低版本。如果您已经使用了 Zookeeper 3.4.x 或更低的版本,您需要使用更高的 Zookeeper 版本并重新初始化数据。 - -#### shenyu-admin配置 - -* 首先在 `pom` 文件中加入相关的依赖(默认已经引入): - -```xml - - org.apache.shenyu - shenyu-register-server-zookeeper - ${project.version} - -``` - - - - -* 然后在`yml`文件中配置注册类型为`zookeeper`,填写`zookeeper`服务地址和参数,配置信息如下: - -```yaml -shenyu: - register: - enabled: true - registerType: zookeeper - serverLists: localhost:2181 - props: - sessionTimeout: 5000 - connectionTimeout: 2000 -``` - - - - -#### shenyu-client配置 - -下面展示的是`http`服务作为客户端接入到`Apache ShenYu`网关时,通过`Zookeeper`方式注册配置信息。其他客户端接入时(`Dubbo`、 `Spring Cloud`等),配置方式同理。 - -* 首先在 `pom`文件中加入相关的依赖: - -```xml - - - org.apache.shenyu - shenyu-register-client-zookeeper - ${shenyu.version} - -``` - - - -* 然后在 `yml` 中配置注册类型为`zookeeper`,并填写`Zookeeper`服务地址和相关参数,如下: - -```yaml -shenyu: - register: - enabled: true - registerType: zookeeper - serverLists: localhost:2181 - props: - contextPath: /http - appName: http - port: 8189 - isFull: false -# registerType : 服务注册类型,填写 zookeeper -# serverList: 为zookeeper注册类型时,填写zookeeper地址,多个地址用英文逗号分隔 -# port: 你本项目的启动端口,目前springmvc/tars/grpc需要进行填写 -# contextPath: 为你的这个mvc项目在shenyu网关的路由前缀, 比如/order ,/product 等等,网关会根据你的这个前缀来进行路由. -# appName:你的应用名称,不配置的话,会默认取 `spring.application.name` 的值 -# isFull: 设置true 代表代理你的整个服务,false表示代理你其中某几个controller;目前适用于springmvc/springcloud -``` - - - - -### Etcd方式注册配置 - -#### shenyu-admin配置 - -* 首先在 `pom` 文件中加入相关的依赖(默认已经引入): - -```xml - - org.apache.shenyu - shenyu-register-server-etcd - ${project.version} - -``` - - - - -* 然后在 `yml` 配置注册类型为`etcd`, 填写`etcd`服务地址和参数,配置信息如下: - -```yaml -shenyu: - register: - enabled: true - registerType: etcd - serverLists : http://localhost:2379 -``` - - - -#### shenyu-client配置 - -下面展示的是`http`服务作为客户端接入到`Apache ShenYu`网关时,通过`Etcd`方式注册配置信息。其他客户端接入时(`Dubbo`、 `Spring Cloud`等),配置方式同理。 - - -* 首先在 `pom` 文件中加入相关的依赖: - -```xml - - - org.apache.shenyu - shenyu-register-client-etcd - ${shenyu.version} - -``` - - - - -* 然后在 `yml` 中配置注册类型为`etcd`, 并填写`etcd`服务地址和相关参数,如下: - -```yaml -shenyu: - register: - enabled: true - registerType: etcd - serverLists: http://localhost:2379 - props: - contextPath: /http - appName: http - port: 8189 - isFull: false -# registerType : 服务注册类型,填写 etcd -# serverList: 为etcd注册类型时,填写etcd地址,多个地址用英文逗号分隔 -# port: 你本项目的启动端口,目前springmvc/tars/grpc需要进行填写 -# contextPath: 为你的这个mvc项目在shenyu网关的路由前缀, 比如/order ,/product 等等,网关会根据你的这个前缀来进行路由. -# appName:你的应用名称,不配置的话,会默认取 `spring.application.name` 的值 -# isFull: 设置true 代表代理你的整个服务,false表示代理你其中某几个controller;目前适用于springmvc/springcloud -``` - - - -### Consul方式注册配置 - -#### shenyu-admin配置 - -* 首先在 pom.xml 文件中加入相关的依赖: - -```xml - - - org.apache.shenyu - shenyu-register-server-consul - ${project.version} - - - - - com.ecwid.consul - consul-api - ${consul.api.version} - - - -``` - -* 在 `yml`文件配置注册中心为`consul`, consul的特有配置在props节点下进行配置, 配置信息如下: - -```yaml -shenyu: - register: - enabled: true - registerType: consul - serverLists: localhost:8500 - props: - delay: 1 - wait-time: 55 - name: shenyuAdmin - instanceId: shenyuAdmin - hostName: localhost - port: 8500 - tags: test1,test2 - preferAgentAddress: false - enableTagOverride: false - -# registerType : 服务注册类型,填写 consul -# serverLists: consul client agent地址(sidecar模式部署(单机或者集群),也可以是consul server agent的地址(只能连接一个consul server agent节点,如果是集群,那么会存在单点故障问题)) -# delay: 对Metadata的监控每次轮询的间隔时长,单位为秒,默认1秒 -# wait-time: 对Metadata的监控单次请求的等待时间(长轮询机制),单位为秒,默认55秒 -# instanceId: consul服务必填,consul需要通过instance-id找到具体服务 -# name 服务注册到consul时所在的组名 -# hostName: 为 consul 注册类型时,填写 注册服务实例的 地址, 该注册中心注册的服务实例地址,并不会用于客户端的调用,所以该配置可以不填,port,preferAgentAddress同理 -# port: 为 consul 注册类型时,填写 注册服务实例的 端口 -# tags: 对应consul配置中的tags配置 -# preferAgentAddress:使用consul客户端侧的agent对应的address作为注册服务实例的address,会覆盖hostName的手动配置 -# enableTagOverride:对应consul配置中的enableTagOverride配置 - -``` - - -#### shenyu-client配置 - -下面展示的是`springCloud`服务作为客户端接入到`Apache ShenYu`网关时,通过`Consul`方式注册配置信息(springCloud服务本身的注册中心可以随意选择,与shenyu所选择的注册中心并不会存在冲突,example中使用的是eureka)。其他客户端接入时(`Dubbo`、 `Spring Cloud`等),配置方式同理。 - -* 首先在 `pom` 文件中加入相关的依赖: - -```xml - - - org.apache.shenyu - shenyu-register-client-consul - ${shenyu.version} - -``` - -* 然后在 `yml`文件中配置注册方式为`consul`, 额外还需要配置`shenyu.register.props`, 配置信息如下: - -```yaml -shenyu: - register: - enabled: true - registerType: consul - serverLists: localhost:8500 - props: - name: shenyuSpringCloudExample - instanceId: shenyuSpringCloudExample - hostName: localhost - port: 8500 - tags: test1,test2 - preferAgentAddress: false - enableTagOverride: false - client: - springCloud: - props: - contextPath: /springcloud - port: 8884 - -# registerType : 服务注册类型,填写 consul -# serverLists: consul client agent地址(sidecar模式部署(单机或者集群),也可以是consul server agent的地址(只能连接一个consul server agent节点,如果是集群,那么会存在单点故障问题)) -# shenyu.client.props.port: 你本项目的启动端口,目前springmvc/tars/grpc需要进行填写 -# contextPath: 为你的这个mvc项目在shenyu网关的路由前缀, 比如/order ,/product 等等,网关会根据你的这个前缀来进行路由. -# appName:你的应用名称,不配置的话,会默认取 `spring.application.name` 的值 -# isFull: 设置true 代表代理你的整个服务,false表示代理你其中某几个controller;目前适用于springmvc -# instanceId: consul服务必填,consul需要通过instance-id找到具体服务 -# name 服务注册到consul时所在的组名 -# hostName: 为 consul 注册类型时,填写 注册服务实例的 地址, 该注册中心注册的服务实例地址,并不会用于客户端的调用,所以该配置可以不填,port,preferAgentAddress同理 -# port: 为 consul 注册类型时,填写 注册服务实例的 端口 -# tags: 对应consul配置中的tags配置 -# preferAgentAddress:使用consul客户端侧的agent对应的address作为注册服务实例的address,会覆盖hostName的手动配置 -# enableTagOverride:对应consul配置中的enableTagOverride配置 -``` - - - -### Nacos方式注册配置 - -#### shenyu-admin配置 - -* 首先在 `pom` 文件中加入相关的依赖(默认已经引入): - -```xml - - org.apache.shenyu - shenyu-register-server-nacos - ${project.version} - -``` - - - - -* 然后在 `yml`文件中配置注册中心为`nacos`, 填写相关`nacos`服务地址和参数,还有`nacos`的命名空间(需要和`shenyu-client`保持一致),配置信息如下: - -```yaml -shenyu: - register: - registerType: nacos - serverLists : localhost:8848 - props: - nacosNameSpace: ShenyuRegisterCenter -``` - - - - -#### shenyu-client配置 - -下面展示的是`http`服务作为客户端接入到`Apache ShenYu`网关时,通过`Nacos`方式注册配置信息。其他客户端接入时(`Dubbo`、 `Spring Cloud`等),配置方式同理。 - - -* 首先在 `pom`文件中加入相关的依赖: - -```xml - - org.apache.shenyu - shenyu-register-client-nacos - ${shenyu.version} - -``` - - - - -* 然后在 `yml` 中配置注册方式为`nacos`, 并填写`nacos`服务地址和相关参数,还需要`Nacos`命名空间(需要和`shenyu-admin`端保持一致),IP(可不填,则自动获取本机ip)和端口,配置信息如下: - -```yaml -shenyu: - client: - registerType: nacos - serverLists: localhost:8848 - props: - contextPath: /http - appName: http - port: 8188 - isFull: false - nacosNameSpace: ShenyuRegisterCenter -# registerType : 服务注册类型,填写 nacos -# serverList: 为nacos注册类型时,填写nacos地址,多个地址用英文逗号分隔 -# port: 你本项目的启动端口,目前springmvc/tars/grpc需要进行填写 -# contextPath: 为你的这个mvc项目在shenyu网关的路由前缀,比如/order ,/product 等等,网关会根据你的这个前缀来进行路由. -# appName:你的应用名称,不配置的话,会默认取 `spring.application.name` 的值 -# isFull: 设置true 代表代理你的整个服务,false表示代理你其中某几个controller;目前适用于springmvc/springcloud -# nacosNameSpace: nacos的命名空间 -``` - - + ### 同时注册多种服务类型 @@ -403,8 +81,11 @@ shenyu: ```yaml shenyu: register: - registerType: nacos - serverLists: localhost:8848 + registerType: http + serverLists: localhost + props: + username: admin + password: 123456 client: http: props: @@ -432,7 +113,7 @@ shenyu: ``` -总结,本文主要介绍了如何将你的微服务(当前支持`Http`、 `Dubbo`、 `Spring Cloud`、 `gRPC`、 `Motan`、 `Sofa`、 `Tars`等协议)接入到`Apache ShenYu`网关。介绍了注册中心的原理,`Apache ShenYu`网关支持的注册中心有`Http`、`Zookeeper`、`Etcd`、`Consul`、`Nacos`等方式。介绍了以`http`服务作为客户端接入到`Apache ShenYu`网关时,使用不同方式注册配置信息。 +总结,本文主要介绍了如何将你的微服务(当前支持`Http`、 `Dubbo`、 `Spring Cloud`、 `gRPC`、 `Motan`、 `Sofa`、 `Tars`等协议)接入到`Apache ShenYu`网关。介绍了注册中心的原理,`Apache ShenYu`网关支持的注册中心有`Http`方式。介绍了以`http`服务作为客户端接入到`Apache ShenYu`网关时,使用不同方式注册配置信息。 diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.5.0/user-guide/property-config/register-center-access.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.5.0/user-guide/property-config/register-center-access.md index 232af74c365..d23fd938066 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/version-2.5.0/user-guide/property-config/register-center-access.md +++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.5.0/user-guide/property-config/register-center-access.md @@ -44,14 +44,18 @@ shenyu: ```yaml shenyu: register: - enabled: true registerType: http serverLists: http://localhost:9095 props: - contextPath: /http - appName: http - port: 8188 - isFull: false + username: admin + password: 123456 + client: + http: + props: + contextPath: /http + appName: http + port: 8188 + isFull: false # registerType : 服务注册类型,填写 http # serverList: 为http注册类型时,填写Shenyu-Admin项目的地址,注意加上http://,多个地址用英文逗号分隔 # port: 你本项目的启动端口,目前springmvc/tars/grpc需要进行填写 diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.5.1/user-guide/property-config/register-center-access.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.5.1/user-guide/property-config/register-center-access.md index 232af74c365..d23fd938066 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/version-2.5.1/user-guide/property-config/register-center-access.md +++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.5.1/user-guide/property-config/register-center-access.md @@ -44,14 +44,18 @@ shenyu: ```yaml shenyu: register: - enabled: true registerType: http serverLists: http://localhost:9095 props: - contextPath: /http - appName: http - port: 8188 - isFull: false + username: admin + password: 123456 + client: + http: + props: + contextPath: /http + appName: http + port: 8188 + isFull: false # registerType : 服务注册类型,填写 http # serverList: 为http注册类型时,填写Shenyu-Admin项目的地址,注意加上http://,多个地址用英文逗号分隔 # port: 你本项目的启动端口,目前springmvc/tars/grpc需要进行填写 diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.6.0/user-guide/property-config/register-center-access.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.6.0/user-guide/property-config/register-center-access.md index 232af74c365..d23fd938066 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/version-2.6.0/user-guide/property-config/register-center-access.md +++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.6.0/user-guide/property-config/register-center-access.md @@ -44,14 +44,18 @@ shenyu: ```yaml shenyu: register: - enabled: true registerType: http serverLists: http://localhost:9095 props: - contextPath: /http - appName: http - port: 8188 - isFull: false + username: admin + password: 123456 + client: + http: + props: + contextPath: /http + appName: http + port: 8188 + isFull: false # registerType : 服务注册类型,填写 http # serverList: 为http注册类型时,填写Shenyu-Admin项目的地址,注意加上http://,多个地址用英文逗号分隔 # port: 你本项目的启动端口,目前springmvc/tars/grpc需要进行填写 diff --git a/static/img/shenyu/register/register-http-client-yml.jpg b/static/img/shenyu/register/register-http-client-yml.jpg new file mode 100644 index 00000000000..cd976b42683 Binary files /dev/null and b/static/img/shenyu/register/register-http-client-yml.jpg differ diff --git a/versioned_docs/version-2.5.0/user-guide/property-config/register-center-access.md b/versioned_docs/version-2.5.0/user-guide/property-config/register-center-access.md index af4a161846f..e24e1d03ab4 100644 --- a/versioned_docs/version-2.5.0/user-guide/property-config/register-center-access.md +++ b/versioned_docs/version-2.5.0/user-guide/property-config/register-center-access.md @@ -42,13 +42,16 @@ shenyu: register: registerType: http serverLists: http://localhost:9095 + props: + username: admin + password: 123456 client: http: - props: - contextPath: /http - appName: http - port: 8188 - isFull: false + props: + contextPath: /http + appName: http + port: 8188 + isFull: false # registerType : register type, set http # serverList: when register type is http,set shenyu-admin address list,pls note 'http://' is necessary. # port: your project port number; apply to springmvc/tars/grpc diff --git a/versioned_docs/version-2.5.1/user-guide/property-config/register-center-access.md b/versioned_docs/version-2.5.1/user-guide/property-config/register-center-access.md index af4a161846f..e24e1d03ab4 100644 --- a/versioned_docs/version-2.5.1/user-guide/property-config/register-center-access.md +++ b/versioned_docs/version-2.5.1/user-guide/property-config/register-center-access.md @@ -42,13 +42,16 @@ shenyu: register: registerType: http serverLists: http://localhost:9095 + props: + username: admin + password: 123456 client: http: - props: - contextPath: /http - appName: http - port: 8188 - isFull: false + props: + contextPath: /http + appName: http + port: 8188 + isFull: false # registerType : register type, set http # serverList: when register type is http,set shenyu-admin address list,pls note 'http://' is necessary. # port: your project port number; apply to springmvc/tars/grpc diff --git a/versioned_docs/version-2.6.0/user-guide/property-config/register-center-access.md b/versioned_docs/version-2.6.0/user-guide/property-config/register-center-access.md index 00e8de15a08..9f1d0c3d493 100644 --- a/versioned_docs/version-2.6.0/user-guide/property-config/register-center-access.md +++ b/versioned_docs/version-2.6.0/user-guide/property-config/register-center-access.md @@ -42,6 +42,9 @@ shenyu: register: registerType: http serverLists: http://localhost:9095 + props: + username: admin + password: 123456 client: http: props: