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/08/03 13:19:52 UTC
[servicecomb-website] branch master updated: SCB-1413 update the
outdated loadbalance docs links
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-website.git
The following commit(s) were added to refs/heads/master by this push:
new 3c0bba6 SCB-1413 update the outdated loadbalance docs links
3c0bba6 is described below
commit 3c0bba66cc79d6a0e5e6432a90dd45fe020eec86
Author: linzb0123 <li...@qq.com>
AuthorDate: Fri Aug 2 19:18:28 2019 +0800
SCB-1413 update the outdated loadbalance docs links
---
_users/cn/service-configurations.md | 60 +------------------------------------
_users/service-configurations.md | 59 +-----------------------------------
2 files changed, 2 insertions(+), 117 deletions(-)
diff --git a/_users/cn/service-configurations.md b/_users/cn/service-configurations.md
index fd531bf..2a2bd5e 100755
--- a/_users/cn/service-configurations.md
+++ b/_users/cn/service-configurations.md
@@ -11,68 +11,10 @@ redirect_from:
{% include toc %}
## 负载均衡策略
-### 场景描述
-
- ServiceComb提供了基于Ribbon的负载均衡方案,用户可以通过配置文件配置负载均衡策略,当前支持随机、顺序、基于响应时间的权值等多种负载均衡路由策略。
-
-### 配置说明
-
- 负载均衡策略在microservice.yaml文件中配置,配置项为`servicecomb.loadbalance.[MicroServiceName].[property name]`,其中若省略MicroServiceName,则为全局配置;若指定MicroServiceName,则为针对特定微服务的配置。
-
- **表1 配置项说明**
-
-| 配置项 | 默认值 | 取值范围 | 是否必选 | 含义 | 注意 |
-| :--- | :--- | :--- | :--- | :--- | :--- |
-| servicecomb.loadbalance.NFLoadBalancerRuleClassName | com.netflix.loadbalancer.RoundRobinRule | com.netflix.loadbalancer.RoundRobinRule(轮询)com.netflix.loadbalancer.RandomRule(随机)com.netflix.loadbalancer.WeightedResponseTimeRule(服务器响应时间权值)org.apache.servicecomb.loadbalance.SessionStickinessRule(会话保持) | 否 | 负载均衡路由策略 | - |
-| servicecomb.loadbalance.SessionStickinessRule.sessionTimeoutInSeconds | 30 | Integer | 否 | 客户端闲置时间,超过限制后选择后面的服务器。 | 暂不支持微服务配置。e.g. servicecomb.loadbalance.SessionStickinessRule.sessionTimeoutInSeconds,不能配置为servicecomb.loadbalance.DemoService.SessionStickinessRule.sessionTimeoutInSeconds |
-| servicecomb.loadbalance.SessionStickinessRule.successiveFailedTimes | 5 | Integer | 否 | 客户端失败次数,超过后会切换服务器 | 暂不支持微服务配置 |
-| servicecomb.loadbalance.retryEnabled | FALSE | Boolean | 否 | 负载均衡捕获到服务调用异常,是否进行重试 | - |
-| servicecomb.loadbalance.retryOnNext | 0 | Integer | 否 | 尝试新的服务器的次数 | - |
-| servicecomb.loadbalance.retryOnSame | 0 | Integer | 否 | 同一个服务器尝试的次数 | - |
-| servicecomb.loadbalance.isolation.enabled | FALSE | Boolean | 否 | 是否开启故障实例隔离功能 | - |
-| servicecomb.loadbalance.isolation.enableRequestThreshold | 20 | Integer | 否 | 当实例的调用总次数达到该值时开始进入隔离逻辑门槛 | - |
-| servicecomb.loadbalance.isolation.errorThresholdPercentage | 20 | Integer,区间为\(0,100\] | 否 | 实例故障隔离错误百分比 | - |
-| servicecomb.loadbalance.isolation.singleTestTime | 10000 | Integer | 否 | 故障实例单点测试时间 | 单位为ms |
-| servicecomb.loadbalance.transactionControl.policy | org.apache.servicecomb.loadbalance.filter.SimpleTransactionControlFilter | - | 否 | 动态路由分流策略 | 框架提供了简单的分流机制,开发者也可以实现自定义的分流过滤策略 |
-| servicecomb.loadbalance.transactionControl.options | - | key/value pairs | 否 | 针对SimpleTransactionControlFilter分流策略的配置项,可添加任意项过滤标签 | - |
-
-### 示例代码
-
- 负载均衡策略配置在src/main/resources/microservice.yaml文件中。
-
- 配置处理链:
-
-```yaml
-servicecomb:
- # other configurations omitted
- handler:
- chain:
- Consumer:
- default: loadbalance
- # other configurations omitted
-```
-
- 增加路由策略:
-
-```yaml
-servicecomb:
- # other configurations omitted
- loadbalance:
- NFLoadBalancerRuleClassName: com.netflix.loadbalancer.RoundRobinRule
- # other configurations omitted
-```
-
-## 自定义路由策略
-
- 用户可以在ServiceComb提供的路由策略框架下根据业务需要,通过编程的方式来开发路由策略。实施步骤如下:
+本章节的内容已过时,新的负载均衡策略说明见[负载均衡](https://docs.servicecomb.io/java-chassis/zh_CN/references-handlers/loadbalance.html)
-* 实现接口`com.netflix.loadbalancer.IRule`中定义的接口方法。
-路由选择逻辑在public Server choose\(Object key\)方法中实现。LoadBalancerStats是一个封装了负载均衡器当前运行状态的一个结构。通过获取stats中各个实例的运行指标,在choose方法中,判定将当前请求路由到哪个实例上进行处理。处理风格可以参照`org.apache.servicecomb.loadbalance.SessionStickinessRule`。
-* 编译开发的策略,保证生成的class在classpath下。
-* 通过SDK配置该路由策略,假如是`AbcRule`。则配置如下: `servicecomb.loadbalance.NFLoadBalancerRuleClassName=org.apache.servicecomb.ribbon.rule.AbcRule`
-
## 限流策略
### 场景描述
diff --git a/_users/service-configurations.md b/_users/service-configurations.md
index be0b271..133a35a 100755
--- a/_users/service-configurations.md
+++ b/_users/service-configurations.md
@@ -11,66 +11,9 @@ redirect_from:
{% include toc %}
## Load Balancing Policy
-### Scenario
-
- ServiceComb provides a Ribbon-based load balancing solution. You can configure a load balancing policy in the configuration file. Currently, a load balancing routing policy can be random, sequential, or based on response time weight.
-
-### Configuration
-
- Load balancing policies are configured by setting the parameter `servicecomb.loadbalance.[MicroServiceName].[property name]` in the microservice.yaml fiel. If MicroServiceName is not set, the configuration is set for all microservices. Otherwise, the configuration is set for a specific microservice.
-
- **Table 1 Configuration items of load balancing policy**
-
-| Configuration Items | Default Value | Value Range | Mandatory | Description | Remarks |
-| :--------------------------------------- | :--------------------------------------- | :--------------------------------------- | :-------- | :--------------------------------------- | :--------------------------------------- |
-| servicecomb.loadbalance.NFLoadBalancerRuleClassName | com.netflix.loadbalancer.RoundRobinRule | com.netflix.loadbalancer.RoundRobinRule(polling)com.netflix.loadbalancer.RandomRule(random)com.netflix.loadbalancer.WeightedResponseTimeRule(server response time weight)org.apache.servicecomb.loadbalance.SessionStickinessRule(session stickiness) | No | Specifiles the load balancing policy | - |
-| servicecomb.loadbalance.SessionStickinessRule.sessionTimeoutInSeconds | 30 | Integer | No | Specifies the idle time of a client. If the idle time exceeds the set value, ServiceComb will select another server. | Currently, this parameter cannot be set for a certain microservice. For example, servicecomb.loadbalance.SessionStickinessRule.sessionTimeoutInSeconds cannot be set to servicecomb.loadbalance.DemoServi [...]
-| servicecomb.loadbalance.SessionStickinessRule.successiveFailedTimes | 5 | Integer | No | Specifies the number of failed requests from the client. If the number exceeds the set value, ServiceComb will switch to another server | Currently, this parameter cannot be set for a certain microservice. |
-| servicecomb.loadbalance.retryEnabled | FALSE | Boolean | No | Specifies whether to call a service again when a exception is captured by the load balance. | - |
-| servicecomb.loadbalance.retryOnNext | 0 | Integer | No | Specifies the number of attempts to connect to another server. | - |
-| servicecomb.loadbalance.retryOnSame | 0 | Integer | No | Specifies the number of attempts to connect to the same server. | - |
-| servicecomb.loadbalance.isolation.enabled | FALSE | Boolean | No | Specifies whether to enable faulty instance isolation. | - |
-| servicecomb.loadbalance.isolation.enableRequestThreshold | 20 | Integer | No | Specifies the threshold number of instance calls. If this value is reached, isolation is enabled. | - |
-| servicecomb.loadbalance.isolation.errorThresholdPercentage | 20 | Integer,\(0,100\] | No | Specifies the error percentage. Instance fault isolation is enabled when the set value is reached. | - |
-| servicecomb.loadbalance.isolation.singleTestTime | 10000 | Integer | No | Specifies the duration of a faulty instance test on a single node. | This unit is ms. |
-| servicecomb.loadbalance.transactionControl.policy | org.apache.servicecomb.loadbalance.filter.SimpleTransactionControlFilter | - | No | Specifies the offload policies for dynamic routing. | The framework provides simple offload mechanisms. You can also customize offload policies. |
-| servicecomb.loadbalance.transactionControl.options | - | key/value pairs | No | Specifies the parameter configured for the SimpleTransactionControlFilter offload policy. You can add any filtration tag for this item. | - |
-
-### Sample Code
-
- in the src/main/resources/microservice.yaml file, configure a load balancing policy.
-
- Configure a processing link:
-
-```yaml
-servicecomb:
- # other configurations omitted
- handler:
- chain:
- Consumer:
- default: loadbalance
- # other configurations omitted
-```
-
- Add a routing policy:
-
-```yaml
-servicecomb:
- # other configurations omitted
- loadbalance:
- NFLoadBalancerRuleClassName: com.netflix.loadbalancer.RoundRobinRule
- # other configurations omitted
-```
-
-## Customizing Routing Policies
-
- Based on the routing policy framework provided by ServiceComb, you can program to customize routing policies as required. Perform the following steps:
-
-* Encode using the API method defined in the `com.netflix.loadbalancer.IRule` API. Encode in the public Server choose(Object key) method. LoadBalancerStats is a structure that encapsulates the running state of the load balancer. Determine on which instance the current routing request will be processed based on the running indexes of each instance by using the Server choose(Object key) method. Use method `org.apache.servicecomb.loadbalance.SessionStickinessRule`for instance processing.
+The content of this page has been outdated, please refer to [Load Balancing](https://docs.servicecomb.io/java-chassis/en_US/references-handlers/loadbalance.html)
-* Compile the developed policy and ensure that the generated class is under classpath.
-* Use the software development kit(SDK) to configure the routing policy. Use AbcRule as a routing policy example. The configuration is as follows: `servicecomb.loadbalance.NFLoadBalancerRuleClassName=org.apache.servicecomb.ribbon.rule.AbcRule`
## Rate Limiting Policy
### Scenario