managing.asciidoc 5.9 KB

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