You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2019/05/26 04:09:51 UTC

[servicecomb-docs] branch master updated (e32f04b -> 4a12cfe)

This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-docs.git.


    from e32f04b  remove weak TLS cipher suits from default config
     new 97d72ef  Make the definition of EdgeService more accurate
     new 4a12cfe  fix the discription of loadbalance

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../en_US/edge/by-servicecomb-sdk.md               |  2 +-
 .../en_US/references-handlers/loadbalance.md       | 40 ++++++++++++----------
 .../zh_CN/edge/by-servicecomb-sdk.md               |  3 +-
 .../zh_CN/references-handlers/loadbalance.md       | 36 ++++++++++---------
 4 files changed, 43 insertions(+), 38 deletions(-)


[servicecomb-docs] 02/02: fix the discription of loadbalance

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-docs.git

commit 4a12cfe2b2f8764b421f0aeba8263305de31f19e
Author: yhs0092 <yh...@163.com>
AuthorDate: Sat May 25 18:57:31 2019 +0800

    fix the discription of loadbalance
    
    1. the default value of `continuousFailureThreshold` should be 5
    2. correct the description on the routing by instance attributes
---
 .../en_US/references-handlers/loadbalance.md       | 40 ++++++++++++----------
 .../zh_CN/references-handlers/loadbalance.md       | 36 ++++++++++---------
 2 files changed, 41 insertions(+), 35 deletions(-)

diff --git a/java-chassis-reference/en_US/references-handlers/loadbalance.md b/java-chassis-reference/en_US/references-handlers/loadbalance.md
index bdc6f7a..58dfcf9 100644
--- a/java-chassis-reference/en_US/references-handlers/loadbalance.md
+++ b/java-chassis-reference/en_US/references-handlers/loadbalance.md
@@ -9,7 +9,7 @@ DiscoveryTree's logic is more complex, its processing progress is as below:
 
 Load balancing can be configured in the Consumer processing chain, the handler name is loadbalance, as follows:
 
-```
+```yaml
 servicecomb:
   handler:
     chain:
@@ -18,7 +18,7 @@ servicecomb:
 ```
 
 POM dependence:
-```
+```xml
  <dependency>
   <groupId>org.apache.servicecomb</groupId>
   <artifactId>handler-loadbalance</artifactId>
@@ -43,30 +43,34 @@ This rule is enabled by default. If it is not needed, set servicecomb.loadbalanc
 
 ## Routing and forwarding by instance attributes
 Users can specify the properties of microservice instances in microservice.yaml, or by calling service center APIs.
-```
+```yaml
 instance_description:
   properties:
-    tag: mytag
+    tags:
+      tag_key: tag_value
 ```
 
 Consumers can specify provider instances' attributes to determine which instances to call.
-```
+```yaml
 servicecomb:
   loadbalance:
-    myservice:
+    # Here the "provider" means the config items below only take effect on the service named "provider"
+    # In cross-app invocation, the AppID should be prefixed, like "AppIDOfProvider:provider"
+    provider:
       transactionControl:
         options:
-          tag: mytag
+          tags:
+            tag_key: expected_tag_value
 ```
-The above configuration shows that only myservice instances with the tag attribute mytag are called.
+The above configuration shows that only the instances of "provider" with the tag attribute `tag_key:expected_tag_value` are called.
 
 This rule needs to be configured separately for each service. Global rule for all services is not supported.
 
-This rule is enabled by default, it can be disabled by setting servicecomb.loadbalance.filter.instanceProperty.enabled to false. The instance attributes based routing policy is implemented in InstancePropertyDiscoveryFilter.
+This rule is enabled by default, it can be disabled by setting `servicecomb.loadbalance.filter.instanceProperty.enabled` to false. The instance attributes based routing policy is implemented in `InstancePropertyDiscoveryFilter`.
 
 ## Instance isolation
 Developers can configure instance-isolated parameters to temporarily drop access to the wrong instance, improving system reliability and performance. Below are the configuration items and default values:
-```
+```yaml
 servicecomb:
   loadbalance:
     isolation:
@@ -74,10 +78,10 @@ servicecomb:
       errorThresholdPercentage: 0
       enableRequestThreshold: 5
       singleTestTime: 60000
-      continuousFailureThreshold: 2
+      continuousFailureThreshold: 5
 ```
 
-The interval of isolation calculation is 1 minute. According to the above configuration, in 1 minute, if the total number of requests is greater than 5, and more than 2 consecutive  errors occur, the instance is isolated. 
+The interval of isolation calculation is 1 minute. According to the above configuration, in 1 minute, if the total number of requests is greater than 5, and more than 2 consecutive  errors occur, the instance is isolated.
 
 The default value of errorThresholdPercentage is 0, indicates that the rule is ommited. The item should be a integer less than 100, for example 20, then within 1 minutes, if the total number of request is greater than 5 and [1] error rate is greater than 20% or [2] more than 2 consecutive  errors occur, is instance is isolated.
 
