docker-library/elasticsearch

elasticsearch always stopped. can not running

cnmade opened this issue · 7 comments

huzhifeng@s ~ $ docker logs es
[2016-11-07T09:35:16,669][INFO ][o.e.n.Node               ] [] initializing ...
[2016-11-07T09:35:16,753][INFO ][o.e.e.NodeEnvironment    ] [YNZlOVk] using [1] data paths, mounts [[/usr/share/elasticsearch/data (/dev/sda3)]], net usable_space [779.1gb], net total_space [921.5gb], spins? [possibly], types [xfs]
[2016-11-07T09:35:16,753][INFO ][o.e.e.NodeEnvironment    ] [YNZlOVk] heap size [1.9gb], compressed ordinary object pointers [true]
[2016-11-07T09:35:16,754][INFO ][o.e.n.Node               ] [YNZlOVk] node name [YNZlOVk] derived from node ID; set [node.name] to override
[2016-11-07T09:35:16,756][INFO ][o.e.n.Node               ] [YNZlOVk] version[5.0.0], pid[1], build[253032b/2016-10-26T05:11:34.737Z], OS[Linux/4.8.0-26-generic/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0_102/25.102-b14]
[2016-11-07T09:35:17,388][INFO ][o.e.p.PluginsService     ] [YNZlOVk] loaded module [aggs-matrix-stats]
[2016-11-07T09:35:17,388][INFO ][o.e.p.PluginsService     ] [YNZlOVk] loaded module [ingest-common]
[2016-11-07T09:35:17,389][INFO ][o.e.p.PluginsService     ] [YNZlOVk] loaded module [lang-expression]
[2016-11-07T09:35:17,389][INFO ][o.e.p.PluginsService     ] [YNZlOVk] loaded module [lang-groovy]
[2016-11-07T09:35:17,389][INFO ][o.e.p.PluginsService     ] [YNZlOVk] loaded module [lang-mustache]
[2016-11-07T09:35:17,389][INFO ][o.e.p.PluginsService     ] [YNZlOVk] loaded module [lang-painless]
[2016-11-07T09:35:17,389][INFO ][o.e.p.PluginsService     ] [YNZlOVk] loaded module [percolator]
[2016-11-07T09:35:17,389][INFO ][o.e.p.PluginsService     ] [YNZlOVk] loaded module [reindex]
[2016-11-07T09:35:17,389][INFO ][o.e.p.PluginsService     ] [YNZlOVk] loaded module [transport-netty3]
[2016-11-07T09:35:17,389][INFO ][o.e.p.PluginsService     ] [YNZlOVk] loaded module [transport-netty4]
[2016-11-07T09:35:17,389][INFO ][o.e.p.PluginsService     ] [YNZlOVk] no plugins loaded
[2016-11-07T09:35:17,485][WARN ][o.e.d.s.g.GroovyScriptEngineService] [groovy] scripts are deprecated, use [painless] scripts instead
[2016-11-07T09:35:18,861][INFO ][o.e.n.Node               ] [YNZlOVk] initialized
[2016-11-07T09:35:18,862][INFO ][o.e.n.Node               ] [YNZlOVk] starting ...
[2016-11-07T09:35:18,969][INFO ][o.e.t.TransportService   ] [YNZlOVk] publish_address {172.17.0.2:9300}, bound_addresses {[::]:9300}
[2016-11-07T09:35:18,973][INFO ][o.e.b.BootstrapCheck     ] [YNZlOVk] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
ERROR: bootstrap checks failed
max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
[2016-11-07T09:35:18,979][INFO ][o.e.n.Node               ] [YNZlOVk] stopping ...
[2016-11-07T09:35:18,991][INFO ][o.e.n.Node               ] [YNZlOVk] stopped
[2016-11-07T09:35:18,991][INFO ][o.e.n.Node               ] [YNZlOVk] closing ...
[2016-11-07T09:35:18,999][INFO ][o.e.n.Node               ] [YNZlOVk] closed

I created elasticsearch docker container via

docker run -d --name es -v /home/huzhifeng/data/esdata:/usr/share/elasticsearch/data -p 10.0.12.125:9200:9200 -p 10.0.12.125:9300:9300 elasticsearch

RTFM:
https://hub.docker.com/_/elasticsearch/

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).

Thanks. but i have no permission to change the host machine settings.
so i can only using elastic search 2.x

Indeed, this is an unfortunate limitation of the 5.x series (although AFAIK, these host settings were recommended for the 2.x series as well).

Just curious, what kind of environment are you running in where you can't change the host settings?

openvz vps

I am running the plain docker container and would expect it to be run-able by default.

At least version 2 could be started as plain docker container and worked just fine.

Commands:

docker pull elasticsearch:latest

docker rm -f -v elastic5   # remove container if already running

docker run \
  --name elastic5 \
  --restart=always \
  -v /elastic5:/usr/share/elasticsearch/data \
  --env VIRTUAL_PORT=9200 \
  --env VIRTUAL_HOST=elastic5.server.com \
  --env ES_JAVA_OPTS="-Xms25g -Xmx25g" \
  -d elasticsearch:latest \
  -E node.name=elastic5

