1、安装open-jdk
sudo apt-get install openjdk-8-jdk
2、官网查找需要的es版本
es官网:https://www.elastic.co/cn/downloads/elasticsearch
点击如下图【apt-get】
查找自己想要的版本,点击使用deb方式安装,如下图:
3、安装es-7.6.2
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.8.0-amd64.deb wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.8.0-amd64.deb.sha512 shasum -a 512 -c elasticsearch-7.8.0-amd64.deb.sha512 sudo dpkg -i elasticsearch-7.8.0-amd64.deb
4、修改配置文件elasticsearch.yml
vi /etc/elasticsearch/elasticsearch.yml
5、启动es
systemctl enable elasticsearch.service #设置es开机自启动 sudo systemctl start elasticsearch.service #启动es sudo systemctl stop elasticsearch.service #停止es #查看es运行状态 service elasticsearch status #查看报错日志 tail -f /var/log/elasticsearch/elasticsearch.log
6、检查是否运行正常
curl localhost:9200
如下图:安装启动正常