下载
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.4.2.zip
建立elsearch用户和组
# es不能以root用户启动,需新建用户
groupadd elsearch
# 建立组
useradd elsearch -g elsearch
移至elsearch用户home目录并解压
mv elasticsearch-6.4.2.zip /home/elsearch/
unzip elasticsearch
变更文件所属用户
chown -R elsearch:elsearch elasticsearch
切换用户
su - elsearch
变更网络设置,默认只允许本机连接
vim elasticsearch/config/elasticsearch.yml
network.host: 0.0.0.0
启动
# 普通启动
./bin/elasticsearch
# 守护进程启动
./bin/elasticsearch -d