Sebp / elk docker运行错误

elk: image: sebp/elk ports: - "5601:5601" - "9200:9200" - "5044:5044" 

当我运行命令:sudo docker-compose up时,控制台显示:

Elasticsearch日志如下。

 [2017-08-30T03:04:35,674][INFO ][oenNode ] [] initializing ... [2017-08-30T03:04:35,777][INFO ][oeeNodeEnvironment ] [ntFgcue] using [1] data paths, mounts [[/var/lib/elasticsearch (/dev/mapper/cl-root)]], net usable_space [46.3gb], net total_space [49.9gb], spins? [possibly], types [xfs] [2017-08-30T03:04:35,777][INFO ][oeeNodeEnvironment ] [ntFgcue] heap size [1.9gb], compressed ordinary object pointers [true] [2017-08-30T03:04:35,778][INFO ][oenNode ] node name [ntFgcue] derived from node ID [ntFgcueGRcyRoRjXBvq70A]; set [node.name] to override [2017-08-30T03:04:35,779][INFO ][oenNode ] version[5.5.1], pid[74], build[19c13d0/2017-07-18T20:44:24.823Z], OS[Linux/3.10.0-514.el7.x86_64/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0_131/25.131-b11] [2017-08-30T03:04:35,780][INFO ][oenNode ] JVM arguments [-Xms2g, -Xmx2g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -Djdk.io.permissionsUseCanonicalPath=true, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j.skipJansi=true, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/opt/elasticsearch] [2017-08-30T03:04:38,175][INFO ][oepPluginsService ] [ntFgcue] loaded module [aggs-matrix-stats] [2017-08-30T03:04:38,175][INFO ][oepPluginsService ] [ntFgcue] loaded module [ingest-common] [2017-08-30T03:04:38,175][INFO ][oepPluginsService ] [ntFgcue] loaded module [lang-expression] [2017-08-30T03:04:38,175][INFO ][oepPluginsService ] [ntFgcue] loaded module [lang-groovy] [2017-08-30T03:04:38,175][INFO ][oepPluginsService ] [ntFgcue] loaded module [lang-mustache] [2017-08-30T03:04:38,175][INFO ][oepPluginsService ] [ntFgcue] loaded module [lang-painless] [2017-08-30T03:04:38,175][INFO ][oepPluginsService ] [ntFgcue] loaded module [parent-join] [2017-08-30T03:04:38,175][INFO ][oepPluginsService ] [ntFgcue] loaded module [percolator] [2017-08-30T03:04:38,175][INFO ][oepPluginsService ] [ntFgcue] loaded module [reindex] [2017-08-30T03:04:38,175][INFO ][oepPluginsService ] [ntFgcue] loaded module [transport-netty3] [2017-08-30T03:04:38,175][INFO ][oepPluginsService ] [ntFgcue] loaded module [transport-netty4] [2017-08-30T03:04:38,176][INFO ][oepPluginsService ] [ntFgcue] no plugins loaded [2017-08-30T03:04:41,409][INFO ][oedDiscoveryModule ] [ntFgcue] using discovery type [zen] [2017-08-30T03:04:42,424][INFO ][oenNode ] initialized [2017-08-30T03:04:42,424][INFO ][oenNode ] [ntFgcue] starting ... [2017-08-30T03:04:42,858][INFO ][oetTransportService ] [ntFgcue] publish_address {172.17.0.1:9300}, bound_addresses {[::]:9300} [2017-08-30T03:04:42,875][INFO ][oebBootstrapChecks ] [ntFgcue] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks [2017-08-30T03:04:42,890][ERROR][oebBootstrap ] [ntFgcue] node validation exception [1] bootstrap checks failed [1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536] [2017-08-30T03:04:42,921][INFO ][oenNode ] [ntFgcue] stopping ... [2017-08-30T03:04:43,012][INFO ][oenNode ] [ntFgcue] stopped [2017-08-30T03:04:43,012][INFO ][oenNode ] [ntFgcue] closing ... [2017-08-30T03:04:43,036][INFO ][oenNode ] [ntFgcue] closed 

我们可以为撰写文件中定义的服务设置ulimits。 在你的情况下尝试添加ulimit部分如下 –

 elk: image: sebp/elk ports: - "5601:5601" - "9200:9200" - "5044:5044" ulimits: nofile: soft: 65536 hard: 65536 

Ref- https://docs.docker.com/compose/compose-file/#imimits