requirements.asciidoc 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ccr-requirements]]
  4. === Requirements for leader indices
  5. {ccr-cap} works by replaying the history of individual write
  6. operations that were performed on the shards of the leader index. This means that the
  7. history of these operations needs to be retained on the leader shards so that
  8. they can be pulled by the follower shard tasks. The underlying mechanism used to
  9. retain these operations is _soft deletes_. A soft delete occurs whenever an
  10. existing document is deleted or updated. By retaining these soft deletes up to
  11. configurable limits, the history of operations can be retained on the leader
  12. shards and made available to the follower shard tasks as it replays the history
  13. of operations.
  14. Soft deletes must be enabled for indices that you want to use as leader
  15. indices. Soft deletes are enabled by default on new indices created on
  16. or after {es} 7.0.0.
  17. IMPORTANT: This means that {ccr} can not be used on existing indices. If you have
  18. existing data that you want to replicate from another cluster, you must
  19. {ref}/docs-reindex.html[reindex] your data into a new index with soft deletes
  20. enabled.
  21. [float]
  22. [[ccr-overview-soft-deletes]]
  23. ==== Soft delete settings
  24. `index.soft_deletes.enabled`::
  25. Whether or not soft deletes are enabled on the index. Soft deletes can only be
  26. configured at index creation and only on indices created on or after 6.5.0. The
  27. default value is `true`.
  28. `index.soft_deletes.retention_lease.period`::
  29. The maximum period to retain a shard history retention lease before it is considered
  30. expired. Shard history retention leases ensure that soft deletes are retained during
  31. merges on the Lucene index. If a soft delete is merged away before it can be replicated
  32. to a follower the following process will fail due to incomplete history on the leader.
  33. The default value is `12h`.
  34. For more information about index settings, see {ref}/index-modules.html[Index modules].
  35. [float]
  36. [[ccr-overview-beats]]
  37. ==== Setting soft deletes on indices created by APM Server or Beats
  38. If you want to replicate indices created by APM Server or Beats, and are
  39. allowing APM Server or Beats to manage index templates, you need to configure
  40. soft deletes on the underlying index templates. To configure soft deletes on the
  41. underlying index templates, incorporate the following changes to the relevant
  42. APM Server or Beats configuration file.
  43. ["source","yaml"]
  44. ----------------------------------------------------------------------
  45. setup.template.overwrite: true
  46. setup.template.settings:
  47. index.soft_deletes.retention.operations: 1024
  48. ----------------------------------------------------------------------
  49. For additional information on controlling the index templates managed by APM
  50. Server or Beats, see the relevant documentation on loading the Elasticsearch
  51. index template.
  52. [float]
  53. [[ccr-overview-logstash]]
  54. ==== Setting soft deletes on indices created by Logstash
  55. If you want to replicate indices created by Logstash, and are using Logstash to
  56. manage index templates, you need to configure soft deletes on a custom Logstash
  57. index template. To configure soft deletes on the underlying index template,
  58. incorporate the following change to a custom Logstash template.
  59. ["source","js"]
  60. ----------------------------------------------------------------------
  61. {
  62. "settings" : {
  63. "index.soft_deletes.retention.operations" : 1024
  64. }
  65. }
  66. ----------------------------------------------------------------------
  67. // NOTCONSOLE
  68. Additionally, you will need to configure the Elasticsearch output plugin to use
  69. this custom template.
  70. ["source","ruby"]
  71. ----------------------------------------------------------------------
  72. output {
  73. elasticsearch {
  74. template => "/path/to/custom/logstash/template.json"
  75. }
  76. }
  77. ----------------------------------------------------------------------
  78. For additional information on controlling the index templates managed by
  79. Logstash, see the relevant documentation on the Elasticsearch output plugin.