Skip to content

Instantly share code, notes, and snippets.

@jkubacki
Created January 21, 2015 18:47
Show Gist options
  • Star 51 You must be signed in to star a gist
  • Fork 12 You must be signed in to fork a gist
  • Save jkubacki/e2dd904bd648b0bd4554 to your computer and use it in GitHub Desktop.
Save jkubacki/e2dd904bd648b0bd4554 to your computer and use it in GitHub Desktop.
Mac uninstall elasticsearch
#!/usr/bin/env sh
# checks to see if running
launchctl list | grep elasticsearch
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
launchctl remove homebrew.mxcl.elasticsearch
pkill -f elasticsearch
rm -f ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
brew uninstall elasticsearch
# double check existence
ls -al /usr/local/bin/elasticsearch*
ls -al ~/Library/LaunchAgents
@Curious-p
Copy link

Just wanted to add one more thing after uninstall elasticsearch/logstash/kibana with above commands, please remove those directories from /usr/local/etc and then try to install them from scratch again. Above commands work well to uninstall but without removing ELK directories it will not allow user to reinstall ELK stack properly.

@osazemeu
Copy link

osazemeu commented Dec 28, 2019

I had to remove data, logs, plugins and config for brew elasticsearch to work properly

rm -rf /usr/local/var/lib/elasticsearch/
rm -rf /usr/local/var/log/elasticsearch/elasticsearch_account.log
rm -rf /usr/local/var/elasticsearch/plugins/
rm -rf /usr/local/etc/elasticsearch/

@caporro
Copy link

caporro commented Feb 15, 2022

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment