安裝node
brew install node
下載插件并安裝
插件主頁:https://github.com/mobz/elasticsearch-head
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
安裝完成后在elasticsearch-head/node_modules目錄下會出現grunt文件。
如果沒有grunt二進制程序,需要執(zhí)行
cd elasticsearch-head
npm install grunt --save
修改服務器監(jiān)聽地址
修改elasticsearch-head下Gruntfile.js文件,默認監(jiān)聽在127.0.0.1下9200端口
圖片.png
修改連接地址
cd elasticsearch-head/_site
vim app.js
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://localhost:9200";
重新運行npm install(此處是否一定需要重新運行,尚不確定)
啟動服務
elasticsearch-head/node_modules/grunt/bin/grunt server &
圖片.png
集群健康值:顯示“未連接”
解決方案:
vim $ES_HOME$/config/elasticsearch.yml
增加如下字段
http.cors.enabled: true
http.cors.allow-origin: "*"
重啟es,并刷新head頁面,發(fā)現已經可以連接上:
圖片.png
圖片.png
其他注意事項:
目前es5.5版本貌似與java9版本不兼容,使用jdk8可以運行es。