如果不设置vm.max_map_count,ElasticSearch 5.0.0-aplha4将无法启动

时间:2016-08-08 13:00:54

标签: elasticsearch logstash elastic-stack filebeat

我希望将我的ES版本从2.3更新到5.0.0-alpha4,以便能够使用Ingest节点并删除Logstash。但似乎ES 5.x版本不会在没有我将vm.max_map_count设置为262144的情况下启动。我不想设置该值。我可以使用默认值65530.任何人都可以指导我如何获得ES 5。 x开始时根本没有篡改内存设置。我无法访问要安装ES的主机上的root用户。
错误:

java.lang.UnsupportedOperationException: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed
at org.elasticsearch.bootstrap.Seccomp.linuxImpl(Seccomp.java:347)
at org.elasticsearch.bootstrap.Seccomp.init(Seccomp.java:616)
[2016-08-08 07:49:55,436][INFO ][node ] [data-cum-ingest-node] initializing ...
[2016-08-08 07:49:56,048][INFO ][plugins ] [data-cum-ingest-node] modules [percolator, lang-mustache, lang-painless, reindex, aggs-matrix-stats, lang-expression, ingest-common, lang-groovy], plugins []
[2016-08-08 07:49:56,601][INFO ][env ] [data-cum-ingest-node] heap size [7.9gb], compressed ordinary object pointers [true]
[2016-08-08 07:49:57,582][INFO ][node ] [data-cum-ingest-node] initialized
[2016-08-08 07:49:57,582][INFO ][node ] [data-cum-ingest-node] starting ...
[2016-08-08 07:49:57,635][ERROR][bootstrap ] [data-cum-ingest-node] Exception
java.lang.RuntimeException: bootstrap checks failed
max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
at org.elasticsearch.bootstrap.BootstrapCheck.check(BootstrapCheck.java:125)
at org.elasticsearch.bootstrap.BootstrapCheck.check(BootstrapCheck.java:85)
at org.elasticsearch.bootstrap.BootstrapCheck.check(BootstrapCheck.java:65)
at org.elasticsearch.bootstrap.Bootstrap$5.validateNodeBeforeAcceptingRequests(Bootstrap.java:178)
at org.elasticsearch.node.Node.start(Node.java:373)
at org.elasticsearch.bootstrap.Bootstrap.start(Bootstrap.java:193)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:252)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:96)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:91)
at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:91)
at org.elasticsearch.cli.Command.main(Command.java:53)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:70)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:63)
Suppressed: java.lang.IllegalStateException: max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at org.elasticsearch.bootstrap.BootstrapCheck.check(BootstrapCheck.java:126)

3 个答案:

答案 0 :(得分:3)

从ES 5开始,有一些bootstrap checks被强制执行。

其中一项检查是Maximum map count check(仅限Linux),需要262144个内存映射区域,否则将拒绝启动。

请注意,无论ES运行环境(dev或prod)

,都会强制执行此检查

答案 1 :(得分:1)

来自文档:

  

如果Elasticsearch处于开发模式,任何引导程序都会检查它   失败在Elasticsearch日志中显示为警告。如果是Elasticsearch   在生产模式下,任何失败的引导检查都会导致   Elasticsearch拒绝开始。

再次从那里:

  

因此,如果确实如此,我们认为Elasticsearch处于开发模式   不绑定也不发布到外部接口(默认),而且是   否则在生产模式下,如果它绑定或发布到外部   接口

要完全禁用检查,只需尝试将bootstrap.ignore_system_bootstrap_checks设置为true

https://www.elastic.co/guide/en/elasticsearch/reference/master/bootstrap-checks.html

答案 2 :(得分:0)

开发模式:如果您在开发模式下运行弹性搜索,我们不需要设置max_map_count。只需按以下方式运行

  

docker run -p 9200:9200 -p 9300:9300 -e“discovery.type = single-node”docker.elastic.co/elasticsearch/elasticsearch:5.6.4

生产模式::如果你在生产中运行,你需要设置如下属性。

的Linux

vm.max_map_count设置应该在/etc/sysctl.conf中永久设置:

  

grep vm.max_map_count /etc/sysctl.conf

     

vm.max_map_count = 262144

  

sysctl -w vm.max_map_count = 262144