| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 | [role="xpack"][testenv="platinum"]//////////////////////////[source,console]--------------------------------------------------PUT /follower_index/_ccr/follow?wait_for_active_shards=1{  "remote_cluster" : "remote_cluster",  "leader_index" : "leader_index"}--------------------------------------------------// TESTSETUP// TEST[setup:remote_cluster_and_leader_index][source,console]--------------------------------------------------POST /follower_index/_ccr/pause_follow--------------------------------------------------// TEARDOWN//////////////////////////[[ccr-managing]]=== Manage {ccr}Use the following information to manage {ccr} tasks, such as inspectingreplication progress, pausing and resuming replication, recreating a followerindex, and terminating replication.[[ccr-access-ccr]]To start using {ccr}, access {kib} and go to*Management > Stack Management*. In the side navigation, select*Cross-Cluster Replication*.[[ccr-inspect-progress]]==== Inspect replication statisticsTo inspect the progress of replication for a follower index and viewdetailed shard statistics, <<ccr-access-ccr,access Cross-Cluster Replication>> and choose the *Follower indices* tab.Select the name of the follower index you want to view replication detailsfor. The slide-out panel shows settings and replication statistics for thefollower index, including read and write operations that are managed by thefollower shard.To view more detailed statistics, click *View in Index Management*, andthen select the name of the follower index in Index Management.Open the tabs for detailed statistics about the follower index.[%collapsible].API example====Use the <<ccr-get-follow-stats,get follower stats API>> to inspect replicationprogress at the shard level. This API provides insight into the read and writesmanaged by the follower shard. The API also reports read exceptions that can beretried and fatal exceptions that require user intervention.====[[ccr-pause-replication]]==== Pause and resume replicationTo pause and resume replication of the leader index, <<ccr-access-ccr,access Cross-Cluster Replication>> and choose the *Follower indices* tab.Select the follower index you want to pause and choose *Manage > Pause Replication*. The follower index status changes to Paused.To resume replication, select the follower index and choose*Resume replication*.[%collapsible].API example====You can pause replication with the<<ccr-post-pause-follow,pause follower API>> and then later resumereplication with the <<ccr-post-resume-follow,resume follower API>>.Using these APIs in tandem enables you to adjust the read and write parameterson the follower shard task if your initial configuration is not suitable foryour use case.====[[ccr-recreate-follower-index]]==== Recreate a follower indexWhen a document is updated or deleted, the underlying operation is retained inthe Lucene index for a period of time defined by the<<ccr-index-soft-deletes-retention-period,`index.soft_deletes.retention_lease.period`>> parameter. You configurethis setting on the <<ccr-leader-requirements,leader index>>.When a follower index starts, it acquires a retention lease fromthe leader index. This lease informs the leader that it should not allow a softdelete to be pruned until either the follower indicates that it has receivedthe operation, or until the lease expires.If a follower index falls sufficiently behind a leader and cannotreplicate operations, {es} reports an `indices[].fatal_exception` error. Toresolve the issue, recreate the follower index. When the new follow indexstarts, the <<ccr-remote-recovery, remote recovery>> process recopies theLucene segment files from the leader.IMPORTANT: Recreating the follower index is a destructive action. All existingLucene segment files are deleted on the cluster containing the follower index.To recreate a follower index,<<ccr-access-ccr,access Cross-Cluster Replication>> and choose the*Follower indices* tab.[role="screenshot"]image::images/ccr-follower-index.png["The Cross-Cluster Replication page in {kib}"]Select the follower index and pause replication. When the follower index statuschanges to Paused, reselect the follower index and choose to unfollow theleader index.The follower index will be converted to a standard index and will no longerdisplay on the Cross-Cluster Replication page.In the side navigation, choose *Index Management*. Select the follower indexfrom the previous steps and close the follower index.You can then <<ccr-getting-started-follower-index,recreate the follower index>>to restart the replication process.[%collapsible].Use the API====Use the <<ccr-post-pause-follow,pause follow API>> to pause the replicationprocess. Then, close the follower index and recreate it. For example:[source,console]----------------------------------------------------------------------POST /follower_index/_ccr/pause_followPOST /follower_index/_closePUT /follower_index/_ccr/follow?wait_for_active_shards=1{  "remote_cluster" : "remote_cluster",  "leader_index" : "leader_index"}----------------------------------------------------------------------====[[ccr-terminate-replication]]==== Terminate replicationYou can unfollow a leader index to terminate replication and convert thefollower index to a standard index.<<ccr-access-ccr,Access Cross-Cluster Replication>> and choose the*Follower indices* tab.Select the follower index and pause replication. When the follower index statuschanges to Paused, reselect the follower index and choose to unfollow theleader index.The follower index will be converted to a standard index and will no longerdisplay on the Cross-Cluster Replication page.You can then choose *Index Management*, select the follower indexfrom the previous steps, and close the follower index.[%collapsible].Use the API====You can terminate replication with the<<ccr-post-unfollow,unfollow API>>. This API converts a follower indexto a standard (non-follower) index.====
 |