配置文件
#egrep -v "#|^$" /apps/usr/elasticsearch/config/elasticsearch.ymlcluster.name: elknode.name: elk-112node.master: truenode.data: truepath.data: /home/opt/elasticsearch/datapath.logs: /home/opt/elasticsearch/logsbootstrap.memory_lock: trueindices.fielddata.cache.size: 50mbnetwork.host: 0.0.0.0http.port: 9200discovery.zen.ping.unicast.hosts: ["10.8.18.30:9300","10.8.18.31:9300","10.8.18.32:9300"]discovery.zen.minimum_master_nodes: 3http.cors.enabled: truehttp.cors.allow-origin: "*"http.cors.allow-headers: "X-Requested-With,Content-Type, Content-Length, Authorization"
内核调整
# 修改文件限制 /etc/security/limits.conf, memlock 最大锁定内存地址空间elasticsearch soft memlock unlimitedelasticsearch hard memlock unlimitedelasticsearch soft nofile 65536elasticsearch hard nofile 131072# 修改用户的进程限制 /etc/security/limits.d/20-nproc.conf *          soft    nproc     4096root       soft    nproc     unlimited# /etc/sysctl.conf # 修改最大打开文件描述符数,建议修改为655360或者更高fs.file-max=655360# 直接影响java线程数量,用来限制一个进程可以用于VM(虚拟内存区域大小)默认为65530,建议修改为262144或者更高vm.max_map_count=262144#系统调整后执行$ sysctl -p
报错
虚拟内存不足
#最大虚拟内存区域vm.max_map_count[65530]太低,至少增加到[262144][1] bootstrap checks failed[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]#调整#fs.file-max=655360#vm.max_map_count=262144#sysctl -p
创建node环境错误
java.lang.IllegalStateException: Failed to create node environment        at org.elasticsearch.node.Node.<init>(Node.java:298) ~[elasticsearch-6.6.2.jar:6.6.2]        at org.elasticsearch.node.Node.<init>(Node.java:265) ~[elasticsearch-6.6.2.jar:6.6.2]        at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:212) ~[elasticsearch-        ......        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) [elasticsearch-6.6.2.jar:6.6.2]Caused by: java.nio.file.AccessDeniedException: /home/opt/data/elasticsearch/nodes
plugin目录无法加载插件
Could not load plugin descriptor for plugin directory [head]
删除head即可
主节点不足
[elfk-112] not enough master nodes discovered during pinging#discovery.zen.minimum_master_nodes: 1