docker logs -f elastic5

Output:

[2016-12-17T22:49:53,889][INFO ][o.e.n.Node               ] [elastic5] initializing ...
[2016-12-17T22:49:53,954][INFO ][o.e.e.NodeEnvironment    ] [elastic5] using [1] data paths, mounts [[/usr/share/elasticsearch/data (/dev/sda3)]], net usable_space [171.5gb], net total_space [187.9gb], spins? [possibly], types [ext4]
[2016-12-17T22:49:53,954][INFO ][o.e.e.NodeEnvironment    ] [elastic5] heap size [24.9gb], compressed ordinary object pointers [true]
[2016-12-17T22:49:53,955][INFO ][o.e.n.Node               ] [elastic5] node name [elastic5], node ID [vfPitsVwRbqzULqtOd6VvA]
[2016-12-17T22:49:53,957][INFO ][o.e.n.Node               ] [elastic5] version[5.1.1], pid[1], build[5395e21/2016-12-06T12:36:15.409Z], OS[Linux/4.4.0-31-generic/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0_111/25.111-b14]
[2016-12-17T22:49:54,590][INFO ][o.e.p.PluginsService     ] [elastic5] loaded module [aggs-matrix-stats]
[2016-12-17T22:49:54,590][INFO ][o.e.p.PluginsService     ] [elastic5] loaded module [ingest-common]
[2016-12-17T22:49:54,590][INFO ][o.e.p.PluginsService     ] [elastic5] loaded module [lang-expression]
[2016-12-17T22:49:54,590][INFO ][o.e.p.PluginsService     ] [elastic5] loaded module [lang-groovy]
[2016-12-17T22:49:54,590][INFO ][o.e.p.PluginsService     ] [elastic5] loaded module [lang-mustache]
[2016-12-17T22:49:54,590][INFO ][o.e.p.PluginsService     ] [elastic5] loaded module [lang-painless]
[2016-12-17T22:49:54,590][INFO ][o.e.p.PluginsService     ] [elastic5] loaded module [percolator]
[2016-12-17T22:49:54,590][INFO ][o.e.p.PluginsService     ] [elastic5] loaded module [reindex]
[2016-12-17T22:49:54,590][INFO ][o.e.p.PluginsService     ] [elastic5] loaded module [transport-netty3]
[2016-12-17T22:49:54,590][INFO ][o.e.p.PluginsService     ] [elastic5] loaded module [transport-netty4]
[2016-12-17T22:49:54,590][INFO ][o.e.p.PluginsService     ] [elastic5] no plugins loaded
[2016-12-17T22:49:54,733][WARN ][o.e.d.s.g.GroovyScriptEngineService] [groovy] scripts are deprecated, use [painless] scripts instead
[2016-12-17T22:49:56,567][INFO ][o.e.n.Node               ] [elastic5] initialized
[2016-12-17T22:49:56,567][INFO ][o.e.n.Node               ] [elastic5] starting ...
[2016-12-17T22:49:56,802][INFO ][o.e.t.TransportService   ] [elastic5] publish_address {172.17.0.8:9300}, bound_addresses {[::]:9300}
[2016-12-17T22:49:56,824][INFO ][o.e.b.BootstrapCheck     ] [elastic5] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
ERROR: bootstrap checks failed
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2016-12-17T22:49:56,832][INFO ][o.e.n.Node               ] [elastic5] stopping ...
[2016-12-17T22:49:56,924][INFO ][o.e.n.Node               ] [elastic5] stopped
[2016-12-17T22:49:56,924][INFO ][o.e.n.Node               ] [elastic5] closing ...
[2016-12-17T22:49:56,938][INFO ][o.e.n.Node               ] [elastic5] closed

I tried also tried -E bootstrap.ignore_system_bootstrap_checks=true but that results in another error:

[2016-12-17T22:56:28,839][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [elastic5] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: unknown setting [bootstrap.ignore_system_bootstrap_checks] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:125) ~[elasticsearch-5.1.1.jar:5.1.1]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-5.1.1.jar:5.1.1]
	at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54) ~[elasticsearch-5.1.1.jar:5.1.1]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:96) ~[elasticsearch-5.1.1.jar:5.1.1]
	at org.elasticsearch.cli.Command.main(Command.java:62) ~[elasticsearch-5.1.1.jar:5.1.1]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:89) ~[elasticsearch-5.1.1.jar:5.1.1]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:82) ~[elasticsearch-5.1.1.jar:5.1.1]
Caused by: java.lang.IllegalArgumentException: unknown setting [bootstrap.ignore_system_bootstrap_checks] please check that any required plugins are installed, or check the breaking changes documentation for removed settings

This seems to be a duplicate of #98; specifically #98 (comment).

your "workaround" to ignore the checks from #98 gives me unknown shorthand flag: 'E' in -Ediscovery.zen.minimum_master_nodes=1