wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.17.9-x86_64.rpm rpm --install elasticsearch-7.17.9-x86_64.rpm sudo /bin/systemctl enable elasticsearch.service sudo systemctl start elasticsearch.service
systemctl status elasticsearch.service systemctl stop elasticsearch.service systemctl disable elasticsearch.service systemctl daemon-reload rpm -qa | grep elasticsearch rpm -e --nodeps elasticsearch-8.5.2-1.x86_64 rm -rf /etc/elasticsearch rm -rf /var/lib/elasticsearch
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - echo "deb https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-8.x.list sudo apt update sudo apt install elasticsearch sudo systemctl daemon-reload sudo systemctl enable elasticsearch sudo systemctl start elasticsearch
若需要,可自定义参数
sudo nano /etc/elasticsearch/elasticsearch.yml
sudo systemctl stop elasticsearch.service sudo apt-get purge elasticsearch sudo rm -rf /etc/elasticsearch sudo rm -rf /usr/share/elasticsearch sudo rm -rf /var/lib/elasticsearch sudo userdel elasticsearch sudo groupdel elasticsearch sudo rm /etc/apt/sources.list.d/elastic-*.list