requirements.asciidoc 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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.operations`::
  29. The number of soft deletes to retain. Soft deletes are collected during merges
  30. on the underlying Lucene index yet retained up to the number of operations
  31. configured by this setting. The default value is `0`.
  32. For more information about index settings, see {ref}/index-modules.html[Index modules].
  33. [float]
  34. [[ccr-overview-beats]]
  35. ==== Setting soft deletes on indices created by APM Server or Beats
  36. If you want to replicate indices created by APM Server or Beats, and are
  37. allowing APM Server or Beats to manage index templates, you need to configure
  38. soft deletes on the underlying index templates. To configure soft deletes on the
  39. underlying index templates, incorporate the following changes to the relevant
  40. APM Server or Beats configuration file.
  41. ["source","yaml"]
  42. ----------------------------------------------------------------------
  43. setup.template.overwrite: true
  44. setup.template.settings:
  45. index.soft_deletes.retention.operations: 1024
  46. ----------------------------------------------------------------------
  47. For additional information on controlling the index templates managed by APM
  48. Server or Beats, see the relevant documentation on loading the Elasticsearch
  49. index template.
  50. [float]
  51. [[ccr-overview-logstash]]
  52. ==== Setting soft deletes on indices created by Logstash
  53. If you want to replicate indices created by Logstash, and are using Logstash to
  54. manage index templates, you need to configure soft deletes on a custom Logstash
  55. index template. To configure soft deletes on the underlying index template,
  56. incorporate the following change to a custom Logstash template.
  57. ["source","js"]
  58. ----------------------------------------------------------------------
  59. {
  60. "settings" : {
  61. "index.soft_deletes.retention.operations" : 1024
  62. }
  63. }
  64. ----------------------------------------------------------------------
  65. // NOTCONSOLE
  66. Additionally, you will need to configure the Elasticsearch output plugin to use
  67. this custom template.
  68. ["source","ruby"]
  69. ----------------------------------------------------------------------
  70. output {
  71. elasticsearch {
  72. template => "/path/to/custom/logstash/template.json"
  73. }
  74. }
  75. ----------------------------------------------------------------------
  76. For additional information on controlling the index templates managed by
  77. Logstash, see the relevant documentation on the Elasticsearch output plugin.