1.2 下載head外掛
下載地址:https://github.com/mobz/elasticsearch-head;點選clone or download按鈕,點選download zip進行下載。下載完畢後解壓到任意路徑上,別放在elasticsearch安裝路徑

1.3 安裝node.js
這個比較容易,下載後除路徑自己填寫外,其他直接next就OK了。下載地址:https://nodejs.org/en/download/

1.4 安裝grunt
執行head需要藉助grunt命令,因此需要安裝grunt,Windows+R,輸入cmd,輸入命令 cd D:\nodejs(你安裝nodejs的路徑) 進入nodejs的根目錄下,(注意:如果這條命令不能成功執行,那就先執行 D:,成功切換目錄後再執行 cd D:\nodejs(你安裝nodejs的路徑)。),然後執行指令 npm install -g grunt -cli 進行安裝grunt。

1.5 安裝pathomjs
輸入命令 cd D:\head(你安裝head的路徑) 進入head的根目錄下,然後執行命令:
npm install 進行安裝pathomjs
如果速度較慢或者安裝失敗,可以使用國內映象:
npm install -g cnpm --registry=https://registry.npm.taobao.org
複製程式碼

1.6 執行head
最後,什麼都別關,還沒結束呢,在剛剛的命令視窗執行執行命令:
grunt server
啟動head服務,如下所示則為啟動成功。(可以到head根目錄下修改Gruntfile.js檔案的啟動埠,預設是9100
複製程式碼

然後去修改elasticsearch的配置檔案,elasticsearch安裝目錄/config/elasticsearch.yml,開啟檔案後在末端另起一行分別頂格新增如下兩行紅色字型文字,如果沒有就把下面2句話加進去儲存後重啟elasticsearch.bat。圖片是我的elasticsearch配置,提供給你參考下。
1 http.cors.enabled: true 2 http.cors.allow-origin: "*"

1.7 用head訪問elasticsearch
瀏覽器訪問 http://localhost:9100 (head的服務埠),訪問成功後,好好享受吧!!!