官方參考地址:https://github.com/mobz/elasticsearch-head
5.0及以上版本安裝參考地址:http://www.cnblogs.com/jstarseven/p/6036061.html
采用 git + node 的方式,所以安裝前需要先安裝好node,node npm,node grunt,git
node安裝方式參考:http://www.cnblogs.com/starof/p/5194716.html
安裝一下grunt:npm install grunt-cli -g
安裝完成后檢查一下:grunt -version
grunt-cli v1.2.0
grunt v0.4.5
進入到要安裝的head插件的es目錄下,執行下列命令
git clone git://github.com/mobz/elasticsearch-head.git //下載一個elasticsearch-head文件到當前路徑
cd elasticsearch-head
在 elasticsearch.yml 添加下面兩段配置(必須):
http.cors.enabled: true
http.cors.allow-origin: "*"
在 elasticsearch.yml 修改下面兩段配置(非必須)
network.host: 10.127.0.1
http.port: 9200
修改服務器監聽地址 elasticsearch-head/Gruntfile.js
connect: { server: { options: { port: 9100, hostname: '10.127.0.1', base: '.', keepalive: true } } }
修改head連接地址 elasticsearch-head/_site/app.js
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://localhost:9200";
把localhost修改成你es的服務器地址,如:
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://10.127.0.1:9200";
然后在elasticsearch-head目錄中,執行npm install 下載依賴的包:
npm install
最后,啟動nodejs
grunt server
已經配置完成了,訪問 http://10.127.0.1:9100/