[hadoop@mini02 elasticsearch]$ bin/elasticsearch
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 2060255232 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /home/hadoop/install/elasticsearch/hs_err_pid10451.log
可以看到报错信息为Java HotSpot™ 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0) failed; error=‘Cannot allocate memory’ (errno=12)
由于elasticsearch5.x默认分配jvm空间大小为2g,修改jvm空间分配
[hadoop@mini02 elasticsearch] $ vi config/jvm.options
-Xms2g
-Xmx2g
修改为
- -Xms 512m
- -Xmx 512m
重新启动程序
[hadoop@mini02 elasticsearch]$ bin/elasticsearch [2018-12-21T07:52:57,692][INFO ][o.e.n.Node ] [node-1] initializing ... [2018-12-21T07:52:58,834][INFO ][o.e.e.NodeEnvironment ] [node-1] using [1] data paths, mounts [[/ (/dev/mapper/vg_mini02-lv_root)]], net usable_space [11.4gb], net total_space [17.2gb], spins? [possibly], types [ext4] [2018-12-21T07:52:58,838][INFO ][o.e.e.NodeEnvironment ] [node-1] heap size [503.6mb], compressed ordinary object pointers [true] [2018-12-21T07:52:58,846][INFO ][o.e.n.Node ] [node-1] node name [node-1], node ID [7PcVx8TuRyag_9yoZoM0-Q] [2018-12-21T07:52:58,849][INFO ][o.e.n.Node ] [node-1] version[5.6.1], pid[10546], build[667b497/2017-09-14T19:22:05.189Z], OS[Linux/2.6.32-431.el6.x86_64/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_152/25.152-b16] [2018-12-21T07:52:58,850][INFO ][o.e.n.Node ] [node-1] JVM arguments [-Xms512m, -Xmx512m, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -Djdk.io.permissionsUseCanonicalPath=true, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j.skipJansi=true, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/home/hadoop/install/elasticsearch] [2018-12-21T07:53:07,120][INFO ][o.e.p.PluginsService ] [node-1] loaded module [aggs-matrix-stats] [2018-12-21T07:53:07,121][INFO ][o.e.p.PluginsService ] [node-1] loaded module [ingest-common] [2018-12-21T07:53:07,121][INFO ][o.e.p.PluginsService ] [node-1] loaded module [lang-expression] [2018-12-21T07:53:07,122][INFO ][o.e.p.PluginsService ] [node-1] loaded module [lang-groovy] [2018-12-21T07:53:07,127][INFO ][o.e.p.PluginsService ] [node-1] loaded module [lang-mustache] [2018-12-21T07:53:07,128][INFO ][o.e.p.PluginsService ] [node-1] loaded module [lang-painless] [2018-12-21T07:53:07,128][INFO ][o.e.p.PluginsService ] [node-1] loaded module [parent-join] [2018-12-21T07:53:07,129][INFO ][o.e.p.PluginsService ] [node-1] loaded module [percolator] [2018-12-21T07:53:07,129][INFO ][o.e.p.PluginsService ] [node-1] loaded module [reindex] [2018-12-21T07:53:07,131][INFO ][o.e.p.PluginsService ] [node-1] loaded module [transport-netty3] [2018-12-21T07:53:07,134][INFO ][o.e.p.PluginsService ] [node-1] loaded module [transport-netty4] [2018-12-21T07:53:07,137][INFO ][o.e.p.PluginsService ] [node-1] no plugins loaded [2018-12-21T07:53:24,358][INFO ][o.e.d.DiscoveryModule ] [node-1] using discovery type [zen] [2018-12-21T07:53:30,959][INFO ][o.e.n.Node ] [node-1] initialized [2018-12-21T07:53:30,961][INFO ][o.e.n.Node ] [node-1] starting ... [2018-12-21T07:53:32,819][INFO ][o.e.t.TransportService ] [node-1] publish_address {192.168.13.129:9300}, bound_addresses {192.168.13.129:9300} [2018-12-21T07:53:33,081][INFO ][o.e.b.BootstrapChecks ] [node-1] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks [2018-12-21T07:53:36,643][INFO ][o.e.c.s.ClusterService ] [node-1] new_master {node-1}{7PcVx8TuRyag_9yoZoM0-Q}{Vn8iPoQQRha1a3Ow1ByLYw}{192.168.13.129}{192.168.13.129:9300}, reason: zen-disco-elected-as-master ([0] nodes joined) [2018-12-21T07:53:36,911][INFO ][o.e.h.n.Netty4HttpServerTransport] [node-1] publish_address {192.168.13.129:9200}, bound_addresses {192.168.13.129:9200} [2018-12-21T07:53:36,911][INFO ][o.e.n.Node ] [node-1] started [2018-12-21T07:53:37,077][INFO ][o.e.g.GatewayService ] [node-1] recovered [0] indices into cluster_state