windows下安裝ElasticSearch的Head插件

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

(一)從nodejs官網下載nodejs並按步驟安裝。

(二)安裝完成用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/

成功。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章