Elasticsearch 5.4.3实战--插件安装

elasticsearch 5.0以后的版本对head的插件支持跟以前不同,安装方法如下:

 1. 安装node
$ tar -zxvf node-v8.1.3-linux-x64.tar.gz
 
$ vim /etc/profile
追加: export PATH=$PATH:/opt/node-v4.4.7-linux-x64/bin 至文件最后
保存退出
$  source /etc/profile    保证修改生效
 
2. 用npm安装grunt
 
$ npm install -g grunt-cli
$ npm install grunt --save-dev
 
可用 grunt -version 查看版本号
 
3. 安装head插件, 需要去github下载源代码,然后编译
$ git clone git://github.com/mobz/elasticsearch-head.git
$ cd elasticsearch-head
$ npm install
$ npm install grunt --save
 
4. 修改elasticsearch的配置
$ cd ./elasticsearch-5.4.3/config
$ vim elasticsearch.yml       末尾加入如下内容:

  #added for head plugin
  http.cors.enabled: true
  http.cors.allow-origin: "*"

保存退出后,重启es服务
 
5. 启动head插件文件Gruntfile.js
$ vim Gruntfile.js      修改的内容如图:
 

我搭建的是单节点的es集群,所以就设置了一个
 
6. 启动Head 插件
$ nohup grunt server &
 
7. 浏览器访问: http://192.168.0.124:9100/
原文地址:https://www.cnblogs.com/cs99lzzs/p/7212206.html