1.jdk需要11,系统版本为8:elasticsearch自带jdk,在文件目录下,向bin/elasticsearch加入一行:
export JAVA_HOME=/usr/local/hadoop/elasticsearch-7.9.1/jdk/
2.不能用root用户执行elasticsearch:创建用户elasticsearch
adduser elasticsearch
passwd elasticsearch
chown -R elasticsearch elasticsearch-7.9.1
su elasticsearch
./elasticsearch-7.9.1/bin/elasticsearch -d 后台运行。
3.创建的elasticsearch用户因为能调用的memory和线程数量不足:
vim /etc/security/limits.conf
* soft nofile 65535
* hard nofile 65535
* soft nproc 4096
* hard nproc 4096
vim /etc/sysctl.conf
vm.max_map_count=655360
vim /etc/security/limits.d/90-nproc.conf
* soft nproc 4096
root soft nproc unlimited
* hard nproc 4096
4.浏览器打不开ip:9200:
vim ./elasticsearch-7.9.1/config/elasticsearch.yml
http.cors.enabled: true
http.cors.allow-origin: "*"
network.host: 0.0.0.0cluster.initial_master_nodes: ["node-1"]
service iptables stop 关闭防火墙