博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
bootstrap.memory_lock: true导致Elasticsearch启动失败问题
阅读量:6807 次
发布时间:2019-06-26

本文共 6687 字,大约阅读时间需要 22 分钟。

elasticsearch官网建议生产环境需要设置bootstrap.memory_lock: true

重新启动elasticsearch,报错信息如下:

[baoshan@test-43.dev.rokid-inc.com /home/baoshan/elk/elasticsearch-5.3.0]

$bin/elasticsearch
[2017-04-20T21:45:36,741][WARN ][o.e.b.JNANatives ] Unable to lock JVM Memory: error=12, reason=无法分配内存
[2017-04-20T21:45:36,746][WARN ][o.e.b.JNANatives ] This can result in part of the JVM being swapped out.
[2017-04-20T21:45:36,746][WARN ][o.e.b.JNANatives ] Increase RLIMIT_MEMLOCK, soft limit: 65536, hard limit: 65536
[2017-04-20T21:45:36,747][WARN ][o.e.b.JNANatives ] These can be adjusted by modifying /etc/security/limits.conf, for example:
# allow user 'baoshan' mlockall
baoshan soft memlock unlimited
baoshan hard memlock unlimited
[2017-04-20T21:45:36,747][WARN ][o.e.b.JNANatives ] If you are logged in interactively, you will have to re-login for the new limits to take effect.
[2017-04-20T21:45:37,057][INFO ][o.e.n.Node ] [node-43] initializing ...
[2017-04-20T21:45:37,584][INFO ][o.e.e.NodeEnvironment ] [node-43] using [1] data paths, mounts [[/ (/dev/mapper/vg_root-lv_root)]], net usable_space [39.6gb], net total_space [44.7gb], spins? [possibly], types [ext4]
[2017-04-20T21:45:37,585][INFO ][o.e.e.NodeEnvironment ] [node-43] heap size [1.9gb], compressed ordinary object pointers [unknown]
[2017-04-20T21:45:37,587][INFO ][o.e.n.Node ] [node-43] node name [node-43], node ID [oUSfip81Sc-SGtZP9GCydg]
[2017-04-20T21:45:37,588][INFO ][o.e.n.Node ] [node-43] version[5.3.0], pid[5150], build[3adb13b/2017-03-23T03:31:50.652Z], OS[Linux/2.6.32-504.el6.x86_64/i386], JVM[Oracle Corporation/Java HotSpot(TM) Server VM/1.8.0_121/25.121-b13]
[2017-04-20T21:45:39,914][INFO ][o.e.p.PluginsService ] [node-43] loaded module [aggs-matrix-stats]
[2017-04-20T21:45:39,915][INFO ][o.e.p.PluginsService ] [node-43] loaded module [ingest-common]
[2017-04-20T21:45:39,916][INFO ][o.e.p.PluginsService ] [node-43] loaded module [lang-expression]
[2017-04-20T21:45:39,916][INFO ][o.e.p.PluginsService ] [node-43] loaded module [lang-groovy]
[2017-04-20T21:45:39,916][INFO ][o.e.p.PluginsService ] [node-43] loaded module [lang-mustache]
[2017-04-20T21:45:39,916][INFO ][o.e.p.PluginsService ] [node-43] loaded module [lang-painless]
[2017-04-20T21:45:39,917][INFO ][o.e.p.PluginsService ] [node-43] loaded module [percolator]
[2017-04-20T21:45:39,917][INFO ][o.e.p.PluginsService ] [node-43] loaded module [reindex]
[2017-04-20T21:45:39,917][INFO ][o.e.p.PluginsService ] [node-43] loaded module [transport-netty3]
[2017-04-20T21:45:39,917][INFO ][o.e.p.PluginsService ] [node-43] loaded module [transport-netty4]
[2017-04-20T21:45:39,919][INFO ][o.e.p.PluginsService ] [node-43] no plugins loaded
[2017-04-20T21:45:42,143][INFO ][o.e.n.Node ] [node-43] initialized
[2017-04-20T21:45:42,150][INFO ][o.e.n.Node ] [node-43] starting ...
[2017-04-20T21:45:42,282][WARN ][i.n.u.i.MacAddressUtil ] Failed to find a usable hardware address from the network interfaces; using random bytes: 5b:5f:0c:d6:78:e5:0b:ec
[2017-04-20T21:45:42,381][INFO ][o.e.t.TransportService ] [node-43] publish_address {10.88.128.88:9300}, bound_addresses {10.88.128.88:9300}
[2017-04-20T21:45:42,395][INFO ][o.e.b.BootstrapChecks ] [node-43] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
ERROR: bootstrap checks failed
memory locking requested for elasticsearch process but memory is not locked
[2017-04-20T21:45:42,430][INFO ][o.e.n.Node ] [node-43] stopping ...
[2017-04-20T21:45:42,500][INFO ][o.e.n.Node ] [node-43] stopped
[2017-04-20T21:45:42,500][INFO ][o.e.n.Node ] [node-43] closing ...
[2017-04-20T21:45:42,525][INFO ][o.e.n.Node ] [node-43] closed

 

解决办法如下:

需要修改

/etc/security/limits.conf
baoshan soft memlock unlimited
baoshan hard memlock unlimited

修改:

/etc/sysctl.conf
vm.swappiness=0

之后重启机器

 

再次启动elasticsearch,成功,信息如下:

