Skip to content

Commit 151b1d0

Browse files
committed
Fix the strategies.yaml documentation.
1 parent 128507a commit 151b1d0

File tree

2 files changed

+50
-38
lines changed

2 files changed

+50
-38
lines changed

doc/admin-guide/files/index.en.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Configuration Files
3737
ssl_multicert.config.en
3838
sni.yaml.en
3939
storage.config.en
40+
strategies.yaml.en
4041
volume.config.en
4142

4243
:doc:`cache.config.en`
@@ -80,5 +81,8 @@ Configuration Files
8081
:doc:`storage.config.en`
8182
Configures all storage devices and paths to be used for the |TS| cache.
8283

84+
:doc:`strategies.yaml.en`
85+
Configures NextHop strategies used with `remap.config`
86+
8387
:doc:`volume.config.en`
8488
Defines cache space usage by individual protocols.

doc/admin-guide/files/strategies.yaml.en.rst

Lines changed: 46 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@
1515
specific language governing permissions and limitations
1616
under the License.
1717
18-
.. include:: ../../common.defs
19-
2018
===============
2119
strategies.yaml
2220
===============
2321

2422
.. configfile:: strategies.yaml
2523

24+
.. include:: ../../common.defs
25+
26+
.. toctree::
27+
:maxdepth: 2
28+
2629
The :file:`strategies.yaml` file identifies the next hop proxies used in an
2730
cache hierarchy and the algorithms used to select the next hop proxy. Use
2831
this file to perform the following configuration:
@@ -173,7 +176,8 @@ Each **strategy** in the list may using the following parameters::
173176
#. **consistent_hash**: hosts are selected using a **hash_key**.
174177

175178
- **hash_key**: The hashing key used by the **consistent_hash** policy. If not specified, defaults to **path** which is the
176-
same policy used in the **parent.config** implementation. Use one of::
179+
same policy used in the **parent.config** implementation. Use one of:
180+
177181
#. **hostname**: Creates a hash using the **hostname** in the request URL.
178182
#. **path**: (**default**) Creates a hash over the path poertion of the request URL.
179183
#. **path+query**: Same as **path** but adds the **query string** in the request URL.
@@ -188,44 +192,48 @@ Each **strategy** in the list may using the following parameters::
188192
- **max_simple_retries**: Part of the **failover** map and is an integer value of the maximum number of retries for a **simple retry** on the list of indicated response codes. **simple retry** is used to retry an upstream request using another upstream server if the response received on from the original upstream request matches any of the response codes configured for this strategy in the **failover** map. If no failover response codes are configured, no **simple retry** is attempted.
189193

190194
- **ring_mode**: Part of the **failover** map. The host ring selection mode. Use either **exhaust_ring** or **alternate_ring**
191-
#. **exhaust_ring**: when a host normally selected by the policy fails, another host is selected from the same group. A new group is not selected until all hosts on the previous group have been exhausted.
195+
196+
#. **exhaust_ring**: when a host normally selected by the policy fails, another host is selected from the same group. A new group is not selected until all hosts on the previous group have been exhausted
192197
#. **alternate_ring**: retry hosts are selected from groups in an alternating group fashion.
198+
193199
- **response_codes**: Part of the **failover** map. This is a list of **http** response codes that may be used for **simple retry**.
194200
- **health_check**: Part of the **failover** map. A list of health checks. **passive** is the default and means that the state machine marks down **hosts** when a transaction timeout or connection error is detected. **passive** is always used by the next hop strategies. **active** means that some external process may actively health check the hosts using the defined **health check url** and mark them down using **traffic_ctl**.
195201

196202

197-
Example::
203+
Example:
204+
::
205+
206+
#include unit-tests/hosts.yaml
207+
#
208+
strategies:
209+
- strategy: 'strategy-1'
210+
policy: consistent_hash
211+
hash_key: cache_key
212+
go_direct: false
213+
groups:
214+
- *g1
215+
- *g2
216+
scheme http
217+
failover:
218+
ring_mode: exhaust_ring
219+
response_codes:
220+
- 404
221+
- 503
222+
health_check:
223+
- passive
224+
- strategy: 'strategy-2'
225+
policy: rr_strict
226+
hash_key: cache_key
227+
go_direct: true
228+
groups:
229+
- *g1
230+
- *g2
231+
scheme http
232+
failover:
233+
ring_mode: exhaust_ring
234+
response_codes:
235+
- 404
236+
- 503
237+
health_check:
238+
- passive
198239

199-
#include unit-tests/hosts.yaml
200-
#
201-
strategies:
202-
- strategy: 'strategy-1'
203-
policy: consistent_hash
204-
hash_key: cache_key
205-
go_direct: false
206-
groups:
207-
- *g1
208-
- *g2
209-
scheme http
210-
failover:
211-
ring_mode: exhaust_ring
212-
response_codes:
213-
- 404
214-
- 503
215-
health_check:
216-
- passive
217-
- strategy: 'strategy-2'
218-
policy: rr_strict
219-
hash_key: cache_key
220-
go_direct: true
221-
groups:
222-
- *g1
223-
- *g2
224-
scheme http
225-
failover:
226-
ring_mode: exhaust_ring
227-
response_codes:
228-
- 404
229-
- 503
230-
health_check:
231-
- passive

0 commit comments

Comments
 (0)