get-follow-info.asciidoc 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. [role="xpack"]
  2. [[ccr-get-follow-info]]
  3. === Get follower info API
  4. ++++
  5. <titleabbrev>Get follower info</titleabbrev>
  6. ++++
  7. Retrieves information about all follower indices.
  8. [[ccr-get-follow-info-request]]
  9. ==== {api-request-title}
  10. //////////////////////////
  11. [source,console]
  12. --------------------------------------------------
  13. PUT /follower_index/_ccr/follow?wait_for_active_shards=1
  14. {
  15. "remote_cluster" : "remote_cluster",
  16. "leader_index" : "leader_index"
  17. }
  18. --------------------------------------------------
  19. // TESTSETUP
  20. // TEST[setup:remote_cluster_and_leader_index]
  21. //////////////////////////
  22. [source,console]
  23. --------------------------------------------------
  24. GET /<index>/_ccr/info
  25. --------------------------------------------------
  26. // TEST[s/<index>/follower_index/]
  27. [[ccr-get-follow-info-prereqs]]
  28. ==== {api-prereq-title}
  29. * If the {es} {security-features} are enabled, you must have `monitor` cluster
  30. privileges. For more information, see <<security-privileges>>.
  31. [[ccr-get-follow-info-desc]]
  32. ==== {api-description-title}
  33. This API lists the parameters and the status for each follower index.
  34. For example, the results include follower index names, leader index names,
  35. replication options and whether the follower indices are active or paused.
  36. [[ccr-get-follow-info-path-parms]]
  37. ==== {api-path-parms-title}
  38. `<index>`::
  39. (Required, string) A comma-delimited list of follower index patterns.
  40. [[ccr-get-follow-info-query-params]]
  41. ==== {api-query-parms-title}
  42. `master_timeout`::
  43. (Optional, <<time-units, time units>>) Specifies the period of time to wait for
  44. a connection to the master node. If no response is received before the timeout
  45. expires, the request fails and returns an error. Defaults to `30s`.
  46. [role="child_attributes"]
  47. [[ccr-get-follow-info-response-body]]
  48. ==== {api-response-body-title}
  49. //Begin follower_indices
  50. `follower_indices`::
  51. (array) An array of follower index statistics.
  52. +
  53. .Properties of objects in `follower_indices`
  54. [%collapsible%open]
  55. ====
  56. `follower_index`::
  57. (string) The name of the follower index.
  58. `leader_index`::
  59. (string) The name of the index in the leader cluster that is followed.
  60. //Begin parameters
  61. `parameters`::
  62. (object) An object that encapsulates {ccr} parameters. If the follower index's `status` is `paused`,
  63. this object is omitted.
  64. +
  65. .Properties of `parameters`
  66. [%collapsible%open]
  67. =====
  68. `max_outstanding_read_requests`::
  69. (long) The maximum number of outstanding read requests from the remote cluster.
  70. `max_outstanding_write_requests`::
  71. (integer) The maximum number of outstanding write requests on the follower.
  72. `max_read_request_operation_count`::
  73. (integer) The maximum number of operations to pull per read from the remote
  74. cluster.
  75. `max_read_request_size`::
  76. (<<byte-units,byte value>>) The maximum size in bytes of per read of a batch of
  77. operations pulled from the remote cluster.
  78. `max_retry_delay`::
  79. (<<time-units,time value>>) The maximum time to wait before retrying an
  80. operation that failed exceptionally. An exponential backoff strategy is employed
  81. when retrying.
  82. `max_write_buffer_count`::
  83. (integer) The maximum number of operations that can be queued for writing. When
  84. this limit is reached, reads from the remote cluster are deferred until the
  85. number of queued operations goes below the limit.
  86. `max_write_buffer_size`::
  87. (<<byte-units,byte value>>) The maximum total bytes of operations that can be
  88. queued for writing. When this limit is reached, reads from the remote cluster
  89. are deferred until the total bytes of queued operations goes below the limit.
  90. `max_write_request_operation_count`::
  91. (integer) The maximum number of operations per bulk write request executed on
  92. the follower.
  93. `max_write_request_size`::
  94. (<<byte-units,byte value>>) The maximum total bytes of operations per bulk write
  95. request executed on the follower.
  96. `read_poll_timeout`::
  97. (<<time-units,time value>>) The maximum time to wait for new operations on the
  98. remote cluster when the follower index is synchronized with the leader index.
  99. When the timeout has elapsed, the poll for operations returns to the follower so
  100. that it can update some statistics, then the follower immediately attempts
  101. to read from the leader again.
  102. =====
  103. //End parameters
  104. `remote_cluster`::
  105. (string) The <<remote-clusters,remote cluster>> that contains the
  106. leader index.
  107. `status`::
  108. (string) Whether index following is `active` or `paused`.
  109. ====
  110. //End follower_indices
  111. [[ccr-get-follow-info-examples]]
  112. ==== {api-examples-title}
  113. This example retrieves follower info:
  114. [source,console]
  115. --------------------------------------------------
  116. GET /follower_index/_ccr/info
  117. --------------------------------------------------
  118. If the follower index is `active`, the API returns the following results:
  119. [source,console-result]
  120. --------------------------------------------------
  121. {
  122. "follower_indices": [
  123. {
  124. "follower_index": "follower_index",
  125. "remote_cluster": "remote_cluster",
  126. "leader_index": "leader_index",
  127. "status": "active",
  128. "parameters": {
  129. "max_read_request_operation_count": 5120,
  130. "max_read_request_size": "32mb",
  131. "max_outstanding_read_requests": 12,
  132. "max_write_request_operation_count": 5120,
  133. "max_write_request_size": "9223372036854775807b",
  134. "max_outstanding_write_requests": 9,
  135. "max_write_buffer_count": 2147483647,
  136. "max_write_buffer_size": "512mb",
  137. "max_retry_delay": "500ms",
  138. "read_poll_timeout": "1m"
  139. }
  140. }
  141. ]
  142. }
  143. --------------------------------------------------
  144. ////
  145. [source,console]
  146. --------------------------------------------------
  147. POST /follower_index/_ccr/pause_follow
  148. --------------------------------------------------
  149. // TEST[continued]
  150. [source,console]
  151. --------------------------------------------------
  152. GET /follower_index/_ccr/info
  153. --------------------------------------------------
  154. // TEST[continued]
  155. ////
  156. If the follower index is `paused`, the API returns the following results:
  157. [source,console-result]
  158. --------------------------------------------------
  159. {
  160. "follower_indices": [
  161. {
  162. "follower_index": "follower_index",
  163. "remote_cluster": "remote_cluster",
  164. "leader_index": "leader_index",
  165. "status": "paused"
  166. }
  167. ]
  168. }
  169. --------------------------------------------------