put-follow.asciidoc 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ccr-put-follow]]
  4. === Create Follower API
  5. ++++
  6. <titleabbrev>Create Follower</titleabbrev>
  7. ++++
  8. beta[]
  9. Creates a follower index.
  10. ==== Description
  11. This API creates a new follower index that is configured to follow the
  12. referenced leader index. When this API returns, the follower index exists, and
  13. {ccr} starts replicating operations from the leader index to the follower index.
  14. ==== Request
  15. //////////////////////////
  16. [source,js]
  17. --------------------------------------------------
  18. POST /follower_index/_ccr/pause_follow
  19. --------------------------------------------------
  20. // CONSOLE
  21. // TEARDOWN
  22. //////////////////////////
  23. [source,js]
  24. --------------------------------------------------
  25. PUT /<follower_index>/_ccr/follow
  26. {
  27. "remote_cluster" : "<remote_cluster>",
  28. "leader_index" : "<leader_index>"
  29. }
  30. --------------------------------------------------
  31. // CONSOLE
  32. // TEST[setup:remote_cluster_and_leader_index]
  33. // TEST[s/<follower_index>/follower_index/]
  34. // TEST[s/<remote_cluster>/remote_cluster/]
  35. // TEST[s/<leader_index>/leader_index/]
  36. ==== Path Parameters
  37. `follower_index` (required)::
  38. (string) the name of the follower index
  39. ==== Request Body
  40. `remote_cluster` (required)::
  41. (string) the <<modules-remote-clusters,remote cluster>> containing the leader
  42. index
  43. `leader_index` (required)::
  44. (string) the name of the index in the leader cluster to follow
  45. include::../follow-request-body.asciidoc[]
  46. ==== Authorization
  47. If the {es} {security-features} are enabled, you must have `write`, `monitor`,
  48. and `manage_follow_index` index privileges for the follower index. You must have
  49. `read` and `monitor` index privileges for the leader index. You must also have
  50. `manage_ccr` cluster privileges on the cluster that contains the follower index.
  51. For more information, see
  52. {stack-ov}/security-privileges.html[Security privileges].
  53. ==== Example
  54. This example creates a follower index named `follower_index`:
  55. [source,js]
  56. --------------------------------------------------
  57. PUT /follower_index/_ccr/follow
  58. {
  59. "remote_cluster" : "remote_cluster",
  60. "leader_index" : "leader_index",
  61. "max_read_request_operation_count" : 1024,
  62. "max_outstanding_read_requests" : 16,
  63. "max_read_request_size" : "1024k",
  64. "max_write_request_operation_count" : 32768,
  65. "max_write_request_size" : "16k",
  66. "max_outstanding_write_requests" : 8,
  67. "max_write_buffer_count" : 512,
  68. "max_write_buffer_size" : "512k",
  69. "max_retry_delay" : "10s",
  70. "read_poll_timeout" : "30s"
  71. }
  72. --------------------------------------------------
  73. // CONSOLE
  74. // TEST[setup:remote_cluster_and_leader_index]
  75. The API returns the following result:
  76. [source,js]
  77. --------------------------------------------------
  78. {
  79. "follow_index_created" : true,
  80. "follow_index_shards_acked" : true,
  81. "index_following_started" : true
  82. }
  83. --------------------------------------------------
  84. // TESTRESPONSE