https://www.elastic.co/downloads/elasticsearch
1、下載
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.1.tar.gz
或者從其他機器copy
scp -r root@ip:/usr/local/elasticsearch-6.2.1.tar.gz /usr/local/elasticsearch-6.2.1.tar.gz
2、解壓
tar -zxvf elasticsearch-6.2.1.tar.gz
3、啓動
./bin/elasticsearch
啓動用戶必須是非root 用戶啓動
1)創建用戶組(新增 es 用戶組)
groupadd es
2)給用戶組添加用戶(#新增es用戶 -g添加用戶到es組 -p設置密碼es )
useradd es -g es -p es
3)root 用戶賬戶下將 elasticsearch 路徑授權給 es 用戶
chown -R es:es ../elasticsearch-6.2.1
4)es 用戶啓動
./bin/elasticsearch
or
./bin/elasticsearch -d (後臺啓動)
or
su es && cd /data/elasticsearch/bin && ./elasticsearch -d (後臺運行)