$ brew search elasticsearch
==> Formulae
elasticsearch elasticsearch@2.4 elasticsearch@5.6
# chuangzhang @ ChuangdeMacBook-Pro in ~ [15:06:47]
$ brew install elasticsearch
Updating Homebrew...
==> Downloading https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-6.8.4.tar.gz
######################################################################## 100.0%
==> /usr/local/Cellar/elasticsearch/6.8.4/bin/elasticsearch-keystore create
==> Caveats
Data: /usr/local/var/lib/elasticsearch/
Logs: /usr/local/var/log/elasticsearch/elasticsearch_chuangzhang.log
Plugins: /usr/local/var/elasticsearch/plugins/
Config: /usr/local/etc/elasticsearch/
To have launchd start elasticsearch now and restart at login:
brew services start elasticsearch
Or, if you don't want/need a background service you can just run:
elasticsearch
==> Summary
🍺 /usr/local/Cellar/elasticsearch/6.8.4: 133 files, 103.2MB, built in 23 minutes 49 seconds
cd /usr/local/Cellar/elasticsearch/6.8.4/bin
./elasticsearch