linux虚拟机安装elasticsearch6.6.0提示内存不足

安装的时候提示下面信息:

[es@localhost bin]$ ./elasticsearch &
[1] 1690
[es@localhost bin]$ [2019-08-19T07:02:41,413][WARN ][o.e.b.JNANatives         ] [node_1] Unable to lock JVM Memory: error=12, reason=无法分配内存
[2019-08-19T07:02:41,421][WARN ][o.e.b.JNANatives         ] [node_1] This can result in part of the JVM being swapped out.
[2019-08-19T07:02:41,422][WARN ][o.e.b.JNANatives         ] [node_1] Increase RLIMIT_MEMLOCK, soft limit: 65536, hard limit: 65536

[2019-08-19T07:02:41,422][WARN ][o.e.b.JNANatives         ] [node_1] These can be adjusted by modifying /etc/security/limits.conf, for example: 
    # allow user 'es' mlockall
    es soft memlock unlimited
    es hard memlock unlimited
[2019-08-19T07:02:41,422][WARN ][o.e.b.JNANatives         ] [node_1] If you are logged in interactively, you will have to re-login for the new limits to take effect.
[2019-08-19T07:02:42,323][INFO ][o.e.e.NodeEnvironment    ] [node_1] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [14.4gb], net total_space [16.9gb], types [rootfs]
[2019-08-19T07:02:42,324][INFO ][o.e.e.NodeEnvironment    ] [node_1] heap size [1015.6mb], compressed ordinary object pointers [true]
[2019-08-19T07:02:42,331][INFO ][o.e.n.Node               ] [node_1] node name [node_1], node ID [c2pQQznrRv22xPUbGEQ2ng]
[2019-08-19T07:02:42,332][INFO ][o.e.n.Node               ] [node_1] version[6.6.0], pid[1690], build[default/tar/a9861f4/2019-01-24T11:27:09.439740Z], OS[Linux/3.10.0-693.el7.x86_64/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_161/25.161-b12]
[2019-08-19T07:02:42,333][INFO ][o.e.n.Node               ] [node_1] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -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-5923387780725672019, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Des.path.home=/usr/local/elk/elasticsearch-6.6.0, -Des.path.conf=/usr/local/elk/elasticsearch-6.6.0/config, -Des.distribution.flavor=default, -Des.distribution.type=tar]
[2019-08-19T07:02:49,986][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [aggs-matrix-stats]
[2019-08-19T07:02:49,986][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [analysis-common]
[2019-08-19T07:02:49,986][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [ingest-common]
[2019-08-19T07:02:49,986][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [lang-expression]
[2019-08-19T07:02:49,986][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [lang-mustache]
[2019-08-19T07:02:49,987][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [lang-painless]
[2019-08-19T07:02:49,987][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [mapper-extras]
[2019-08-19T07:02:49,987][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [parent-join]
[2019-08-19T07:02:49,987][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [percolator]
[2019-08-19T07:02:49,987][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [rank-eval]
[2019-08-19T07:02:49,987][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [reindex]
[2019-08-19T07:02:49,987][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [repository-url]
[2019-08-19T07:02:49,988][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [transport-netty4]
[2019-08-19T07:02:49,988][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [tribe]
[2019-08-19T07:02:49,988][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [x-pack-ccr]
[2019-08-19T07:02:49,988][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [x-pack-core]
[2019-08-19T07:02:49,988][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [x-pack-deprecation]
[2019-08-19T07:02:49,988][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [x-pack-graph]
[2019-08-19T07:02:49,989][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [x-pack-ilm]
[2019-08-19T07:02:49,989][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [x-pack-logstash]
[2019-08-19T07:02:49,989][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [x-pack-ml]
[2019-08-19T07:02:49,989][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [x-pack-monitoring]
[2019-08-19T07:02:49,989][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [x-pack-rollup]
[2019-08-19T07:02:49,989][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [x-pack-security]
[2019-08-19T07:02:49,989][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [x-pack-sql]
[2019-08-19T07:02:49,990][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [x-pack-upgrade]
[2019-08-19T07:02:49,990][INFO ][o.e.p.PluginsService     ] [node_1] loaded module [x-pack-watcher]
[2019-08-19T07:02:49,991][INFO ][o.e.p.PluginsService     ] [node_1] loaded plugin [sql]
[2019-08-19T07:03:09,731][INFO ][o.e.x.s.a.s.FileRolesStore] [node_1] parsed [0] roles from file [/usr/local/elk/elasticsearch-6.6.0/config/roles.yml]
[2019-08-19T07:03:11,936][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [node_1] [controller/1745] [Main.cc@109] controller (64 bit): Version 6.6.0 (Build bbb4919f4d17a5) Copyright (c) 2019 Elasticsearch BV
[2019-08-19T07:03:14,557][DEBUG][o.e.a.ActionModule       ] [node_1] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
[2019-08-19T07:03:15,808][INFO ][o.e.d.DiscoveryModule    ] [node_1] using discovery type [zen] and host providers [settings]
[2019-08-19T07:03:20,343][INFO ][o.e.n.Node               ] [node_1] initialized
[2019-08-19T07:03:20,344][INFO ][o.e.n.Node               ] [node_1] starting ...
[2019-08-19T07:03:21,113][INFO ][o.e.t.TransportService   ] [node_1] publish_address {192.168.237.10:9300}, bound_addresses {192.168.237.10:9300}
[2019-08-19T07:03:21,186][INFO ][o.e.b.BootstrapChecks    ] [node_1] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [1] bootstrap checks failed
[1]: memory locking requested for elasticsearch process but memory is not locked
[2019-08-19T07:03:21,262][INFO ][o.e.n.Node               ] [node_1] stopping ...
[2019-08-19T07:03:21,336][INFO ][o.e.n.Node               ] [node_1] stopped
[2019-08-19T07:03:21,337][INFO ][o.e.n.Node               ] [node_1] closing ...
[2019-08-19T07:03:21,411][INFO ][o.e.n.Node               ] [node_1] closed
[2019-08-19T07:03:21,416][INFO ][o.e.x.m.p.NativeController] [node_1] Native controller process has stopped - no new native processes can be started
^C
[1]+  退出 78               ./elasticsearch
 

 

上网查了很多办法,都不行,最后执行vi /etc/sysctl.conf

然后加入下面两个参数:

vm.max_map_count = 655360
vm.swappiness = 0
保存退出,记得最后执行sysctl -p让它生效。

 

 

你可能感兴趣的:(ELK)