1.创建用户
groupadd es
useradd -g es es
2.下载安装包
cd /data/soft
wget https://www.oaroad.com/files/elasticsearch-7.4.2-linux-x86_64.tar.gz
tar -xvf elasticsearch-7.4.2-linux-x86_64.tar.gz
mv elasticsearch-7.4.2-linux-x86_64 /data/elasticsearch
chown -R es.es /data/elasticsearch
3.修改配置文件
vim /data/elasticsearch/config/elasticsearch.yml
cluster.name: elasticsearch
node.name: node1
path.data: /data/elasticsearch/data
path.logs: /data/elasticsearch/logs
node.master: true
node.data: true
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
network.host : 172.17.0.6
http.port : 9200
http.cors.enabled: true
http.cors.allow-origin: "*"
cluster.initial_master_nodes: ["node1"]
4.调整内存
vim /data/elasticsearch/config/jvm.options
-Xms512m
-Xmx512m
vim /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
vim /etc/sysctl.conf
vm.max_map_count=655360
sysctl -p
5.启动
vim /data/elasticsearch/run.sh
su - es -c "/data/elasticsearch/bin/elasticsearch -d"
chmod +x vim /data/elasticsearch/run.sh
sh run.sh
6.安装head插件
mkdir -p /data/elasticsearch/head
cd /data/elasticsearch/head
wget https://www.oaroad.com/download/elk/elasticsearch-head-master.tar.gz
tar -xf elasticsearch-head-master.tar.gz
cd elasticsearch-head-master/
yum -y install git
yum install -y nodejs
npm install
npm install -g grunt-cli
npm install phantomjs-prebuilt@2.1.16 --ignore-scripts
grunt server &
评论