1)导入存储库的GPG密钥
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
2)将ES存储库添加到源文件
sudo sh -c 'echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" > /etc/apt/sources.list.d/elastic-7.x.list'
3)apt安装ES
sudo apt update sudo apt install elasticsearch
4)启动ES服务并验证是否运行
sudo systemctl enable --now elasticsearch.service curl -X GET "localhost:9200/"2. 控制systemctl
systemctl status elasticsearch systemctl start elasticsearch systemctl stop elasticsearch systemctl restart elasticsearch远程访问
sudo vim /etc/elasticsearch/elasticsearch.yml network.host: 0.0.0.0 discovery.seed_hosts: ["0.0.0.0"] sudo systemctl restart elasticsearch



