1. 程式人生 > >windows下安裝ElasticSearch的Head插件

windows下安裝ElasticSearch的Head插件

cor 重新安裝 literal -c arch ear span -m src

es5以上版本安裝head需要安裝node和grunt(之前的直接用plugin命令即可安裝)

(一)從地址:https://nodejs.org/en/download/ 下載相應系統的msi,雙擊安裝。
技術分享圖片

(二)安裝完成用cmd進入安裝目錄執行 node -v可查看版本號
技術分享圖片

(三)執行 npm install -g grunt-cli 安裝grunt ,安裝完成後執行grunt -version查看是否安裝成功,會顯示安裝的版本號
技術分享圖片

(四)開始安裝head
① 進入安裝目錄下的config目錄,修改elasticsearch.yml文件.在文件的末尾加入以下代碼

http.cors.enabled: true 
http.cors.allow-origin: "*"
node.master: true
node.data: true

然後去掉network.host: 192.168.0.1的註釋並改為network.host: 0.0.0.0,去掉cluster.name;node.name;http.port的註釋(也就是去掉#)

②雙擊elasticsearch.bat重啟es
③在https://github.com/mobz/elasticsearch-head中下載head插件,選擇下載zip
技術分享圖片

④解壓到指定文件夾下,G:\elasticsearch-6.6.2\elasticsearch-head-master 進入該文件夾,修改G:\elasticsearch-6.6.2\elasticsearch-head-master\Gruntfile.js 在對應的位置加上hostname:‘*‘
技術分享圖片

⑤在G:\elasticsearch-6.6.2\elasticsearch-head-master 下執行npm install 安裝完成後執行grunt server 或者npm run start 運行head插件,如果不成功重新安裝grunt。成功如下
技術分享圖片

⑥瀏覽器下訪問http://localhost:9100/
技術分享圖片

成功。

windows下安裝ElasticSearch的Head插件