[baoshan@test-43.dev.rokid-inc.com /home/baoshan/elk/elasticsearch-5.3.0]

$bin/elasticsearch
[2017-04-20T21:49:34,755][INFO ][o.e.n.Node ] [node-43] initializing ...
[2017-04-20T21:49:35,168][INFO ][o.e.e.NodeEnvironment ] [node-43] using [1] data paths, mounts [[/ (/dev/mapper/vg_root-lv_root)]], net usable_space [39.6gb], net total_space [44.7gb], spins? [possibly], types [ext4]
[2017-04-20T21:49:35,170][INFO ][o.e.e.NodeEnvironment ] [node-43] heap size [1.9gb], compressed ordinary object pointers [unknown]
[2017-04-20T21:49:35,176][INFO ][o.e.n.Node ] [node-43] node name [node-43], node ID [oUSfip81Sc-SGtZP9GCydg]
[2017-04-20T21:49:35,178][INFO ][o.e.n.Node ] [node-43] version[5.3.0], pid[1208], build[3adb13b/2017-03-23T03:31:50.652Z], OS[Linux/2.6.32-504.el6.x86_64/i386], JVM[Oracle Corporation/Java HotSpot(TM) Server VM/1.8.0_121/25.121-b13]
[2017-04-20T21:49:38,647][INFO ][o.e.p.PluginsService ] [node-43] loaded module [aggs-matrix-stats]
[2017-04-20T21:49:38,647][INFO ][o.e.p.PluginsService ] [node-43] loaded module [ingest-common]
[2017-04-20T21:49:38,647][INFO ][o.e.p.PluginsService ] [node-43] loaded module [lang-expression]
[2017-04-20T21:49:38,648][INFO ][o.e.p.PluginsService ] [node-43] loaded module [lang-groovy]
[2017-04-20T21:49:38,648][INFO ][o.e.p.PluginsService ] [node-43] loaded module [lang-mustache]
[2017-04-20T21:49:38,648][INFO ][o.e.p.PluginsService ] [node-43] loaded module [lang-painless]
[2017-04-20T21:49:38,649][INFO ][o.e.p.PluginsService ] [node-43] loaded module [percolator]
[2017-04-20T21:49:38,650][INFO ][o.e.p.PluginsService ] [node-43] loaded module [reindex]
[2017-04-20T21:49:38,650][INFO ][o.e.p.PluginsService ] [node-43] loaded module [transport-netty3]
[2017-04-20T21:49:38,650][INFO ][o.e.p.PluginsService ] [node-43] loaded module [transport-netty4]
[2017-04-20T21:49:38,652][INFO ][o.e.p.PluginsService ] [node-43] no plugins loaded
[2017-04-20T21:49:43,478][INFO ][o.e.n.Node ] [node-43] initialized
[2017-04-20T21:49:43,478][INFO ][o.e.n.Node ] [node-43] starting ...
[2017-04-20T21:49:43,650][WARN ][i.n.u.i.MacAddressUtil ] Failed to find a usable hardware address from the network interfaces; using random bytes: 5d:dc:90:e8:b1:e1:50:72
[2017-04-20T21:49:43,858][INFO ][o.e.t.TransportService ] [node-43] publish_address {10.88.128.88:9300}, bound_addresses {10.88.128.88:9300}
[2017-04-20T21:49:43,872][INFO ][o.e.b.BootstrapChecks ] [node-43] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
[2017-04-20T21:50:13,896][WARN ][o.e.n.Node ] [node-43] timed out while waiting for initial discovery state - timeout: 30s
[2017-04-20T21:50:13,935][INFO ][o.e.h.n.Netty4HttpServerTransport] [node-43] publish_address {10.88.128.88:9200}, bound_addresses {10.88.128.88:9200}
[2017-04-20T21:50:13,950][INFO ][o.e.n.Node ] [node-43] started

OK,搞定!

转载地址:http://hbtwl.baihongyu.com/

你可能感兴趣的文章
国内趋于概念化的 “数据分析”在硅谷是怎样真正落地的?
查看>>
物联网时代如何保障数据安全
查看>>
你还敢用鼠标吗?黑客在百米之外控制你的鼠标
查看>>
比特币勒索攻击技术演进与趋势
查看>>
Java Main 如何是如何被执行的?
查看>>
CentOS配置Nginx官方的Yum源 及yum安装php
查看>>
新年跨出第一步:人工智能实施这样做!
查看>>
Adobe Flash Player v26.0.0.126发布:请尽快更新
查看>>
《C语言程序设计:问题与求解方法》——2.15节算术表达式
查看>>
《iOS取证实战:调查、分析与移动安全》一3.6 iPhone操作系统
查看>>
苹果HomeKit智能家居战略藏野心:欲实现下一次颠覆
查看>>
视频干扰现象及其原因分析
查看>>
科技部再公布网络安全等10项国家重点研发计划
查看>>
《编程原本 》一1.8 总结
查看>>
剖析云计算和大数据落地后x86服务器的业务痛点
查看>>
贵阳打出大数据战略组合拳
查看>>
企业从信息化角度解读智慧城市,难以根治城市病
查看>>
硅谷初创企业控制成本 裁员风渐起
查看>>
油耗虚高保养贵,便宜车就活该问题多多?
查看>>
REC Solar推出黑色多晶半切片PERC组件,已进入量产化
查看>>