对于elasticsearch5.x ————site plugins are not supported. Run elasticsearch-head as a standalone server
就是说不支持直接安装head插件,需要启动一个服务
git clone https://github.com/mobz/elasticsearch-head.git
移动目录
mv elasticsearch-head /usr/elkb/head
chmod 777 /usr/elkb/head
安装node
https://nodejs.org/dist/v6.9.1/node-v6.9.1-linux-x64.tar.xz
xz -d node-v6.9.1-linux-x64.tar.xz
tar -xvf node-v6.9.1-linux-x64.tar
mv node-v6.9.1-linux-x64 /usr/node
设置环境变量gedit /etc/bash.bashrc
export NODE_HOME=/usr/node
export PATH=$PATH:$NODE_HOME/bin
source /etc/profile
node -v
安装grunt
npm install -g grunt-cli --registry=https://registry.npm.taobao.org
修改head源码head/Gruntfile.js
connect: {
server: {
options: {
port: 9100,
hostname: '*', //增加这一条
base: '.',
keepalive: true
}
}
}
head的连接地址设置:head/_site/app.js
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://localhost:9200";
在head目录下npm install --registry=https://registry.npm.taobao.org
碰到phantomjs包下不下来,先下好包然后放到tmp/phantomjs下
chmod 777 phantomjs
启动head
grunt server
最后设置一下elasticsearch.yml让head访问到es
http.cors.enabled: true
http.cors.allow-origin: "*"
小心空格报错http://www.jianshu.com/p/b25d00305d7a