Directadmin面板安装与卸载elasticsearch



CENTOS系统下

安装

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




UBUNTU系统下

安装

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
最后更改: in 2024/05/01 13:30