部署head监控插件
- 安装node
wget https://npm.taobao.org/mirrors/node/latest-v15.x/node-v15.8.0-linux-x64.tar.gz
tar -xzvf node-v15.8.0-linux-x64.tar.gz -C /usr/local/
cd /usr/local
mv node-v15.8.0-linux-x64 node
cat vim /etc/profile.d/node.sh
export NODE_HOME=/usr/local/node
export PATH=$NODE_HOME/bin:$PATH
source /etc/profile.d/node.sh
node --version #检查node版本号
- 下载head插件
wget https://github.com/mobz/elasticsearch-head/archive/master.zip
unzip –d /usr/local elasticsearch-head-master.zip
- 安装grunt
cd /usr/local/elasticsearch-head-master
yum -y install npm
npm install -g grunt-cli
grunt –-version #检查grunt版本号
- 修改head源码
vi /usr/local/elasticsearch-head-master/Gruntfile.js (95左右)
添加hostname,注意在上一行末尾添加逗号,hostname 不需要添加逗号
vi /usr/local/elasticsearch-head-master/_site/app.js (4360左右)
原本是http://localhost:9200 ,如果head和ES不在同一个节点,注意修改成ES的IP地址
- 下载head必要的文件
wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2
yum -y install bzip2
tar -jxf phantomjs-2.1.1-linux-x86_64.tar.bz2 -C /tmp/
- 运行head
方法一:yum -y install fontconfig
cd /tmp/phantomjs-2.1.1-linux-x86_64/bin
mv phantomjs /usr/bin/
方法二:cd /usr/local/elasticsearch-head-master/
npm install
nohup grunt server &
- 测试
url:http://192.168.24.46:9100/?auth_user=*&auth_password=
es配置文件见:
https://blog.csdn.net/weixin_45717886/article/details/116944391