|# 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|
Thanks ... nice commands.
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.
I had to remove data, logs, plugins and config for brew elasticsearch to work properly
rm -rf /usr/local/var/lib/elasticsearch/