参考地址:https://www.elastic.co/guide/en/elasticsearch/reference/7.9/brew.html


第一步:设置Elasticsearch在brew上的地址

  1. brew tap elastic/tap

第二步:安装Elasticsearch最新版

  1. brew install elastic/tap/elasticsearch-full

安装完成之后的目录结构如下:

Type Description Default Location Setting
home Elasticsearch home directory or $ES_HOME /usr/local/var/homebrew/linked/elasticsearch-full
bin Binary scripts including elasticsearch to start a node and elasticsearch-plugin to install plugins /usr/local/var/homebrew/linked/elasticsearch-full/bin
conf Configuration files including elasticsearch.yml /usr/local/etc/elasticsearch [ES_PATH_CONF](https://www.elastic.co/guide/en/elasticsearch/reference/7.9/settings.html#config-files-location)
data The location of the data files of each index / shard allocated on the node. Can hold multiple locations. /usr/local/var/lib/elasticsearch path.data
logs Log files location. /usr/local/var/log/elasticsearch path.logs
plugins Plugin files location. Each plugin will be contained in a subdirectory. /usr/local/var/homebrew/linked/elasticsearch/plugins

安装完成之后记得设置相关配置: