requirements.asciidoc 3.8 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. [[ccr-overview-soft-deletes]]
  22. ==== Soft delete settings
  23. `index.soft_deletes.enabled`::
  24. Whether or not soft deletes are enabled on the index. Soft deletes can only be
  25. configured at index creation and only on indices created on or after 6.5.0. The
  26. default value is `true`.
  27. `index.soft_deletes.retention_lease.period`::
  28. The maximum period to retain a shard history retention lease before it is considered
  29. expired. Shard history retention leases ensure that soft deletes are retained during
  30. merges on the Lucene index. If a soft delete is merged away before it can be replicated
  31. to a follower the following process will fail due to incomplete history on the leader.
  32. The default value is `12h`.
  33. For more information about index settings, see {ref}/index-modules.html[Index modules].
  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. [[ccr-overview-logstash]]
  51. ==== Setting soft deletes on indices created by Logstash
  52. If you want to replicate indices created by Logstash, and are using Logstash to
  53. manage index templates, you need to configure soft deletes on a custom Logstash
  54. index template. To configure soft deletes on the underlying index template,
  55. incorporate the following change to a custom Logstash template.
  56. ["source","js"]
  57. ----------------------------------------------------------------------
  58. {
  59. "settings" : {
  60. "index.soft_deletes.retention.operations" : 1024
  61. }
  62. }
  63. ----------------------------------------------------------------------
  64. // NOTCONSOLE
  65. Additionally, you will need to configure the Elasticsearch output plugin to use
  66. this custom template.
  67. ["source","ruby"]
  68. ----------------------------------------------------------------------
  69. output {
  70. elasticsearch {
  71. template => "/path/to/custom/logstash/template.json"
  72. }
  73. }
  74. ----------------------------------------------------------------------
  75. For additional information on controlling the index templates managed by
  76. Logstash, see the relevant documentation on the Elasticsearch output plugin.