managing.asciidoc 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ccr-managing]]
  4. === Manage {ccr}
  5. Use the following information to manage {ccr} tasks, such as inspecting
  6. replication progress, pausing and resuming replication, recreating a follower
  7. index, and terminating replication.
  8. [[ccr-access-ccr]]
  9. To start using {ccr}, access {kib} and go to
  10. *Management > Stack Management*. In the side navigation, select
  11. *Cross-Cluster Replication*.
  12. [[ccr-inspect-progress]]
  13. ==== Inspect replication statistics
  14. To inspect the progress of replication for a follower index and view
  15. detailed shard statistics, <<ccr-access-ccr,access Cross-Cluster Replication>> and choose the *Follower indices* tab.
  16. Select the name of the follower index you want to view replication details
  17. for. The slide-out panel shows settings and replication statistics for the
  18. follower index, including read and write operations that are managed by the
  19. follower shard.
  20. To view more detailed statistics, click *View in Index Management*, and
  21. then select the name of the follower index in Index Management.
  22. Open the tabs for detailed statistics about the follower index.
  23. [%collapsible]
  24. .API example
  25. ====
  26. Use the <<ccr-get-follow-stats,get follower stats API>> to inspect replication
  27. progress at the shard level. This API provides insight into the read and writes
  28. managed by the follower shard. The API also reports read exceptions that can be
  29. retried and fatal exceptions that require user intervention.
  30. ====
  31. [[ccr-pause-replication]]
  32. ==== Pause and resume replication
  33. To pause and resume replication of the leader index, <<ccr-access-ccr,access Cross-Cluster Replication>> and choose the *Follower indices* tab.
  34. Select the follower index you want to pause and choose *Manage > Pause Replication*. The follower index status changes to Paused.
  35. To resume replication, select the follower index and choose
  36. *Resume replication*.
  37. [%collapsible]
  38. .API example
  39. ====
  40. You can pause replication with the
  41. <<ccr-post-pause-follow,pause follower API>> and then later resume
  42. replication with the <<ccr-post-resume-follow,resume follower API>>.
  43. Using these APIs in tandem enables you to adjust the read and write parameters
  44. on the follower shard task if your initial configuration is not suitable for
  45. your use case.
  46. ====
  47. [[ccr-recreate-follower-index]]
  48. ==== Recreate a follower index
  49. When a document is updated or deleted, the underlying operation is retained in
  50. the Lucene index for a period of time defined by the
  51. <<ccr-index-soft-deletes-retention-period,`index.soft_deletes.retention_lease.period`>> parameter. You configure
  52. this setting on the <<ccr-leader-requirements,leader index>>.
  53. When a follower index starts, it acquires a retention lease from
  54. the leader index. This lease informs the leader that it should not allow a soft
  55. delete to be pruned until either the follower indicates that it has received
  56. the operation, or until the lease expires.
  57. If a follower index falls sufficiently behind a leader and cannot
  58. replicate operations, {es} reports an `indices[].fatal_exception` error. To
  59. resolve the issue, recreate the follower index. When the new follow index
  60. starts, the <<ccr-remote-recovery, remote recovery>> process recopies the
  61. Lucene segment files from the leader.
  62. IMPORTANT: Recreating the follower index is a destructive action. All existing
  63. Lucene segment files are deleted on the cluster containing the follower index.
  64. To recreate a follower index,
  65. <<ccr-access-ccr,access Cross-Cluster Replication>> and choose the
  66. *Follower indices* tab.
  67. [role="screenshot"]
  68. image::images/ccr-follower-index.png["The Cross-Cluster Replication page in {kib}"]
  69. Select the follower index and pause replication. When the follower index status
  70. changes to Paused, reselect the follower index and choose to unfollow the
  71. leader index.
  72. The follower index will be converted to a standard index and will no longer
  73. display on the Cross-Cluster Replication page.
  74. In the side navigation, choose *Index Management*. Select the follower index
  75. from the previous steps and close the follower index.
  76. You can then <<ccr-getting-started-follower-index,recreate the follower index>>
  77. to restart the replication process.
  78. [%collapsible]
  79. .Use the API
  80. ====
  81. Use the <<ccr-post-pause-follow,pause follow API>> to pause the replication
  82. process. Then, close the follower index and recreate it. For example:
  83. [source,console]
  84. ----------------------------------------------------------------------
  85. POST /follower_index/_ccr/pause_follow
  86. POST /follower_index/_close
  87. PUT /follower_index/_ccr/follow?wait_for_active_shards=1
  88. {
  89. "remote_cluster" : "remote_cluster",
  90. "leader_index" : "leader_index"
  91. }
  92. ----------------------------------------------------------------------
  93. // TEST[setup:remote_cluster_and_leader_index_and_follower_index teardown:pause_follow]
  94. ====
  95. [[ccr-terminate-replication]]
  96. ==== Terminate replication
  97. You can unfollow a leader index to terminate replication and convert the
  98. follower index to a standard index.
  99. <<ccr-access-ccr,Access Cross-Cluster Replication>> and choose the
  100. *Follower indices* tab.
  101. Select the follower index and pause replication. When the follower index status
  102. changes to Paused, reselect the follower index and choose to unfollow the
  103. leader index.
  104. The follower index will be converted to a standard index and will no longer
  105. display on the Cross-Cluster Replication page.
  106. You can then choose *Index Management*, select the follower index
  107. from the previous steps, and close the follower index.
  108. [%collapsible]
  109. .Use the API
  110. ====
  111. You can terminate replication with the
  112. <<ccr-post-unfollow,unfollow API>>. This API converts a follower index
  113. to a standard (non-follower) index.
  114. ====