elasticsearch head插件(5.0及以上版本)

官方参考地址: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/

原文地址:https://www.cnblogs.com/gavinYang/p/11199747.html