由于es2.x之后的版本安装head不能像之前那么方便,最近下载了es5.2.2的版本进行部署发现很多问题,记录下
head插件安装 第一步,安装git yum -y install git 之后去head插件官方可以看到head支持5.x的部署 不过需要先下载node,以独立服务的方式运行。
第二部,安装node
去官网下载nodejs,下载64位的,https://nodejs.org/en/download/
下载下来的jar包是xz格式的,一般的linux可能不识别,还需要安装xz
yum -y install xz
然后解压nodejs的安装包:
xz -d node*.tar.xz
tar -xvf node*.tar
解压完node的安装文件后,需要配置下环境变量,编辑/etc/profile,添加
# set node environment
export NODE_HOME=/usr/elk/node-v6.9.1-linux-x64
export PATH=$PATH:$NODE_HOME/bin
source /etc/profile
验证环境变量是否正常:
node -v
nmp -v
第三步,安装head插件
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
npm run start
open http://localhost:9100/
如果启动head之后,发现连接不上es
在elasticsearch.yml配置文件新增:
http.cors.enabled: true
http.cors.allow-origin: "*"
然后重新启动es和head就好了
来源:oschina
链接:https://my.oschina.net/u/146747/blog/2222740