0
点赞
收藏
分享

微信扫一扫

ES问题max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]


docker 运行es是会发现没有运行

docker logs 7bb8ff0f76a8

 查看es日志发现标红的错误

OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
[2019-10-25T08:30:55,895][INFO ][o.e.e.NodeEnvironment    ] [LhNAghs] using [1] data paths, mounts [[/ (overlay)]], net usable_space [11.6gb], net total_space [19.5gb], types [overlay]
[2019-10-25T08:30:55,913][INFO ][o.e.e.NodeEnvironment    ] [LhNAghs] heap size [1015.6mb], compressed ordinary object pointers [true]
[2019-10-25T08:30:55,917][INFO ][o.e.n.Node               ] [LhNAghs] node name derived from node ID [LhNAghswTYeAWC6446XK3A]; set [node.name] to override
[2019-10-25T08:30:55,917][INFO ][o.e.n.Node               ] [LhNAghs] version[6.5.3], pid[1], build[default/tar/159a78a/2018-12-06T20:11:28.826501Z], OS[Linux/5.0.0-23-generic/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/11.0.1/11.0.1+13]
[2019-10-25T08:30:55,917][INFO ][o.e.n.Node               ] [LhNAghs] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/tmp/elasticsearch.YWGrta9o, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m, -Djava.locale.providers=COMPAT, -XX:UseAVX=2, -Des.cgroups.hierarchy.override=/, -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/usr/share/elasticsearch/config, -Des.distribution.flavor=default, -Des.distribution.type=tar]
[2019-10-25T08:30:59,829][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [aggs-matrix-stats]
[2019-10-25T08:30:59,829][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [analysis-common]
[2019-10-25T08:30:59,830][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [ingest-common]
[2019-10-25T08:30:59,830][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [lang-expression]
[2019-10-25T08:30:59,830][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [lang-mustache]
[2019-10-25T08:30:59,830][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [lang-painless]
[2019-10-25T08:30:59,830][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [mapper-extras]
[2019-10-25T08:30:59,830][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [parent-join]
[2019-10-25T08:30:59,831][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [percolator]
[2019-10-25T08:30:59,831][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [rank-eval]
[2019-10-25T08:30:59,831][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [reindex]
[2019-10-25T08:30:59,831][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [repository-url]
[2019-10-25T08:30:59,831][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [transport-netty4]
[2019-10-25T08:30:59,832][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [tribe]
[2019-10-25T08:30:59,832][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [x-pack-ccr]
[2019-10-25T08:30:59,832][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [x-pack-core]
[2019-10-25T08:30:59,832][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [x-pack-deprecation]
[2019-10-25T08:30:59,832][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [x-pack-graph]
[2019-10-25T08:30:59,832][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [x-pack-logstash]
[2019-10-25T08:30:59,832][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [x-pack-ml]
[2019-10-25T08:30:59,833][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [x-pack-monitoring]
[2019-10-25T08:30:59,833][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [x-pack-rollup]
[2019-10-25T08:30:59,833][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [x-pack-security]
[2019-10-25T08:30:59,833][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [x-pack-sql]
[2019-10-25T08:30:59,833][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [x-pack-upgrade]
[2019-10-25T08:30:59,833][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded module [x-pack-watcher]
[2019-10-25T08:30:59,834][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded plugin [ingest-geoip]
[2019-10-25T08:30:59,834][INFO ][o.e.p.PluginsService     ] [LhNAghs] loaded plugin [ingest-user-agent]
[2019-10-25T08:31:12,255][INFO ][o.e.x.s.a.s.FileRolesStore] [LhNAghs] parsed [0] roles from file [/usr/share/elasticsearch/config/roles.yml]
[2019-10-25T08:31:14,041][INFO ][o.e.x.m.j.p.l.CppLogMessageHandler] [LhNAghs] [controller/62] [Main.cc@109] controller (64 bit): Version 6.5.3 (Build f418a701d70c6e) Copyright (c) 2018 Elasticsearch BV
[2019-10-25T08:31:15,391][INFO ][o.e.d.DiscoveryModule    ] [LhNAghs] using discovery type [zen] and host providers [settings]
[2019-10-25T08:31:17,607][INFO ][o.e.n.Node               ] [LhNAghs] initialized
[2019-10-25T08:31:17,608][INFO ][o.e.n.Node               ] [LhNAghs] starting ...
[2019-10-25T08:31:17,939][INFO ][o.e.t.TransportService   ] [LhNAghs] publish_address {172.17.0.2:9300}, bound_addresses {0.0.0.0:9300}
[2019-10-25T08:31:17,973][INFO ][o.e.b.BootstrapChecks    ] [LhNAghs] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2019-10-25T08:31:17,998][INFO ][o.e.n.Node               ] [LhNAghs] stopping ...
[2019-10-25T08:31:18,170][INFO ][o.e.n.Node               ] [LhNAghs] stopped
[2019-10-25T08:31:18,170][INFO ][o.e.n.Node               ] [LhNAghs] closing ...
[2019-10-25T08:31:18,227][INFO ][o.e.n.Node               ] [LhNAghs] closed
[2019-10-25T08:31:18,234][INFO ][o.e.x.m.j.p.NativeController] [LhNAghs] Native controller process has stopped - no new native processes can be started

解决办法:

方法一:

1. 修改max_map_count值

$ sudo sysctl -w vm.max_map_count=262144

2、查看是否修改为262144

$ more /proc/sys/vm/max_map_count
262144

3. 然后,重新启动elasticsearch,即可启动成功。

方法二:

将虚拟机多分配内存能让es足够运行起来, 默认es配置占用1g内存

 

举报

相关推荐

0 条评论