Commit a315ea42 authored by zhangyaofu's avatar zhangyaofu

update consul naming service en doc

parent 09326748
......@@ -98,22 +98,15 @@ Connect all servers under the domain, for example: http://www.baidu.com:80. Note
### consul://\<service-name\>
Get a list of services with the specified service-name through consul. The default address for consul is localhost:8500, which can be modified by setting -consul\_agent\_addr in gflags. The connection timeout time of consul is 200ms by default, which can be modified by -consul\_connect\_timeout\_ms.
Get a list of servers with the specified service-name through consul. The default address of consul is localhost:8500, which can be modified by setting -consul\_agent\_addr in gflags. The connection timeout of consul is 200ms by default, which can be modified by -consul\_connect\_timeout\_ms.
By default, [stale](https://www.consul.io/api/index.html#consistency-modes) and passing(only the service list with the return status of passing is returned) are added to the consul request parameter. The [consul request parameter]((https://www.consul.io/api/health.html#parameters-2)) can be modified by -consul\_url\_parameter in gflags.
By default, [stale](https://www.consul.io/api/index.html#consistency-modes) and passing(only servers with passing in statuses are returned) are added to [parameters of the consul request]((https://www.consul.io/api/health.html#parameters-2)), which can be modified by -consul\_url\_parameter in gflags.
Except the first request to consul, the follow-up requests use the [long polling](https://www.consul.io/api/index.html#blocking-queries) feature. That is, the consul responds only when the server list is updated or the request times out. The timeout defaults to 60 seconds, which can be modified by -consul\_blocking\_query\_wait\_secs.
In addition to the first request to the consul, the follow-up requests to the consul using the [long polling](https://www.consul.io/api/index.html#blocking-queries) feature. That is, the consul returns the result only when the service list is updated or the request time out. The timeout threshold defaults to 60 seconds, which can be modified by -consul\_blocking\_query\_wait\_secs.
If the service list returned by the consul has an incorrect [response format](https://www.consul.io/api/health.html#sample-response-2), or all services in the list are filtered because the key fields such as the address and port are missing or cannot be parsed, the consul naming server will refuse to update the service list and revisit the consul after a period of time(
default 500ms, can be modified by -consul\_retry\_interval\_ms).
If consul is not accessible, the service can be automatically downgraded to the file naming service for getting service list. This feature is turned off by default and can be turned on by setting -consul\_enable\_degrade\_to\_file\_naming\_service.
The service list file directory is set with -consul \_file\_naming\_service\_dir. Using service-name as the file name. This file can be generated by the consul-template, which holds the latest downstream service node before the consul is unavailable. The consul naming service is automatically restored when consul is restored.
If the server list returned by the consul does not follow [response format](https://www.consul.io/api/health.html#sample-response-2), or all servers in the list are filtered because the key fields such as the address and port are missing or cannot be parsed, the server list will not be updated and the consul service will be revisited after a period of time(default 500ms, can be modified by -consul\_retry\_interval\_ms).
If consul is not accessible, the naming service can be automatically downgraded to file naming service. This feature is turned off by default and can be turned on by setting -consul\_enable\_degrade\_to\_file\_naming\_service. After downgrading, in the directory specified by -consul\_file\_naming\_service\_dir, the file whose name is the service-name will be used. This file can be generated by the consul-template, which holds the latest server list before the consul is unavailable. The consul naming service is automatically restored when consul is restored.
### Naming Service Filter
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment