managing.asciidoc 5.4 KB

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