Mac 安裝 Elasticsearch5.6

社會主義接班人發表於2020-03-10
  • 更新brew
brew update
  • 查詢es版本
brew search elasticsearch
  • 安裝
brew install elasticsearch@5.6

這裡需要依賴java8

 brew cask install homebrew/cask-versions/adoptopenjdk8

這裡下載 OpenJDK8U-jdk_x64_mac_hotspot_8u242b08.pkg,用命令很慢,可以直接開啟網址下載然後安裝,和安裝微信一樣。安裝成功會出現下面提示:

Data:    /usr/local/var/elasticsearch/elasticsearch_apple/
Logs:    /usr/local/var/log/elasticsearch/elasticsearch_apple.log
Plugins: /usr/local/opt/elasticsearch@5.6/libexec/plugins/  #這是外掛目錄
Config:  /usr/local/etc/elasticsearch/ #這是配置目錄
plugin script: /usr/local/opt/elasticsearch@5.6/libexec/bin/elasticsearch-plugin

elasticsearch@5.6 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.

If you need to have elasticsearch@5.6 first in your PATH run:
  echo 'export PATH="/usr/local/opt/elasticsearch@5.6/bin:$PATH"' >> ~/.zshrc

To have launchd start elasticsearch@5.6 now and restart at login:
  brew services start elasticsearch@5.6
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/elasticsearch@5.6/bin/elasticsearch

/usr/local/Cellar/elasticsearch@5.6/5.6.16: 106 files, 36.0MB, built in 49 seconds
  • 安裝Kibana
brew search kibana 
brew install kibana@5.6

成功會出現 如下提示

Config: /usr/local/etc/kibana/
If you wish to preserve your plugins upon upgrade, make a copy of
/usr/local/opt/kibana/plugins before upgrading, and copy it into the
new keg location after upgrading.
To have launchd start kibana now and restart at login:
  brew services start kibana
  • 安裝analysis-ik
 /usr/local/Cellar/elasticsearch@5.6/5.6.16/bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v5.6.16/elasticsearch-analysis-ik-5.6.16.zip 

elasticsearch-plugin list 檢視安裝的外掛列表
elasticsearch-plugin install 安裝外掛
elasticsearch-plugin remove 移除

  • 安裝analysis-pinyin
 /usr/local/Cellar/elasticsearch@5.6/5.6.16/bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-pinyin/releases/download/v5.6.16/elasticsearch-analysis-pinyin-5.6.16.zip

github 下載很慢,可以先把安裝包下載下來 放在一個可以下載地方 ,比如:

➜  bin elasticsearch-plugin install http://la.knowledge-base.test/elasticsearch-analysis-pinyin-5.6.16.zip
本作品採用《CC 協議》,轉載必須註明作者和本文連結

相關文章