安装elasticsearch-head可视化插件

1.下载资源

# wget  https://github.com/mobz/elasticsearch-head/archive/master.zip

2.解压zip文件

# unzip master.zip

如果提示unzip: command not found 则 # yum install unzip 安装一下

3.进入目录

# cd elasticsearch-head-master/

4.安装grunt-cli

# npm install -g grunt-cli

如果提示npm: command not found 则 # yum install nodejs

5.编译文件

# npm install

# npm install grunt --save-dev

6.查看grunt版本

# grunt -version

7.修改app.js文件

# vi _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://自己的ip:9200";

8.修改es支持跨域

es安装目录下的config/elasticsearch.yml
  

  #增加如下字段
  http.cors.enabled: true
  http.cors.allow-origin: "*"

  9.后台启动head

  grunt server &

猜你喜欢

转载自www.cnblogs.com/pangyangqi/p/11277588.html