安装elasticsearch-8.5.2
1. 下载
https://www.elastic.co/cn/downloads/elasticsearch
2. 安装
(base) [root@node001 bao]# tar -zxvf elasticsearch-8.5.2-linux-x86_64.tar.gz -C /opt/src
3. 修改配置文件
[root@node001 config]# vim /opt/src/elasticsearch-8.5.2/config/elasticsearch.yml
path.data: /opt/src/elasticsearch-8.5.2/data #数据目录位置
path.logs: /opt/src/elasticsearch-8.5.2/logs #日志目录位置
network.host: 0,0,0,0 #允许任何ip来访问
network.publish_host: node001
ingest.geoip.downloader.enabled: false
xpack.security.enabled: false # 安全配置
xpack.security.enrollment.enabled: false # 安全配置
xpack.security.http.ssl:
enabled: false
keystore.path: certs/http.p12
# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:
enabled: true
verification_mode: certificate
keystore.path: certs/transport.p12
truststore.path: certs/transport.p12
# Create a new cluster with the current node only
# Additional nodes can still join the cluster later
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: Authorization,X-Requested-With,Content-Type,Content-Length
[root@node001 config]# vim /opt/src/elasticsearch-8.5.2/config/jvm.options
-Xms512m
-Xmx512m
[root@node001 config]# vim /etc/security/limits.conf
* hard nofile 65536
* soft nofile 65536
[root@node001 config]# vim /etc/sysctl.conf
vm.max_map_count=262144
4.用户授权
adduser es
passwd es
chown -R es:es /opt/src/elasticsearch-8.5.2/
chmod 770 /opt/src/elasticsearch-8.5.2/
5.启动验证
su es
/opt/src/elasticsearch-8.5.2/bin/elasticsearch -d