在做es集群的时候,因为集成pinyin分词器想着把内存调大一些然后报了如下错误,搞了一个多小时,特别记录下这次非常心酸的es启动报错排查过程
报错信息如下
[2020-08-22T15:53:50,819][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [es-node1] [controller/78] [Main.cc@109] controller (64 bit): Version 6.8.10 (Build a5f7163bca0250) Copyright (c) 2020 Elasticsearch BV
[2020-08-22T15:53:52,207][INFO ][o.e.d.DiscoveryModule ] [es-node1] using discovery type [zen] and host providers [settings]
[2020-08-22T15:53:54,007][INFO ][o.e.n.Node ] [es-node1] initialized
[2020-08-22T15:53:54,007][INFO ][o.e.n.Node ] [es-node1] starting ...
[2020-08-22T15:53:54,269][INFO ][o.e.t.TransportService ] [es-node1] publish_address {192.168.31.58:9300}, bound_addresses {0.0.0.0:9300}
[2020-08-22T15:53:54,313][INFO ][o.e.b.BootstrapChecks ] [es-node1] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [1] bootstrap checks failed
[1]: initial heap size [268435456] not equal to maximum heap size [536870912]; this can cause resize pauses and prevents mlockall from locking the entire heap
[2020-08-22T15:53:54,398][INFO ][o.e.n.Node ] [es-node1] stopping ...
[2020-08-22T15:53:54,438][INFO ][o.e.n.Node ] [es-node1] stopped
[2020-08-22T15:53:54,438][INFO ][o.e.n.Node ] [es-node1] closing ...
[2020-08-22T15:53:54,455][INFO ][o.e.n.Node ] [es-node1] closed
[2020-08-22T15:53:54,458][INFO ][o.e.x.m.p.NativeController] [es-node1] Native controller process has stopped - no new native processes can be started
解决过程,根据网上找的答案:
先修改了资源限制配置文件limits.conf, 限制着用户可以使用的最大文件数,最大线程,最大内存等资源使用量
vi /etc/security/limits.conf
hadoop soft nofile 65536 # soft表示为超过这个值就会有warnning
hadoop hadr nofile 100000 # hard则表示不能超过这个值
hadoop soft nproc 2048
hadoop hard nproc 4096
然后通过修改sysctl.conf文件来修改Linux内核参数,把vm.max_map_coun 设置到655360
vi /etc/sysctl.conf
vm.swappiness = 0
vm.max_map_count=655360
fs.file-max = 999999
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_keepalive_time = 60
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.ip_local_port_range = 1024 61000
net.ipv4.tcp_rmem = 4096 32768 262142
net.ipv4.tcp_wmem = 4096 32768 262142
net.core.netdev_max_backlog = 8096
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 2097152
net.core.wmem_max = 2097152
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_syn.backlog = 1024
然后执行sysctl -p命令,使修改生效,还是没用
仔细查找后才发现,是启动jvm参数设置错了 ,一个大一个小 -Xms256m -Xmx512m,因为加了pinyin分词器插件之后256内存不够用,所以加大内存,然而只加了一个导致这个错误。
版权声明:本文为Deepak192原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。