elasticsearch5.0版本的head安装

elasticsearch5.0版本由于刚出不久,并且与2.0版本的差距较大。所以,目前大家对5.0的一些使用还有所陌生。这里先把关于head插件的方法写一下,也算是自己的一个记录。
Linux下 head安装。
1.在https://github.com/mobz/elasticsearch-head下,下载head包,并将其上传至服务器。
(也可以使用Git下载:
git clone git://github.com/mobz/elasticsearch-head.git

2.解压elasticsearch-head-master.zip 包
unzip elasticsearch-head-master.zip
并进入当前目录
cd elasticsearch-head-master
3.下载Node.js
wget https://nodejs.org/dist/v4.6.1/node-v4.6.1-linux-x64.tar.gz
亦或者去https://nodejs.org/dist/下找到相应版本和位数的包上传至linux进行解压
4.在解压的目录node-v4.6.1-linux-x64里面有一个bin目录,将其配置进环境变量。
如:vim /etc/profile
在最后的位置,将
export PATH=/data/elasticsearch/node-v4.6.1-linux-x64/bin:$PATH 配置进去
退出之后,再source /etc/profile,使配置文件生效。
5.在 elasticsearch-head-master目录下进行npm install 使用node.js安装。
提示:因为node默认使用的国外镜像。在未代理的情况下会比较慢,所以推荐重定向镜像,如:
npm install -g cnpm --registry=https://registry.npm.taobao.org
6.安装grunt
npm install –g grunt–cli
安装完成之后,在启动grunt之前得先进行一些设置。
打开Gruntfile.js,并编辑

在里面加入一句hostname:'0.0.0.0', 注意:必须使用单引号,且使用0.0.0.0,使其可以通过所有地址访问
之后,还得修改elsearch的elasticsearch.yml,在network下加入
http.host: 192.168.10.253
http.cors.enabled: true
http.cors.allow-origin: "*"

原文地址:https://www.cnblogs.com/isenhome/p/6445715.html