Skip to content

Instantly share code, notes, and snippets.

@evgeniy-trebin
Last active September 21, 2022 22:39
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save evgeniy-trebin/02fafdf03c18df4e03a4eaee1b939f11 to your computer and use it in GitHub Desktop.
Save evgeniy-trebin/02fafdf03c18df4e03a4eaee1b939f11 to your computer and use it in GitHub Desktop.
How to install specific version of elasticsearch via brew
brew tap homebrew/versions
brew cask install java
brew search elasticsearch
brew install elasticsearch@2.3
brew services start elasticsearch@2.3
@sahaynishant342
Copy link

Seems to be out of date. The first command: brew tap homebrew/versions gives following error:
Error: homebrew/versions was deprecated

@deshetti
Copy link

deshetti commented Aug 13, 2018

You could still run the following to get the versions of available elasticsearch:

brew search elasticsearch

Based on the elasticsearch versio you would like to install, you could install and start/stop the services with the following commands:

brew install elasticsearch@5.6
brew services start elasticsearch@5.6
brew services stop elasticsearch@5.6

@zhisme
Copy link

zhisme commented May 7, 2019

and then you will need to run brew link otherwise it will NOT be seen by other software.
I assume you want to install it as a part of some system.

@Overload119
Copy link

Note: As of Aug 8 2020 I'm only seeing elasticsearch @6 with brew search elasticsearch

@adamthedeveloper
Copy link

@Overload119 > Note: As of Aug 8 2020 I'm only seeing elasticsearch @6 with brew search elasticsearch

Did you figure out how to get V5.x?

@gustiando
Copy link

gustiando commented Aug 31, 2020

Same issue as @Overload119 and @adamthedeveloper. was anyone able to figure out how to install an older version?

@BaronSam3di
Copy link

To get around this I had to go to the Elasticsearch version page I was looking for (might be differnt from yours) (version 5.6.16 ) and run a curl command to get it on a Ubuntu 18.04

curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.16.tar.gz

Happy elastisiseing ❤️

@Overload119
Copy link

Yup I manually got it from the Elasticsearch page.

@Sandy381
Copy link

Sandy381 commented Jul 21, 2021

I tried to install an older version from command:
apple$ brew install elastic/tap/elasticsearch-full@7.11.1

However it returns an error:
Warning: No available formula or cask with the name "elastic/tap/elasticsearch-full@7.11.1". Did you mean elastic/tap/elasticsearch-full?
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.

If I do:
brew search elasticsearch

It gives me existing versions in brew:
elastic/tap/elasticsearch-full ✔ elasticsearch@6
elasticsearch

Any solution on how to install older version of elasticsearch on MAC? Can we put an older version of Elasticsearch in brew through some package?

@xofred
Copy link

xofred commented Aug 27, 2021

From the experiences of our company( big credit to our new college! ), the following should work:

  1. Update brew
  brew update
  1. Modify formula
  cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
  git checkout 5874ac8c8fab69f8a714d643581e489bcb176d92 elasticsearch@5.6.rb
  1. Install elasticsearch@5.6
  brew install openjdk@8
  brew install elasticsearch@5.6

If you see the following error

Error: elasticsearch@5.6: Unsupported special dependency :java

Remove or comment this line( around line 15) from elasticsearch@5.6.rb

depends_on :java => "1.8+"
  1. Check version
  brew info elasticsearch@5.6
  1. Pin version
  brew pin elasticsearch@5.6

@AddisonDunn
Copy link

This worked well for me, thanks @xofred!

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