elasticsearch/docs/reference/ccr/apis/auto-follow/get-auto-follow-pattern.asciidoc
Tanguy Leroux 8b82e62ec2
Add Pause/Resume Auto Follower APIs (#47510)
This commit adds two APIs that allow to pause and resume 
CCR auto-follower patterns:

// pause auto-follower
POST /_ccr/auto_follow/my_pattern/pause

// resume auto-follower
POST /_ccr/auto_follow/my_pattern/resume

The ability to pause and resume auto-follow patterns can be 
useful in some situations, including the rolling upgrades of 
cluster using a bi-directional cross-cluster replication scheme 
(see #46665).

This committ adds a new active flag to the AutoFollowPattern 
and adapts the AutoCoordinator and AutoFollower classes so 
that it stops to fetch remote's cluster state when all auto-follow 
patterns associate to the remote cluster are paused.

When an auto-follower is paused, remote indices that match the 
pattern are just ignored: they are not added to the pattern's 
followed indices uids list that is maintained in the local cluster 
state. This way, when the auto-follow pattern is resumed the 
indices created in the remote cluster in the meantime will be 
picked up again and added as new following indices. Indices 
created and then deleted in the remote cluster will be ignored 
as they won't be seen at all by the auto-follower pattern at 
resume time.
2019-10-11 12:33:47 +02:00

104 lines
2.8 KiB
Text

[role="xpack"]
[testenv="platinum"]
[[ccr-get-auto-follow-pattern]]
=== Get auto-follow pattern API
++++
<titleabbrev>Get auto-follow pattern</titleabbrev>
++++
Get auto-follow patterns.
[[ccr-get-auto-follow-pattern-request]]
==== {api-request-title}
//////////////////////////
[source,console]
--------------------------------------------------
PUT /_ccr/auto_follow/my_auto_follow_pattern
{
"remote_cluster" : "remote_cluster",
"leader_index_patterns" :
[
"leader_index*"
],
"follow_index_pattern" : "{{leader_index}}-follower"
}
--------------------------------------------------
// TEST[setup:remote_cluster]
// TESTSETUP
[source,console]
--------------------------------------------------
DELETE /_ccr/auto_follow/my_auto_follow_pattern
--------------------------------------------------
// TEST
// TEARDOWN
//////////////////////////
[source,console]
--------------------------------------------------
GET /_ccr/auto_follow/
--------------------------------------------------
[source,console]
--------------------------------------------------
GET /_ccr/auto_follow/<auto_follow_pattern_name>
--------------------------------------------------
// TEST[s/<auto_follow_pattern_name>/my_auto_follow_pattern/]
[[ccr-get-auto-follow-pattern-prereqs]]
==== {api-prereq-title}
* If the {es} {security-features} are enabled, you must have `manage_ccr` cluster
privileges on the cluster that contains the follower index. For more information,
see <<security-privileges>>.
[[ccr-get-auto-follow-pattern-desc]]
==== {api-description-title}
This API gets configured <<ccr-auto-follow,auto-follow patterns>>.
This API will return the specified auto-follow pattern collection.
[[ccr-get-auto-follow-pattern-path-parms]]
==== {api-path-parms-title}
`<auto_follow_pattern_name>`::
(Optional, string) Specifies the auto-follow pattern collection that you want
to retrieve. If you do not specify a name, the API returns information for all
collections.
[[ccr-get-auto-follow-pattern-examples]]
==== {api-examples-title}
This example retrieves information about an auto-follow pattern collection
named `my_auto_follow_pattern`:
[source,console]
--------------------------------------------------
GET /_ccr/auto_follow/my_auto_follow_pattern
--------------------------------------------------
// TEST[setup:remote_cluster]
The API returns the following result:
[source,console-result]
--------------------------------------------------
{
"patterns": [
{
"name": "my_auto_follow_pattern",
"pattern": {
"active": true,
"remote_cluster" : "remote_cluster",
"leader_index_patterns" :
[
"leader_index*"
],
"follow_index_pattern" : "{{leader_index}}-follower"
}
}
]
}
--------------------------------------------------