当前位置: 首页 > news >正文

Metricbeat安装教程——Linux——Metricbeat监控ES集群

Metricbeat安装教程——Linux

一、安装
下载安装包:
官网下载地址:https://www.elastic.co/cn/downloads/beats/metricbeat
上传包到linux 切换到安装目录下
解压:tar -zxvf metricbeat-7.17.1-linux-x86_64.tar.gz
重命名安装文件夹 mv metricbeat-7.17.1-linux-x86_64 metricbeat
cd xxxx(metricbeat安装目录)/metricbeat
二、配置文件修改
注意:冒号后面有个空格,否则会导致配置文件格式错误,启动时报错
1、elasticsearch.yml
设置被监控的ES集群处于可监控状态

PUT _cluster/settings
{"persistent": {"xpack.monitoring.collection.enabled": true}
}

且禁用生产集群默认的 Elasticsearch 指标监控

PUT _cluster/settings
{"persistent": {"xpack.monitoring.elasticsearch.collection.enabled": false}
}

修改后检查结果

GET _cluster/settings

2、
查看已启动模块

./metricbeat modules list

若system 模块已被启动,禁用该模块

./metricbeat modules disable system

启动 elasticsearch-xpack 模块

./metricbeat modules enable elasticsearch-xpack

查看上述配置是否修改成功

./metricbeat modules list

3、elasticsearch-xpack.yml
配置需要监控的ES集群IP:xx.xx.xx.01

cd xxxx(metricbeat安装目录)/metricbeat
cd modules.d
vi elasticsearch-xpack.yml
#设置需要监控的ES集群IP:xx.xx.xx.01
- module: elasticsearchxpack.enabled: trueperiod: 10s   #采集监控数据的间隔时间hosts: ["http://xx.xx.xx.01:9200"]  #被监控的ES节点IPusername: "elastic"  #对应的ES用户名password: "xxxxxx"   #对应的ES密码

4、metricbeat.yml
配置监控数据需要输出到的ES集群IP:xx.xx.xx.02

cd xxxx(metricbeat安装目录)/metricbeat
vi metricbeat.yml
#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:# Array of hosts to connect to.hosts: ["xx.xx.xx.02:9200"] #监控数据输出到的ES集群IP# Protocol - either `http` (default) or `https`.#protocol: "https"# Authentication credentials - either API key or username/password.#api_key: "id:api_key"username: "elastic"       #对应输出的ES集群的用户名password: "xxxxxx"        #对应输出的ES集群的密码

三:启动Metricbeat
1、控制台启动服务

cd xxxx(metricbeat安装目录)/metricbeat
./metricbeat -e

2、后台启动

cd xxxx(metricbeat安装目录)/metricbeat
nohup ./metricbeat & >/dev/null 2>&1

四、判断是否启动成功
1、检查metricbeat进程

ps -ef|grep metricbeat

2、查看kibana
菜单栏拉到最后倒数第二行:Stack Monitoring
点进去,会看到OverView Nodes(显示被监控ES集群的节点数) Indices (显示被监控ES集群的索引数)
点进OverView可总览集群信息,点进Nodes,在Advanced中可查看详细信息
五、停止metricbeat
1、若后台启动,找到对应进程号,直接杀进程即可

ps -ef|grep metricbeat
kill -9 进程号

2、若控制台启动,直接ctrl+c

参考:https://blog.csdn.net/UbuntuTouch/article/details/105134860

http://www.lryc.cn/news/510415.html

相关文章:

  • 一万多字拆解java中——“ 注解 ”的一切(三)(已完结)
  • 记一次rac故障原因分析(虚拟化平台)
  • Vue CLI 3 项目构建
  • 1114 Family Property (25)
  • 详细介绍Sd-WebUI提示词的语法规则
  • document.body为null问题
  • 2024国赛A问题5
  • Kalilinux下MySQL的安装
  • 文件路径与Resource接口详解
  • 极狐GitLab 17.7正式发布,可从 GitLab 丝滑迁移至极狐GitLab【二】
  • 分布式光纤传感|分布式光纤测温|线型光纤感温火灾探测器DTS|DTS|DAS|BOTDA的行业16年的总结【2024年】
  • 存储过程实现多个分类不同计算规则得到对应的分类、月份和款号
  • aj-report本地前后端分离部署运行
  • CSS 过渡动画效果
  • 网络安全 - DOS
  • 【强化学习】Stable-Baselines3学习笔记
  • 前端真实面试题自用
  • vue3和springboot使用websocket通信
  • JS 解构、数组扩展符和模板字符串的常见用法
  • 低代码开源项目Joget的研究——Joget7社区版安装部署
  • Golang 为什么没有注解?
  • Visual Studio Code(VS Code)配置C/C++环境
  • LabVIEW软件开发的未来趋势
  • Node.js 助力前端开发:自动化操作实战
  • HuggingFace peft LoRA 微调 LLaMA
  • 记-编译magisk_v22
  • 前端登录业务
  • 项目2路由交换
  • 易语言 OCR 文字识别
  • 云手机+YouTube:改变通信世界的划时代技术