使用YUM安装Elasticsearch(centos7以上)
1.执行
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
2.打开vim
vim /etc/yum.repos.d/elasticsearch.repo
3. 粘贴
[elasticsearch] name=Elasticsearch repository for 7.x packages baseurl=https://artifacts.elastic.co/packages/7.x/yum gpgcheck=1 gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch enabled=0 autorefresh=1 type=rpm-md
4.执行
yum install --enablerepo=elasticsearch elasticsearch
或者
dnf install --enablerepo=elasticsearch elasticsearch
5.运行
systemctl start elasticsearch
开机自启动
systemctl enable elasticsearch