@@ -94,7 +98,7 @@ The default instance state detection mechanism is to send a telnet instruction,
 2. Configure SPI: Add META-INF/services/org.apache.servicecomb.serviceregistry.consumer.MicroserviceInstancePing, the content is the full path of the implementation class
 
 Developers can configure different isolation policies for different microservices. Just add a service name to the configuration item, for example:
-```
+```yaml
 servicecomb:
   loadbalance:
     myservice:
@@ -110,7 +114,7 @@ This rule is enabled by default and can be turned off by setting servicecomb.loa
 
 ## Configuring route rules
 Developers can specify load balancing policies through configuration items.
-```
+```yaml
 servicecomb:
   loadbalance:
     strategy:
@@ -118,7 +122,7 @@ servicecomb:
 ```
 
 Developers can configure policies for different microservices by adding a service name, for example:
-```
+```yaml
 servicecomb:
   loadbalance:
     myservice:
@@ -130,7 +134,7 @@ Each policy has some specific configuration items.
 
 * SessionStickiness
 
-```
+```yaml
 servicecomb:
   loadbalance:
     SessionStickinessRule:
@@ -140,7 +144,7 @@ servicecomb:
 
 ## Set retry strategy
 The load balancing module also supports the policy retry.
-```
+```yaml
 servicecomb:
   loadbalance:
     retryEnabled: false
@@ -148,7 +152,7 @@ servicecomb:
     retryOnSame: 0
 ```
 Retry is not enabled by default. Developers can set different strategies for different services:
-```
+```yaml
 servicecomb:
   loadbalance:
     myservice:
diff --git a/java-chassis-reference/zh_CN/references-handlers/loadbalance.md b/java-chassis-reference/zh_CN/references-handlers/loadbalance.md
index 0265379..bd8065b 100644
--- a/java-chassis-reference/zh_CN/references-handlers/loadbalance.md
+++ b/java-chassis-reference/zh_CN/references-handlers/loadbalance.md
@@ -8,7 +8,7 @@ DiscoveryTree的逻辑比较复杂,可以通过下面的处理流程了解其
 ![](/assets/loadbalance-001.png)
 
 负载均衡适用于Consumer处理链,名称为loadbalance,示例如下:
-```
+```yaml
 servicecomb:
   handler:
     chain:
@@ -17,7 +17,7 @@ servicecomb:
 ```
 
 POM依赖:
-```
+```xml
  <dependency>
   <groupId>org.apache.servicecomb</groupId>
   <artifactId>handler-loadbalance</artifactId>
@@ -42,30 +42,32 @@ servicecomb:
 
 ## 根据实例属性进行路由转发
 微服务可以指定实例的属性。实例属性可以在microservice.yaml中指定,也可以通过服务中心的API进行修改。
-```
+```yaml
 instance_description:
   properties:
-    tag: mytag
+    tags:
+      tag_key: tag_value
 ```
 
 消费者可以指定消费具备某些属性的实例,不访问其他实例
-```
+```yaml
 servicecomb:
   loadbalance:
-    myservice:
+    provider:   # 这里表示配置对名为"provider"的服务生效,如果是跨应用调用,则还需要加上AppID,如"AppIDOfProvider:provider"
       transactionControl:
         options:
-          tag: mytag
+          tags:
+            tag_key: expected_tag_value
 ```
-上面的配置表示只访问myservice所有实例中tag属性为mytag的实例。
+上面的配置表示只访问myservice所有实例中`tag_key`属性为`expected_tag_value`的实例。
 
 该规则需要给每个服务单独配置,未配置表示不启用该规则,不支持对于所有服务的全局配置。
 
-该规则默认启用,如果不需要使用,可以通过servicecomb.loadbalance.filter.instanceProperty.enabled进行关闭。根据实例属性进行路由转发功能在InstancePropertyDiscoveryFilter实现。
+该规则默认启用,如果不需要使用,可以通过`servicecomb.loadbalance.filter.instanceProperty.enabled`进行关闭。根据实例属性进行路由转发功能在`InstancePropertyDiscoveryFilter`实现。
 
 ## 实例隔离功能
 开发者可以配置实例隔离的参数,以暂时屏蔽对于错误实例的访问,提升系统可靠性和性能。下面是其配置项和缺省值
-```
+```yaml
 servicecomb:
   loadbalance:
     isolation:
@@ -73,7 +75,7 @@ servicecomb:
       errorThresholdPercentage: 0
       enableRequestThreshold: 5
       singleTestTime: 60000
-      continuousFailureThreshold: 2
+      continuousFailureThreshold: 5
 ```
 
 隔离的统计周期是1分钟。按照上面的配置,在1分钟内,如果请求总数大于5,并且连续错误超过2次,那么就会将实例隔离。
@@ -91,7 +93,7 @@ servicecomb:
 2. 配置SPI:增加META-INF/services/org.apache.servicecomb.serviceregistry.consumer.MicroserviceInstancePing,内容为实现类的全名
 
 开发者可以针对不同的微服务配置不一样的隔离策略。只需要给配置项增加服务名,例如:
-```
+```yaml
 servicecomb:
   loadbalance:
     myservice:
