导入 Elasticsearch 的公钥
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
安装 apt-transport-https 包
sudo apt-get install apt-transport-https
添加 Elasticsearch 的源列表
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
更新 apt 包索引
sudo apt-get update
安装 Elasticsearch
sudo apt-get install elasticsearch
启动并设置 Elasticsearch 在开机时启动
sudo systemctl start elasticsearch
sudo systemctl enable elasticsearch