2016-10-31 34 views
2

開始一個新的容器我運行:失敗時elasticsearch 5.0

$ docker run --rm -ti -p 9200:9200 -p 9300:9300 elasticsearch 

但我不能啓動elasticsearch 5.0,這裏的日誌:

Unable to find image 'elasticsearch:latest' locally 
latest: Pulling from library/elasticsearch 

43c265008fae: Already exists 
af36d2c7a148: Already exists 
2b7b4d10e1c1: Already exists 
9f7579daddb2: Already exists 
a985511f2468: Already exists 
6c2b485fcc3e: Already exists 
00b73c83b440: Already exists 
a38975861823: Pull complete 
b9d0b4aaf934: Pull complete 
f5f25bb3de04: Pull complete 
93426e1e8953: Pull complete 
590c2ab9b639: Pull complete 
31bf48850601: Pull complete 
21aad7ce70fa: Pull complete 
Digest: sha256:29205bca045c8d083f777dfc453f4f1ff3d2c08ea4f529f88795166c58e5607e 
Status: Downloaded newer image for elasticsearch:latest 
[2016-10-31T20:56:22,023][INFO ][o.e.n.Node    ] [] initializing ... 
[2016-10-31T20:56:22,129][INFO ][o.e.e.NodeEnvironment ] [N-vpIo0] using [1] data paths, mounts [[/usr/share/elasticsearch/data (/dev/sda8)]], net usable_space [48.7gb], net total_space [98.3gb], spins? [possibly], types [ext4] 
[2016-10-31T20:56:22,130][INFO ][o.e.e.NodeEnvironment ] [N-vpIo0] heap size [1.9gb], compressed ordinary object pointers [true] 
[2016-10-31T20:56:22,130][INFO ][o.e.n.Node    ] [N-vpIo0] node name [N-vpIo0] derived from node ID; set [node.name] to override 
[2016-10-31T20:56:22,132][INFO ][o.e.n.Node    ] [N-vpIo0] version[5.0.0], pid[1], build[253032b/2016-10-26T05:11:34.737Z], OS[Linux/3.16.0-4-amd64/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0_102/25.102-b14] 
[2016-10-31T20:56:22,785][INFO ][o.e.p.PluginsService  ] [N-vpIo0] loaded module [aggs-matrix-stats] 
[2016-10-31T20:56:22,785][INFO ][o.e.p.PluginsService  ] [N-vpIo0] loaded module [ingest-common] 
[2016-10-31T20:56:22,785][INFO ][o.e.p.PluginsService  ] [N-vpIo0] loaded module [lang-expression] 
[2016-10-31T20:56:22,785][INFO ][o.e.p.PluginsService  ] [N-vpIo0] loaded module [lang-groovy] 
[2016-10-31T20:56:22,785][INFO ][o.e.p.PluginsService  ] [N-vpIo0] loaded module [lang-mustache] 
[2016-10-31T20:56:22,785][INFO ][o.e.p.PluginsService  ] [N-vpIo0] loaded module [lang-painless] 
[2016-10-31T20:56:22,785][INFO ][o.e.p.PluginsService  ] [N-vpIo0] loaded module [percolator] 
[2016-10-31T20:56:22,785][INFO ][o.e.p.PluginsService  ] [N-vpIo0] loaded module [reindex] 
[2016-10-31T20:56:22,785][INFO ][o.e.p.PluginsService  ] [N-vpIo0] loaded module [transport-netty3] 
[2016-10-31T20:56:22,785][INFO ][o.e.p.PluginsService  ] [N-vpIo0] loaded module [transport-netty4] 
[2016-10-31T20:56:22,786][INFO ][o.e.p.PluginsService  ] [N-vpIo0] no plugins loaded 
[2016-10-31T20:56:22,875][WARN ][o.e.d.s.g.GroovyScriptEngineService] [groovy] scripts are deprecated, use [painless] scripts instead 
[2016-10-31T20:56:24,241][INFO ][o.e.n.Node    ] [N-vpIo0] initialized 
[2016-10-31T20:56:24,241][INFO ][o.e.n.Node    ] [N-vpIo0] starting ... 
[2016-10-31T20:56:24,380][INFO ][o.e.t.TransportService ] [N-vpIo0] publish_address {172.17.0.4:9300}, bound_addresses {[::]:9300} 
[2016-10-31T20:56:24,389][INFO ][o.e.b.BootstrapCheck  ] [N-vpIo0] 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-10-31T20:56:24,400][INFO ][o.e.n.Node    ] [N-vpIo0] stopping ... 
[2016-10-31T20:56:24,426][INFO ][o.e.n.Node    ] [N-vpIo0] stopped 
[2016-10-31T20:56:24,426][INFO ][o.e.n.Node    ] [N-vpIo0] closing ... 
[2016-10-31T20:56:24,433][INFO ][o.e.n.Node    ] [N-vpIo0] closed 

請,我該如何解決這個問題?

回答

6

截至Docker image documentation主機設置節說:

注意:自5.0起,Elasticsearch默認只偵聽本地主機, ,所以這個鏡像設置network.host爲0.0.0.0(鑑於本地主機是 在Docker上下文中不是非常有用)。

結果,Elasticsearch是更加嚴格的自舉檢查 它執行,檢查 vm.max_map_count未命名空間,因此必須設置在主機上的 可接受值的值尤其是當(如反對簡單地使用--sysctl on 碼頭運行)。

所以,你只需要在主機上執行此:

sysctl -w vm.max_map_count=262144 

,你是好與5.0.0版本去

要永久設置此值,更新vm.max_map_count設置在/etc/sysctl.conf。要在重新啓動後進行驗證,請運行sysctl vm.max_map_count

More information here

相關問題