gateway.asciidoc 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. [[modules-gateway]]
  2. == Gateway
  3. The gateway module allows one to store the state of the cluster meta
  4. data across full cluster restarts. The cluster meta data mainly holds
  5. all the indices created with their respective (index level) settings and
  6. explicit type mappings.
  7. Each time the cluster meta data changes (for example, when an index is
  8. added or deleted), those changes will be persisted using the gateway.
  9. When the cluster first starts up, the state will be read from the
  10. gateway and applied.
  11. The gateway set on the node level will automatically control the index gateway
  12. that will be used. For example, if the `local` gateway is used (the default),
  13. then each index created on the node will automatically use its own respective
  14. index level `local` gateway.
  15. The default gateway used is the
  16. <<modules-gateway-local,local>> gateway.
  17. The `none` gateway option was removed in Elasticsearch 2.0.
  18. [float]
  19. [[recover-after]]
  20. === Recovery After Nodes / Time
  21. In many cases, the actual cluster meta data should only be recovered
  22. after specific nodes have started in the cluster, or a timeout has
  23. passed. This is handy when restarting the cluster, and each node local
  24. index storage still exists to be reused and not recovered from the
  25. gateway (which reduces the time it takes to recover from the gateway).
  26. The `gateway.recover_after_nodes` setting (which accepts a number)
  27. controls after how many data and master eligible nodes within the
  28. cluster recovery will start. The `gateway.recover_after_data_nodes` and
  29. `gateway.recover_after_master_nodes` setting work in a similar fashion,
  30. except they consider only the number of data nodes and only the number
  31. of master nodes respectively. The `gateway.recover_after_time` setting
  32. (which accepts a time value) sets the time to wait till recovery happens
  33. once all `gateway.recover_after...nodes` conditions are met.
  34. The `gateway.expected_nodes` allows to set how many data and master
  35. eligible nodes are expected to be in the cluster, and once met, the
  36. `gateway.recover_after_time` is ignored and recovery starts.
  37. Setting `gateway.expected_nodes` also defaults `gateway.recovery_after_time` to `5m` The `gateway.expected_data_nodes` and `gateway.expected_master_nodes`
  38. settings are also supported. For example setting:
  39. [source,js]
  40. --------------------------------------------------
  41. gateway:
  42. recover_after_time: 5m
  43. expected_nodes: 2
  44. --------------------------------------------------
  45. In an expected 2 nodes cluster will cause recovery to start 5 minutes
  46. after the first node is up, but once there are 2 nodes in the cluster,
  47. recovery will begin immediately (without waiting).
  48. Note, once the meta data has been recovered from the gateway (which
  49. indices to create, mappings and so on), then this setting is no longer
  50. effective until the next full restart of the cluster.
  51. Operations are blocked while the cluster meta data has not been
  52. recovered in order not to mix with the actual cluster meta data that
  53. will be recovered once the settings has been reached.
  54. include::gateway/local.asciidoc[]