下载对应的包
elasticsearch-8.1.1-linux-x86_64.tar.gz
创建es租户
groupadd elasticsearc
useradd elasticsearch -g elasticsearch -p elasticsearch
chmod u+w /etc/sudoers
chmod -R elasticsearch:elasticsearch elasticsearch
修改配置文件
vim /etc/sysctl.conf
vm.max_map_count = 262144
sysctl -p
vim /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc 4096
* hard nproc 4096
修改环境参数
vim elasticsearch/config/elasticsearch.yml
xpack.security.enabled: false
http.cors.enabled: true
http.cors.allow-origin: "*"
path.data: /usr/local/elasticsearch/data
path.logs: /usr/local/elasticsearch/logs
cluster.name: shds
node.name: es2.conf
http.port: 19200
#transport.tcp.port: 19300
#include.type.name: false
network.host: 0.0.0.0
#discovery.seed_providers: file
discovery.seed_hosts: ["10.15.250.240"]
network.publish_host: 10.15.250.240
cluster.initial_master_nodes: ["10.15.250.240"]
node.roles: [data,master,ingest]
启动
su Elasticsearch
./bin/elasticsearch -d