ELK 5.X 安装head 插件
安装node.js
去官网下载nodejs,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:
vi /etc/profile
添加以下内容:
# set node environment
export NODE_HOME=/data2/node-v6.10.0-linux-x64
export PATH=$PATH:$NODE_HOME/bin
使其立即生效:
source /etc/profile
这个时候可以测试一下node是否生效:
echo $NODE_HOME
node -v
npm -v
切换国内镜像
$>npm install -g cnpm --registry=https://registry.npm.taobao.org
$>cd /home/elasticsearch-head
$>npm install
编辑elasticsearch-5.1.1/config/elasticsearch.yml,加入以下内容:
http.cors.enabled: true
http.cors.allow-origin: "*"
修改:elasticsearch-head/Gruntfile.js
新增:hostname: ‘0.0.0.0’,92行附近
到elasticsearch-head目录下执行:
$>grunt server
访问:http://10.10.13.17:9100如下