path-settings.asciidoc 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. [[path-settings]]
  2. [discrete]
  3. ==== Path settings
  4. {es} writes the data you index to indices and data streams to a `data`
  5. directory. {es} writes its own application logs, which contain information about
  6. cluster health and operations, to a `logs` directory.
  7. For <<targz,macOS `.tar.gz`>>, <<targz,Linux `.tar.gz`>>, and
  8. <<zip-windows,Windows `.zip`>> installations, `data` and `logs` are
  9. subdirectories of `$ES_HOME` by default. However, files in `$ES_HOME` risk
  10. deletion during an upgrade.
  11. In production, we strongly recommend you set the `path.data` and `path.logs` in
  12. `elasticsearch.yml` to locations outside of `$ES_HOME`. <<docker,Docker>>,
  13. <<deb,Debian>>, and <<rpm,RPM>> installations write
  14. data and log to locations outside of `$ES_HOME` by default.
  15. Supported `path.data` and `path.logs` values vary by platform:
  16. include::{es-repo-dir}/tab-widgets/customize-data-log-path-widget.asciidoc[]
  17. include::{es-repo-dir}/modules/node.asciidoc[tag=modules-node-data-path-warning-tag]
  18. [discrete]
  19. ==== Multiple data paths
  20. deprecated::[7.13.0]
  21. If needed, you can specify multiple paths in `path.data`. {es} stores the node's
  22. data across all provided paths but keeps each shard's data on the same path.
  23. {es} does not balance shards across a node's data paths. High disk
  24. usage in a single path can trigger a <<disk-based-shard-allocation,high disk
  25. usage watermark>> for the entire node. If triggered, {es} will not add shards to
  26. the node, even if the node’s other paths have available disk space. If you need
  27. additional disk space, we recommend you add a new node rather than additional
  28. data paths.
  29. include::{es-repo-dir}/tab-widgets/multi-data-path-widget.asciidoc[]
  30. [discrete]
  31. [[mdp-migrate]]
  32. ==== Migrate from multiple data paths
  33. Support for multiple data paths was deprecated in 7.13 and will be removed
  34. in a future release.
  35. As an alternative to multiple data paths, you can create a filesystem which
  36. spans multiple disks with a hardware virtualisation layer such as RAID, or a
  37. software virtualisation layer such as Logical Volume Manager (LVM) on Linux or
  38. Storage Spaces on Windows. If you wish to use multiple data paths on a single
  39. machine then you must run one node for each data path.
  40. If you currently use multiple data paths in a
  41. {ref}/high-availability-cluster-design.html[highly available cluster] then you
  42. can migrate to a setup that uses a single path for each node without downtime
  43. using a process similar to a
  44. {ref}/restart-cluster.html#restart-cluster-rolling[rolling restart]: shut each
  45. node down in turn and replace it with one or more nodes each configured to use
  46. a single data path. In more detail, for each node that currently has multiple
  47. data paths you should follow the following process. In principle you can
  48. perform this migration during a rolling upgrade to 8.0, but we recommend
  49. migrating to a single-data-path setup before starting to upgrade.
  50. 1. Take a snapshot to protect your data in case of disaster.
  51. 2. Optionally, migrate the data away from the target node by using an
  52. {ref}/modules-cluster.html#cluster-shard-allocation-filtering[allocation filter]:
  53. +
  54. [source,console]
  55. --------------------------------------------------
  56. PUT _cluster/settings
  57. {
  58. "persistent": {
  59. "cluster.routing.allocation.exclude._name": "target-node-name"
  60. }
  61. }
  62. --------------------------------------------------
  63. +
  64. You can use the {ref}/cat-allocation.html[cat allocation API] to track progress
  65. of this data migration. If some shards do not migrate then the
  66. {ref}/cluster-allocation-explain.html[cluster allocation explain API] will help
  67. you to determine why.
  68. 3. Follow the steps in the
  69. {ref}/restart-cluster.html#restart-cluster-rolling[rolling restart process]
  70. up to and including shutting the target node down.
  71. 4. Ensure your cluster health is `yellow` or `green`, so that there is a copy
  72. of every shard assigned to at least one of the other nodes in your cluster.
  73. 5. If applicable, remove the allocation filter applied in the earlier step.
  74. +
  75. [source,console]
  76. --------------------------------------------------
  77. PUT _cluster/settings
  78. {
  79. "persistent": {
  80. "cluster.routing.allocation.exclude._name": null
  81. }
  82. }
  83. --------------------------------------------------
  84. 6. Discard the data held by the stopped node by deleting the contents of its
  85. data paths.
  86. 7. Reconfigure your storage. For instance, combine your disks into a single
  87. filesystem using LVM or Storage Spaces. Ensure that your reconfigured storage
  88. has sufficient space for the data that it will hold.
  89. 8. Reconfigure your node by adjusting the `path.data` setting in its
  90. `elasticsearch.yml` file. If needed, install more nodes each with their own
  91. `path.data` setting pointing at a separate data path.
  92. 9. Start the new nodes and follow the rest of the
  93. {ref}/restart-cluster.html#restart-cluster-rolling[rolling restart process] for
  94. them.
  95. 10. Ensure your cluster health is `green`, so that every shard has been
  96. assigned.
  97. You can alternatively add some number of single-data-path nodes to your
  98. cluster, migrate all your data over to these new nodes using
  99. {ref}/modules-cluster.html#cluster-shard-allocation-filtering[allocation filters],
  100. and then remove the old nodes from the cluster. This approach will temporarily
  101. double the size of your cluster so it will only work if you have the capacity to
  102. expand your cluster like this.
  103. If you currently use multiple data paths but your cluster is not highly
  104. available then you can migrate to a non-deprecated configuration by taking
  105. a snapshot, creating a new cluster with the desired configuration and restoring
  106. the snapshot into it.