elasticsearch vm.max_map_count太低

hjqgdpho  于 2023-05-16  发布在  ElasticSearch
关注(0)|答案(4)|浏览(138)

我正在从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,操作系统是SLES 11 Sp 4
Elasticsearch引导检查定义为here。但是在玩了/etc/security/limits.conf和/etc/sysctl.conf之后,我仍然不能把它带出来。
在rpm安装中,这些事情应该是自动处理的。

f2uvfpb9

f2uvfpb91#

这是最终起作用的设置。
/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
hfyxw5xn

hfyxw5xn2#

最大虚拟内存区域vm.max_map_count [65530]太低,至少增加到[262144]

1. Linux

应在/etc/sysctl.conf中永久设置vm.max_map_count=262144设置
grep vm.max_map_count /etc/sysctl.conf
vm.max_map_count=262144

sysctl -w vm.max_map_count=262144

4urapxun

4urapxun3#

对于Windows上的Docker,您应该:

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

uqdfh47h4#

如果您在macOS上使用Colima运行docker,则需要通过ssh进入VM以设置max_map_count参数,如下所示

colima ssh
sudo sysctl -w vm.max_map_count=262144

相关问题