下载node
wget https://npm.taobao.org/mirrors/node/v6.9.5/node-v6.9.5-linux-x64.tar.gz
tar xf node-v6.9.5-linux-x64.tar.gz
添加环境变量
[root@kibana ~]# cat /etc/profile
export NODE_HOME=/root/node-v6.9.5-linux-x64
export PATH=$PATH:${NODE_HOME}/bin
export NODE_PATH=${NODE_HOME}/lib/node_modules
[root@kibana ~]# source /etc/profile
修改npm仓库
npm config set registry https://registry.npm.taobao.org
npm config set disturl https://npm.taobao.org/dist
下载head插件
https://github.com/mobz/elasticsearch-head/archive/master.zip
unzip elasticsearch-head-master.zip
安装grunt
cd elasticsearch-head-master
npm install -g grunt-cli
npm install
修改head插件配置文件
Gruntfile.js 修改
[root@kibana elasticsearch-head-master]# vi Gruntfile.js
90 connect: {
91 server: {
92 options: {
93 port: 9100,
94 base: '.',
95 keepalive: true
96 }
97 }
98 }
99
100 });
_site/app.js 修改
[root@kibana _site]# vi app.js
4354 this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://192.168.19.93:9200";
启动head
cd /root/elasticsearch-head-master
grunt server
修改连接es节点的配置,允许head访问
http.cors.enabled: true
http.cors.allow-origin: "*"