Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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
@cpsubrian

This comment has been minimized.

Show comment Hide comment
@cpsubrian

cpsubrian Dec 15, 2015

Note to self: I followed this in order to cleanly upgrade from 090 to 2.x and since I had incompatible index mappings I needed to delete all the data before I was able to cleanly start the newer version.

Note to self: I followed this in order to cleanly upgrade from 090 to 2.x and since I had incompatible index mappings I needed to delete all the data before I was able to cleanly start the newer version.

@Yoshyn

This comment has been minimized.

Show comment Hide comment
@Yoshyn

Yoshyn Jan 6, 2016

Same things Here.
To find your data just brew info elasticsearch and check where the data folder is stored.

Yoshyn commented Jan 6, 2016

Same things Here.
To find your data just brew info elasticsearch and check where the data folder is stored.

@mukeshkdangi

This comment has been minimized.

Show comment Hide comment
@mukeshkdangi

mukeshkdangi Feb 29, 2016

Thanks ... nice commands.
All worked well but in my case i installed ES 2.2 and then downgraded to 1.7 and when i do

mukesh@ in ~/Office/intl on master [?$]$ ls -al ~/Library/LaunchAgents  (still shows 2.x ref , how can i remove this ref )

total 40
**lrwxr-xr-x   1 mukesh  staff    38 Feb 26 12:46 *.plist -> /usr/local/opt/elasticsearch21/*.plist**
drwxr-xr-x   7 mukesh  staff   238 Feb 26 16:54 .
drwx------@ 53 mukesh  staff  1802 Oct 30 17:07 ..
-rw-r--r--@  1 mukesh  staff   487 Oct 28 08:40 com.bittorrent.uTorrent.plist
-rw-r--r--   1 mukesh  staff   480 Oct 28 08:39 com.spigot.ApplicationManager.plist
lrwxr-xr-x   1 mukesh  staff    66 Feb 26 16:31 homebrew.mxcl.elasticsearch17.plist -> /usr/local/opt/elasticsearch17/homebrew.mxcl.elasticsearch17.plist
-rw-r--r--@  1 mukesh  staff   677 Oct 30 17:06 org.virtualbox.vboxwebsrv.plist

Thanks ... nice commands.
All worked well but in my case i installed ES 2.2 and then downgraded to 1.7 and when i do

mukesh@ in ~/Office/intl on master [?$]$ ls -al ~/Library/LaunchAgents  (still shows 2.x ref , how can i remove this ref )

total 40
**lrwxr-xr-x   1 mukesh  staff    38 Feb 26 12:46 *.plist -> /usr/local/opt/elasticsearch21/*.plist**
drwxr-xr-x   7 mukesh  staff   238 Feb 26 16:54 .
drwx------@ 53 mukesh  staff  1802 Oct 30 17:07 ..
-rw-r--r--@  1 mukesh  staff   487 Oct 28 08:40 com.bittorrent.uTorrent.plist
-rw-r--r--   1 mukesh  staff   480 Oct 28 08:39 com.spigot.ApplicationManager.plist
lrwxr-xr-x   1 mukesh  staff    66 Feb 26 16:31 homebrew.mxcl.elasticsearch17.plist -> /usr/local/opt/elasticsearch17/homebrew.mxcl.elasticsearch17.plist
-rw-r--r--@  1 mukesh  staff   677 Oct 30 17:06 org.virtualbox.vboxwebsrv.plist

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