elasticsearch-head安装
1.node安装
1.1node下载
官网: https://nodejs.org/en/download/
wget https://nodejs.org/dist/v10.16.3/node-v10.16.3-linux-x64.tar.xz
1.2 解压
tar -xJf node-v10.16.3-linux-x64.tar.xz
1.3配置环境变量
vi /etc/profile
export NODE_HOME=/opt/elk/elasticsearch-head/node-v10.16.3-linux-x64
tar -xJf node-v10.16.3-linux-x64.tar.xz
export PATH=$PATH:$NODE_HOME/bin
source /etc/profile
1.4 验证
[root@pt-docker3 node-v10.16.3-linux-x64]# node -v
v10.16.3
[root@pt-docker3 node-v10.16.3-linux-x64]# npm -v
6.9.0
2.head插件的安装与配置
2.1 安装git插件
yum install -y git
2.2 验证git插件是否安装成功
git --version
2.3 下载并安装head插件
github地址: https://github.com/mobz/elasticsearch-head
#解压bz2后缀文件时需要
yum install bzip2
git clone https://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
npm run start
open http://localhost:9100/
npm install -g grunt-cli
grunt server
open http://localhost:9100/
问题:elasticsearch-head中添加elasticsearch连接失败
在elasticsearch.yml添加下面配置,并重启
http.cors.enabled: true
http.cors.allow-origin: "*"