You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/01/09 03:46:23 UTC

[GitHub] [incubator-apisix] juzhiyuan commented on a change in pull request #1022: Feature/chash key support more flexible ways

juzhiyuan commented on a change in pull request #1022: Feature/chash key support more flexible ways
URL: https://github.com/apache/incubator-apisix/pull/1022#discussion_r364548318
 
 

 ##########
 File path: doc/architecture-design-cn.md
 ##########
 @@ -237,8 +237,8 @@ APISIX 的 Upstream 除了基本的复杂均衡算法选择外,还支持对上
 |-------         |-----|------|
 |type            |必需|`roundrobin` 支持权重的负载,`chash` 一致性哈希,两者是二选一的|
 |nodes           |必需|哈希表,内部元素的 key 是上游机器地址列表,格式为`地址 + Port`,其中地址部分可以是 IP 也可以是域名,比如 `192.168.1.100:80`、`foo.com:80`等。value 则是节点的权重,特别的,当权重值为 `0` 有特殊含义,通常代表该上游节点失效,永远不希望被选中。|
-|hash_on         |可选|该选项只有类型是 `chash` 才有效。支持的类型有`vars`(Nginx内置变量),`header`(自定义header),`cookie`,`consumer`,默认值为`vars`|
-|key             |必需|该选项只有类型是 `chash` 才有效,需要配合`hash_on`来使用,通过`hash_on`和`key`来查找对应的 node `id`。`hash_on`设为`vars`时,`key`为必传参数,目前支持的 Nginx 内置变量有 `uri, server_name, server_addr, request_uri, remote_port, remote_addr, query_string, host, hostname, arg_***`,其中 `arg_***` 是来自URL的请求参数,[Nginx 变量列表](http://nginx.org/en/docs/varindex.html);`hash_on`设为`header`时, `key`为必传参数, 自定义的`header name`;`hash_on`设为`cookie`时, `key`为必传参数, 自定义的`cookie name`;`hash_on`设为`consumer`时,`key`不需要设置,为空,此时哈希算法采用的`key`为认证通过的`consumer_id`|
+|hash_on         |可选|该选项只有`type`是 `chash` 才有效。`hash_on`支持的类型有`vars`(Nginx内置变量),`header`(自定义header),`cookie`,`consumer`,默认值为`vars`|
 
 Review comment:
   只有**SPACE**`type`**SPACE**是

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services