September 27, 2021 . 4 MIN READ
|
1
|
cat /etc/os-release
|
|
1
2 3 4 |
NAME=“Ubuntu”
VERSION=“18.04.2 LTS (Bionic Beaver)” ID=ubuntu ID_LIKE=debian |
ID_LIKE in this output: The specific method used to shut down and remove Elasticsearch for your server will vary depending on whether the value is fedora or debian.|
1
|
curl http://localhost:9200/_cluster/health?pretty
|
Failed to connect to localhost port... if Elasticsearch is not runningjps command-line tool, including a search of the output for Elasticsearch to specifically check for Elasticsearch JVMs:|
1
|
jps | grep Elasticsearch
|
grep Elasticsearch command.grep Elasticsearch command will include the PID and the name of each service that’s running. To stop these services, use the kill command, specifying the PID of the service you want to kill.grep Elasticsearch command, try a grep command with broader search parameters to locate any active processes that are related to Elasticsearch:|
1
|
ps -ef | grep elas
|
apt-get command-line tool. Using this tool with the remove option will successfully uninstall the Elasticsearch package while retaining any configuration files in the appropriate directories:|
1
|
sudo apt-get remove elasticsearch
|
rpm command can be used with the -e option if the Elasticsearch package was installed with RPM:|
1
|
rpm -e elasticsearch
|
|
1
|
sudo yum remove elasticsearch
|
purge command with the apt-get tool yields similar results to using the remove command. The difference is that purge removes the entire package along with all of its configuration files:|
1
|
sudo apt-get –purge autoremove elasticsearch
|
.deb package on a Debian distribution is by using the dpkg command. Use the following terminal command to uninstall Elasticsearch this way:|
1
|
sudo dpkg –remove elasticsearch
|
dpkg command a second time, adding the --purge option to clear out config files:|
1
|
sudo dpkg –purge elasticsearch
|
dpkg --purge command with an additiona --force-all option will make sure a clean uninstall occurs:|
1
|
sudo dpkg –purge –force-all elasticsearch
|
|
1
2 |
sudo rm -rf /var/lib/elasticsearch/
sudo rm -rf /etc/elasticsearch |
/etc/init.d/elasticsearch directory, though the exact location will vary based on the installed version of Elasticsearch and the version of Linux running on the server.Uninstalling Elasticsearch on Linux doesn’t have to be a difficult task. One key to success is to use the correct commands for the Linux distribution running on the server. Another important step is use the built-in package-management tool or repository that was used to install Elasticsearch in the first place. With these simple strategies, a clean uninstall will be quick and easy.
Resource: https://kb.objectrocket.com/elasticsearch/how-to-uninstall-elasticsearch-on-linux