2013-08-28 19:24:34 -04:00
|
|
|
[[modules-gateway-local]]
|
|
|
|
=== Local Gateway
|
|
|
|
|
|
|
|
The local gateway allows for recovery of the full cluster state and
|
|
|
|
indices from the local storage of each node, and does not require a
|
|
|
|
common node level shared storage.
|
|
|
|
|
|
|
|
Note, different from shared gateway types, the persistency to the local
|
|
|
|
gateway is *not* done in an async manner. Once an operation is
|
|
|
|
performed, the data is there for the local gateway to recover it in case
|
|
|
|
of full cluster failure.
|
|
|
|
|
|
|
|
It is important to configure the `gateway.recover_after_nodes` setting
|
|
|
|
to include most of the expected nodes to be started after a full cluster
|
|
|
|
restart. This will insure that the latest cluster state is recovered.
|
|
|
|
For example:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
gateway:
|
2014-07-04 14:12:05 -04:00
|
|
|
recover_after_nodes: 3
|
|
|
|
expected_nodes: 5
|
2013-08-28 19:24:34 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
|
2014-03-15 07:07:17 -04:00
|
|
|
[float]
|
|
|
|
==== Dangling indices
|
|
|
|
|
|
|
|
When a node joins the cluster, any shards/indices stored in its local `data/`
|
|
|
|
directory which do not already exist in the cluster will be imported into the
|
|
|
|
cluster by default. This functionality has two purposes:
|
|
|
|
|
|
|
|
1. If a new master node is started which is unaware of the other indices in
|
|
|
|
the cluster, adding the old nodes will cause the old indices to be
|
|
|
|
imported, instead of being deleted.
|
|
|
|
|
|
|
|
2. An old index can be added to an existing cluster by copying it to the
|
|
|
|
`data/` directory of a new node, starting the node and letting it join
|
|
|
|
the cluster. Once the index has been replicated to other nodes in the
|
|
|
|
cluster, the new node can be shut down and removed.
|
|
|
|
|
|
|
|
The import of dangling indices can be controlled with the
|
2014-12-15 07:47:34 -05:00
|
|
|
`gateway.auto_import_dangled` which accepts:
|
2014-03-15 07:07:17 -04:00
|
|
|
|
|
|
|
[horizontal]
|
|
|
|
`yes`::
|
|
|
|
|
|
|
|
Import dangling indices into the cluster (default).
|
|
|
|
|
|
|
|
`close`::
|
|
|
|
|
|
|
|
Import dangling indices into the cluster state, but leave them closed.
|
|
|
|
|
|
|
|
`no`::
|
|
|
|
|
2014-12-15 07:47:34 -05:00
|
|
|
Delete dangling indices after `gateway.dangling_timeout`, which
|
2014-03-15 07:07:17 -04:00
|
|
|
defaults to 2 hours.
|