elasticsearch版本: 5.6.4node
系統: Mac OS X 10.10.5git
Java: 1.8.0_73github
1、解壓安裝bash
一、準備工做curl
去elasticsearch 官網下載對應的版本 5.6.4jvm
下載對應的中午分詞版本ik 5.6.4elasticsearch
二、解壓配置(默認下載目錄 ~/Downloads)測試
2.1 分別在 elasticsearch-5.6.4/config, elasticsearch-5.6.4/plugins 目錄下建立analysis-ik目錄url
mkdir ~/Downloads/elasticsearch-5.6.4/plugins/analysis-ikspa
mkdir ~/Downloads/elasticsearch-5.6.4/config/analysis-ik
2.2 拷貝文件
cp -rf ~/Downloads/elasticsearch/config/* ~/Downloads/elasticsearch-5.6.4/config/analysis-ik cp -rf ~/Downloads/elasticsearch/plugins/* ~/Downloads/elasticsearch-5.6.4/plugins/analysis-ik
三、測試正常
啓動
~/Downloads/elasticsearch-5.6.4/bin/elasticsearch
檢查
curl -XGET "localhost:9200" curl -XPUT "localhost:9200/index" curl -XPOST "localhost:9200/index/_analyze?pretty=true" -d "我愛北京天安門"
目錄機構
elasticsearch 5.6.4/config/analysis-ik
├── extra_main.dic
├── extra_single_word.dic
├── extra_single_word_full.dic
├── extra_single_word_low_freq.dic
├── extra_stopword.dic
├── IKAnalyzer.cfg.xml
├── main.dic
├── preposition.dic
├── quantifier.dic
├── stopword.dic
├── suffix.dic
└── surname.dic
elasticsearch 5.6.4/plugins/analysis-ik
├── commons-codec-1.9.jar
├── commons-logging-1.2.jar
├── elasticsearch-analysis-ik-5.5.2.jar
├── httpclient-4.5.2.jar
├── httpcore-4.4.4.jar
└── plugin-descriptor.properties
2、brew安裝
# 更新 brew $ brew update # 修改formula $ cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula $ git checkout 5874ac8c8fab69f8a714d643581e489bcb176d92 elasticsearch@5.6.rb # 安裝 $ brew install elasticsearch@5.6 # 查看 $ brew info elasticsearch@5.6 # 鎖定版本, 防止被誤升級 $ brew pin elasticsearch@5.6 # 安裝ik $ cd /usr/local/Cellar/elasticsearch@5.6/5.6.4 $ bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v5.6.4/elasticsearch-analysis-ik-5.6.4.zip
# /usr/local/etc/elasticsearch/elasticsearch.yml cluster.name: 集羣名字 node.name: 節點名 path.data: 數據存儲目錄 path.logs: 日誌存儲目錄 action.auto_create_index: false
# /usr/local/etc/elasticsearch/jvm.options # 指定使用內存 -Xms128m -Xmx128m
# 查看狀態 $ brew services list # 啓動/重啓/中止 $ brew services start elasticsearch@5.6 $ brew services restart elasticsearch@5.6 $ brew services stop elasticsearch@5.6