centos7 ELK安装head工具
需要安装nodejs 和head
1、nodejs下载安装
创建安装目录
1 2 3 4 5 6 | 在这里,把安装目录放在 /opt/nodejs 中 mkdir -p /opt/nodejs wget https: //nodejs .org /dist/v16 .13.0 /node-v16 .13.0-linux-x64. tar .xz 分两步解压 xz -d node-v16.13.0-linux-x64. tar .xz tar -xvf node-v16.13.0-linux-x64. tar |
设置环境变量
在/etc/profile 文件中加入以下内容:
1 2 | export NODEJS_HOME= /opt/nodejs/node-v16 .13.0-linux-x64 /bin export PATH=$NODEJS_HOME:$PATH |
使环境变量生效 source /etc/profile
测试安装
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | [root@jenkins ~] # node -v v16.13.0 [root@jenkins ~] # npm version { npm: '8.1.0' , node: '16.13.0' , v8: '9.4.146.19-node.13' , uv: '1.42.0' , zlib: '1.2.11' , brotli: '1.0.9' , ares: '1.17.2' , modules: '93' , nghttp2: '1.45.1' , napi: '8' , llhttp: '6.0.4' , openssl: '1.1.1l+quic' , cldr: '39.0' , icu: '69.1' , tz: '2021a' , unicode: '13.0' , ngtcp2: '0.1.0-DEV' , nghttp3: '0.1.0-DEV' } |
2、安装 grunt
elasticsearch-head插件需要使用grunt,以下是安装grunt的命令。
1 | [root@jenkins ~] # npm install -g grunt-cli |
3、下载elasticsearch-head
下载地址:https://github.com/mobz/elasticsearch-head这里,直接点下载zip包。下载的文件为:elasticsearch-head-master.zip
wget https://github.com/mobz/elasticsearch-head/archive/master.zip
解压文件:如果没有unzip命令,使用以下命令安装:
1 2 | unzip elasticsearch- head -master.zip sudo mv elasticsearch- head -master /opt/elasticsearch/elasticsearch-6 .5.3/ |
安装pathomjs
在elasticsearch-head的目录中,运行以下命令进行安装:
1 2 3 | cd /opt/elasticsearch/elasticsearch-6 .5.3 /elasticsearch-head-master/ sudo yum install bzip2 -y npm install |
修改elasticsearch配置
修改elasticsearch中elasticsearch.yml配置文件,增加以下内容:
1 2 3 | http.cors.enabled: true http.cors.allow-origin: "*" http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type |
测试
启动elasticsearch-head:
1 2 3 4 | [elasticsearch@server01 elasticsearch- head ]$ grunt server Running "connect:server" (connect) task Waiting forever... Started connect web server on http: //localhost :9100 |
默认端口为:9100
做一个决定,并不难,难的是付诸行动,并且坚持到底。
分类:
elk
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
2020-11-12 aix开启远程桌面并使用xmanager远程
2020-11-12 nginx出现跨域问题,解决方法