提示:先将JDK版本升级到1.8以上
https://blog.csdn.net/axin1240101543/article/details/103583217
1、上传ES到linux
2、配置ES用户
useradd es
passwd es
3、将ES复制到/opt目录、解压、赋权
cp elasticsearch-7.4.2-linux-x86_64.tar /opt/
tar xf elasticsearch-7.4.2-linux-x86_64.tar
chown -R es:es elasticsearch-7.4.2
4、配置ES
vi elasticsearch-7.4.2/config/elasticsearch.yml
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
network.host: 192.168.244.11 #本机IP
http.port: 9200 #访问端口
discovery.seed_hosts: ["node01"] #主机名
cluster.initial_master_nodes: ["node01-1"] #主节点
5、配置ES的文件描述符
vi /etc/security/limits.conf
es soft nofile 819200 #es是刚刚添加的用户
es hard nofile 819200
TIPS:不配置可能会报错:
max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
6、配置用户的最大线程数
vi /etc/security/limits.d/90-nproc.conf
es soft nproc 4096 #es是刚刚添加的用户
TIPS:不配置可能会报错:
max number of threads [1024] for user [es] likely too low, increase to at least [4096]
7、配置虚拟内存
vi /etc/sysctl.conf
vm.max_map_count=655360
加载配置
sysctl -p
TIPS:不配置可能会报错
max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [655360]
8、切换用户并启动
su es
./elasticsearch-7.4.2/bin/elasticsearch
测试:http://192.168.244.11:9200/
9、后台启动ES
./elasticsearch-7.4.2/bin/elasticsearch -d