mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 23:27:25 -04:00
Use CcrRepository
to init follower index (#35719)
This commit modifies the put follow index action to use a CcrRepository when creating a follower index. It routes the logic through the snapshot/restore process. A wait_for_active_shards parameter can be used to configure how long to wait before returning the response.
This commit is contained in:
parent
d05a4b9d14
commit
00ace369af
31 changed files with 488 additions and 169 deletions
|
@ -22,7 +22,7 @@ replication options and whether the follower indices are active or paused.
|
|||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
PUT /follower_index/_ccr/follow
|
||||
PUT /follower_index/_ccr/follow?wait_for_active_shards=1
|
||||
{
|
||||
"remote_cluster" : "remote_cluster",
|
||||
"leader_index" : "leader_index"
|
||||
|
|
|
@ -21,7 +21,7 @@ following tasks associated with each shard for the specified indices.
|
|||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
PUT /follower_index/_ccr/follow
|
||||
PUT /follower_index/_ccr/follow?wait_for_active_shards=1
|
||||
{
|
||||
"remote_cluster" : "remote_cluster",
|
||||
"leader_index" : "leader_index"
|
||||
|
|
|
@ -24,7 +24,7 @@ following task.
|
|||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
PUT /follower_index/_ccr/follow
|
||||
PUT /follower_index/_ccr/follow?wait_for_active_shards=1
|
||||
{
|
||||
"remote_cluster" : "remote_cluster",
|
||||
"leader_index" : "leader_index"
|
||||
|
|
|
@ -23,7 +23,7 @@ returns, the follower index will resume fetching operations from the leader inde
|
|||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
PUT /follower_index/_ccr/follow
|
||||
PUT /follower_index/_ccr/follow?wait_for_active_shards=1
|
||||
{
|
||||
"remote_cluster" : "remote_cluster",
|
||||
"leader_index" : "leader_index"
|
||||
|
|
|
@ -27,7 +27,7 @@ irreversible operation.
|
|||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
PUT /follower_index/_ccr/follow
|
||||
PUT /follower_index/_ccr/follow?wait_for_active_shards=1
|
||||
{
|
||||
"remote_cluster" : "remote_cluster",
|
||||
"leader_index" : "leader_index"
|
||||
|
|
|
@ -31,7 +31,7 @@ POST /follower_index/_ccr/pause_follow
|
|||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
PUT /<follower_index>/_ccr/follow
|
||||
PUT /<follower_index>/_ccr/follow?wait_for_active_shards=1
|
||||
{
|
||||
"remote_cluster" : "<remote_cluster>",
|
||||
"leader_index" : "<leader_index>"
|
||||
|
@ -43,6 +43,11 @@ PUT /<follower_index>/_ccr/follow
|
|||
// TEST[s/<remote_cluster>/remote_cluster/]
|
||||
// TEST[s/<leader_index>/leader_index/]
|
||||
|
||||
The `wait_for_active_shards` parameter specifies the number of shards to wait on being active
|
||||
before responding. This defaults to waiting on none of the shards to be active. A shard must
|
||||
be restored from the leader index being active. Restoring a follower shard requires transferring
|
||||
all the remote Lucene segment files to the follower index.
|
||||
|
||||
==== Path Parameters
|
||||
|
||||
`follower_index` (required)::
|
||||
|
@ -73,7 +78,7 @@ This example creates a follower index named `follower_index`:
|
|||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
PUT /follower_index/_ccr/follow
|
||||
PUT /follower_index/_ccr/follow?wait_for_active_shards=1
|
||||
{
|
||||
"remote_cluster" : "remote_cluster",
|
||||
"leader_index" : "leader_index",
|
||||
|
|
|
@ -22,7 +22,7 @@ shard-level stats as in the <<ccr-get-follow-stats,get follower stats API>>.
|
|||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
PUT /follower_index/_ccr/follow
|
||||
PUT /follower_index/_ccr/follow?wait_for_active_shards=1
|
||||
{
|
||||
"remote_cluster" : "remote_cluster",
|
||||
"leader_index" : "leader_index"
|
||||
|
|
|
@ -230,7 +230,7 @@ cluster.
|
|||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
PUT /server-metrics-copy/_ccr/follow
|
||||
PUT /server-metrics-copy/_ccr/follow?wait_for_active_shards=1
|
||||
{
|
||||
"remote_cluster" : "leader",
|
||||
"leader_index" : "server-metrics"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue