Skip to content

Commit 1127b37

Browse files
authored
Merge pull request #798 from joelwurtz/patch-2
Explain cluster not supported for elasticsearch
2 parents 14d8d20 + b8960fd commit 1127b37

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

elasticsearch/content.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,26 @@ Elasticsearch is a registered trademark of Elasticsearch BV.
1010

1111
# How to use this image
1212

13-
## Host Setup
13+
## Cluster
1414

15-
**Note:** since 5.0, Elasticsearch only listens on `localhost` by default, so this image sets `network.host` to `0.0.0.0` (given that `localhost` is not terribly useful in the Docker context).
15+
**Note:** since 5.0, Elasticsearch only listens on `localhost` by default on both http and transport, so this image sets `http.host` to `0.0.0.0` (given that `localhost` is not terribly useful in the Docker context).
1616

17-
As a result, Elasticsearch is more strict about the bootstrap checks that it performs, especially when checking the value of `vm.max_map_count` which is not namespaced and thus must be set to an acceptable value on the host (as opposed to simply using `--sysctl` on `docker run`).
17+
As a result, this image does not support clustering out of the box and extra configuration must be set in order to support it.
18+
19+
Supporting clustering implies having Elasticsearch in a production mode which is more strict about the bootstrap checks that it performs, especially when checking the value of `vm.max_map_count` which is not namespaced and thus must be set to an acceptable value on the host (as opposed to simply using `--sysctl` on `docker run`).
20+
21+
One example of adding clustering support is to pass the configuration on the `docker run`:
22+
23+
```console
24+
$ docker run -d --name elas elasticsearch -Etransport.host=0.0.0.0 -Ediscovery.zen.minimum_master_nodes=1
25+
```
1826

1927
See the following sections of the upstream documentation for more information:
2028

2129
- [Setup Elasticsearch » Important System Configuration » Virtual memory](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/vm-max-map-count.html)
2230
- [Setup Elasticsearch » Bootstrap Checks » Maximum map count check](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/_maximum_map_count_check.html)
2331

24-
This [comment in elastic/elasticsearch#4978](https://github.com/elastic/elasticsearch/issues/4978#issuecomment-258676104) shows why this change was added in upstream. Production mode is when listening on non-localhost.
32+
This [comment in elastic/elasticsearch#4978](https://github.com/elastic/elasticsearch/issues/4978#issuecomment-258676104) shows why this change was added in upstream.
2533

2634
> Elasticsearch will not start in production mode if `vm.max_map_count` is not high enough. [...] If the value on your system is NOT high enough, then your cluster is going to crash and burn at some stage and you will lose data.
2735

0 commit comments

Comments
 (0)