@@ -107,7 +109,7 @@ servicecomb:
 
 ## 配置路由规则
 开发者可以通过配置项指定负载均衡策略。
-```
+```yaml
 servicecomb:
   loadbalance:
     strategy:
@@ -115,7 +117,7 @@ servicecomb:
 ```
 
 开发者可以针对不同的微服务配置不一样的策略,只需要给配置项增加服务名,例如:
-```
+```yaml
 servicecomb:
   loadbalance:
     myservice:
@@ -127,7 +129,7 @@ servicecomb:
 
 * SessionStickiness
 
-```
+```yaml
 servicecomb:
   loadbalance:
     SessionStickinessRule:
@@ -137,7 +139,7 @@ servicecomb:
 
 ## 设置重试策略
 负载均衡模块还支持配置失败重试的策略。
-```
+```yaml
 servicecomb:
   loadbalance:
     retryEnabled: false
@@ -145,7 +147,7 @@ servicecomb:
     retryOnSame: 0
 ```
 缺省情况未启用重试。同时也支持对不同的服务设置特殊的策略:
-```
+```yaml
 servicecomb:
   loadbalance:
     myservice:


[servicecomb-docs] 01/02: Make the definition of EdgeService more accurate

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-docs.git

commit 97d72efe7de9fa0b9bf24f779e8f2848b19e4e9b
Author: yhs0092 <yh...@163.com>
AuthorDate: Sat May 25 19:14:30 2019 +0800

    Make the definition of EdgeService more accurate
    
    `EdgeService` is an API gateway service development framework instead of
    a "service"
---
 java-chassis-reference/en_US/edge/by-servicecomb-sdk.md | 2 +-
 java-chassis-reference/zh_CN/edge/by-servicecomb-sdk.md | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/java-chassis-reference/en_US/edge/by-servicecomb-sdk.md b/java-chassis-reference/en_US/edge/by-servicecomb-sdk.md
index 9a9212a..b849ac6 100755
--- a/java-chassis-reference/en_US/edge/by-servicecomb-sdk.md
+++ b/java-chassis-reference/en_US/edge/by-servicecomb-sdk.md
@@ -1,6 +1,6 @@
 # Using Edge Service for Edge Services
 
-Edge Service is the JAVA gateway service provided by ServiceComb. As the external interface of the entire microservice system, the Edge Service provides services to end users, accesses RESTful requests, and forwards them to internal microservices. The Edge Service is provided in the form of a development framework. Developers can easily build an Edge Service service and define routing and forwarding rules with a simple configuration. At the same time, Edge Service supports powerful expan [...]
+Edge Service is the JAVA gateway service development framework provided by ServiceComb. As the external interface of the entire microservice system, the Edge Service provides services to end users, accesses RESTful requests, and forwards them to internal microservices. The Edge Service is provided in the form of a development framework. Developers can easily build an Edge Service service and define routing and forwarding rules with a simple configuration. At the same time, Edge Service s [...]
 
 The Edge Service itself is also a microservice that is subject to all microservice development rules. It can be deployed as a multi-instance, and the front-end uses a load balancing device for load distribution. It can also be deployed as a master and backup, and directly access user requests. Developers can plan according to the logic and service access and networking conditions carried by the Edge Service.
 
diff --git a/java-chassis-reference/zh_CN/edge/by-servicecomb-sdk.md b/java-chassis-reference/zh_CN/edge/by-servicecomb-sdk.md
index bda6b16..9573eb4 100644
--- a/java-chassis-reference/zh_CN/edge/by-servicecomb-sdk.md
+++ b/java-chassis-reference/zh_CN/edge/by-servicecomb-sdk.md
@@ -1,6 +1,6 @@
 # 使用Edge Service做边缘服务
 
-Edge Service是ServiceComb提供的JAVA网关服务。Edge Service作为整个微服务系统对外的接口,向最终用户提供服务,接入RESTful请求,转发给内部微服务。Edge Service以开发框架的形式提供,开发者可以非常简单的搭建一个Edge Service服务,通过简单的配置就可以定义路由转发规则。同时Edge Service支持强大的扩展能力,服务映射、请求解析、加密解密、鉴权等逻辑都可以通过扩展实现。
+Edge Service是ServiceComb提供的JAVA网关服务开发框架。Edge Service作为整个微服务系统对外的接口,向最终用户提供服务,接入RESTful请求,转发给内部微服务。Edge Service以开发框架的形式提供,开发者可以非常简单的搭建一个Edge Service服务,通过简单的配置就可以定义路由转发规则。同时Edge Service支持强大的扩展能力,服务映射、请求解析、加密解密、鉴权等逻辑都可以通过扩展实现。
 
 Edge Service本身也是一个微服务,需遵守所有微服务开发的规则。其本身可以部署为多实例,前端使用负载均衡装置进行负载分发;也可以部署为主备,直接接入用户请求。开发者可以根据Edge Service承载的逻辑和业务访问量、组网情况来规划。
 
@@ -335,4 +335,3 @@ servicecomb:
 ```
 
 这个例子,表示转发请求给所有的微服务都必须经过鉴权,但是调用鉴权微服务时不需要鉴权。
-