requirements.asciidoc 3.7 KB

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