在Elasticsearch中,vm.max_map_count太低,增加到262144

时间:2017-02-28 14:06:16

标签: elasticsearch

我正在从elasticsearch 2.x转到5.x并在启动时遇到此问题。

[2017-02-28T14:38:24,490][INFO ][o.e.b.BootstrapChecks    ] [node1] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
[2017-02-28T14:38:24,494][ERROR][o.e.b.Bootstrap          ] [node1] node validation exception
bootstrap checks failed
max file descriptors [8192] for elasticsearch process is too low, increase to at least [65536]
max size virtual memory [52729364480] for user [elastic] is too low, increase to [unlimited]
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

我的yml看起来如下

node.name:  node1
network.host: _global_

我已经下载了elasticsearch tarball,操作系统是SLES11Sp4

定义了Elasticsearch引导程序检查here。但是在使用/etc/security/limits.conf和/etc/sysctl.conf之后,仍然无法提起它。

在rpm安装中,这些东西应该会自动处理。

3 个答案:

答案 0 :(得分:3)

这是最终奏效的设定。

/etc/security/limits.conf文件

* hard memlock unlimited
* soft memlock unlimited
* hard nofile 65536
* soft nofile 65536
*  - as unlimited

/etc/sysctl.conf中

fs.file-max = 2097152
vm.max_map_count = 262144
vm.swappiness = 1

elasticsearch.yml

cluster.name: atul-es-kerberos
node.name:  node1
network.host: _eth0:ipv4_
discovery.zen.ping.unicast.hosts: ["atul.labs.com"]
discovery.zen.minimum_master_nodes: 1

答案 1 :(得分:1)

max_map_count非常低

1。的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

答案 2 :(得分:0)

对于Windows上的Docker,您应该:

docker-machine ssh
sudo sysctl -w vm.max_map_count=262144