1. 程式人生 > >elasticsearch常見問題

elasticsearch常見問題

一 ERROR: [1] bootstrap checks failed [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

[2018-10-13T16:44:37,697][INFO ][o.e.n.Node               ] [] initializing ...
[2018-10-13T16:44:38,000][INFO ][o.e.e.NodeEnvironment    ] [MnIMQR8] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [136.3gb], net total_space [147gb], spins? [unknown], types [rootfs]
[2018-10-13T16:44:38,001][INFO ][o.e.e.NodeEnvironment    ] [MnIMQR8] heap size [1.9gb], compressed ordinary object pointers [true]
[2018-10-13T16:44:38,004][INFO ][o.e.n.Node               ] node name [MnIMQR8] derived from node ID [MnIMQR81R6Khffraa64KVw]; set [node.name] to override
[2018-10-13T16:44:38,004][INFO ][o.e.n.Node               ] version[5.5.1], pid[6840], build[19c13d0/2017-07-18T20:44:24.823Z], OS[Linux/3.10.0-327.el7.x86_64/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_181/25.181-b13]
[2018-10-13T16:44:38,005][INFO ][o.e.n.Node               ] JVM arguments [-Xms2g, -Xmx2g, -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=/soft/elasticsearch/elasticsearch-5.5.1]
[2018-10-13T16:44:38,794][INFO ][o.e.p.PluginsService     ] [MnIMQR8] loaded module [aggs-matrix-stats]
[2018-10-13T16:44:38,795][INFO ][o.e.p.PluginsService     ] [MnIMQR8] loaded module [ingest-common]
[2018-10-13T16:44:38,795][INFO ][o.e.p.PluginsService     ] [MnIMQR8] loaded module [lang-expression]
[2018-10-13T16:44:38,795][INFO ][o.e.p.PluginsService     ] [MnIMQR8] loaded module [lang-groovy]
[2018-10-13T16:44:38,795][INFO ][o.e.p.PluginsService     ] [MnIMQR8] loaded module [lang-mustache]
[2018-10-13T16:44:38,795][INFO ][o.e.p.PluginsService     ] [MnIMQR8] loaded module [lang-painless]
[2018-10-13T16:44:38,795][INFO ][o.e.p.PluginsService     ] [MnIMQR8] loaded module [parent-join]
[2018-10-13T16:44:38,795][INFO ][o.e.p.PluginsService     ] [MnIMQR8] loaded module [percolator]
[2018-10-13T16:44:38,795][INFO ][o.e.p.PluginsService     ] [MnIMQR8] loaded module [reindex]
[2018-10-13T16:44:38,795][INFO ][o.e.p.PluginsService     ] [MnIMQR8] loaded module [transport-netty3]
[2018-10-13T16:44:38,795][INFO ][o.e.p.PluginsService     ] [MnIMQR8] loaded module [transport-netty4]
[2018-10-13T16:44:38,796][INFO ][o.e.p.PluginsService     ] [MnIMQR8] no plugins loaded
[2018-10-13T16:44:40,228][INFO ][o.e.d.DiscoveryModule    ] [MnIMQR8] using discovery type [zen]
[2018-10-13T16:44:40,895][INFO ][o.e.n.Node               ] initialized
[2018-10-13T16:44:40,895][INFO ][o.e.n.Node               ] [MnIMQR8] starting ...
[2018-10-13T16:44:41,043][INFO ][o.e.t.TransportService   ] [MnIMQR8] publish_address {10.33.43.9:9300}, bound_addresses {10.33.43.9:9300}
[2018-10-13T16:44:41,053][INFO ][o.e.b.BootstrapChecks    ] [MnIMQR8] bound or publishing to a non-loopback or non-link-local 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]
[2018-10-13T16:44:41,062][INFO ][o.e.n.Node               ] [MnIMQR8] stopping ...
[2018-10-13T16:44:41,105][INFO ][o.e.n.Node               ] [MnIMQR8] stopped
[2018-10-13T16:44:41,105][INFO ][o.e.n.Node               ] [MnIMQR8] closing ...
[2018-10-13T16:44:41,123][INFO ][o.e.n.Node               ] [MnIMQR8] closed

解決辦法:

1、切換到root使用者修改配置sysctl.conf

vi /etc/sysctl.conf 

新增下面配置:

vm.max_map_count=655360

並執行命令:

sysctl -p

然後,重新啟動elasticsearch,即可啟動成功。

二 Elasticsearch6.2 允許遠端訪問

修改配置檔案 config/elasticsearch.yml

network.host: 0.0.0.0

請注意防火牆是否開啟!!!