kibana监控

采取方式

Elastic Agent :更完善的功能

Metricbeat:轻量级指标收集(采用)

传统收集方法:使用内部导出器收集指标,已不建议

安装 metricbeat

Download Metricbeat • Ship Metrics to Elasticsearch | Elastic

解压

复制代码
tar xzvf metricbeat-8.7.0-linux-x86_64.tar.gz

监控es

详细步骤

启动 elasticsearch-xpack

复制代码
cd metricbeat-8.7.0-linux-x86_64/
./metricbeat modules enable elasticsearch-xpack

配置 elasticsearch-xpack

复制代码
cd modules.d
vim elasticsearch-xpack.yml

改为如下内容:

复制代码
module: elasticsearch
  xpack.enabled: true
  period: 10s
  hosts: ["http://10.7.176.72:9200","http://10.7.176.73:9200","http://10.7.176.74:9200"]
  username: "elastic"
  password: "Mvwm@n12nal"

配置 metricbeat.yml (重点)

复制代码
cd ..
vim metricbeat.yml

output.elasticsearch:
  hosts: ["http://10.7.176.72:9200","http://10.7.176.73:9200","http://10.7.176.74:9200"]
  username: "elastic"
  password: "Mvwm@n12nal"

启动 metricbeat

复制代码
# 前台启动
./metricbeat -e
# 后台启动
nohup ./metricbeat -e -c metricbeat.yml -d "publish" & > nohup.out

关闭跨集群监控(重要)

复制代码
# 关闭跨集群监控,否则堆栈监控页面打不开(因为角色中不包含某个跨集群的角色,可能需要自己新建)
monitoring.ui.ccs.enabled: false

大功告成!!撒花

遇到的坑

如果部署的是集群,但是只在主节点部署 Metricbeat 测试,必须要在es的host那里写入所有节点,写单节点就怎么也打不开

参考文档

官网

使用Elasticsearch + Kibana快速搭建监控看板

windows下kibana使用metricbeat教程

ELK下kibana安装Metricbeat工具

监控 logstash

详细步骤

启动 Logstash

创建 Created Logstash keystore

复制代码
cd ~/logstash-8.7.0
./bin/logstash-keystore create

创建一些 key: ES_HOST 及 ES_PWD

复制代码
./bin/logstash-keystore add ES_HOST
输入:"http://10.7.176.72:9200","http://10.7.176.73:9200","http://10.7.176.74:9200"
./bin/logstash-keystore add ES_PWD
输入:Mvwm@n12nal

设置 logstash.yml

复制代码
cd ~/logstash-8.7.0/config/
vim logstash.yml

xpack.monitoring.enabled: true
xpack.monitoring.elasticsearch.username: logstash_system
xpack.monitoring.elasticsearch.password: "${ES_PWD}"
xpack.monitoring.elasticsearch.hosts: ["${ES_HOST}"]

修改 logstash_system 的密码 为 Mvwm@n12nal

启动 logstash-xpack 模块

复制代码
 cd ~/metricbeat-8.7.0-linux-x86_64/
./metricbeat modules enable logstash-xpack
复制代码
./metricbeat modules list
# 关闭不要的模块
# ./metricbeat modules disable system

配置 modules.d/logstash.yml 文件(略)

复制代码
cd modules.d/

重启 metricbeat (logstash的那台机器)

复制代码
ps -ef | grep metricbeat
kill 13874
回到bin目录
cd ~/es-8.7.0/bin/
nohup ./elasticsearch &
tail -f nohup.out
# 前台启动
./metricbeat -e
# 后台启动
nohup ./metricbeat -e -c metricbeat.yml -d "publish" & > nohup.out

待定:启动失败,推测logstash没启动

参考文档

Logstash:使用 Metricbeat 监控 Logstash

Logstash: 启动监控及集中管理

相关推荐
开开心心就好18 小时前
轻量级PDF阅读器,仅几M大小打开秒开
linux·运维·服务器·安全·pdf·1024程序员节·oneflow
学传打活4 天前
【边打字.边学昆仑正义文化】_12_生命价值的体现(1)
微信公众平台·1024程序员节·汉字·昆仑正义文化
开开心心就好5 天前
小巧绿色免费关机工具,支持定时倒计时
linux·运维·服务器·安全·powerpoint·1024程序员节·foxmail
开开心心就好7 天前
跨平台高速下载工具,支持浏览器功能强大
运维·服务器·windows·pdf·旅游·媒体·1024程序员节
开开心心就好24 天前
内存清理软件灵活设置,自动阈值快捷键清
运维·服务器·windows·pdf·harmonyos·risc-v·1024程序员节
学传打活25 天前
【边打字.边学昆仑正义文化】_5_宇宙物种创造简史(1)
微信公众平台·1024程序员节·汉字·昆伦正义文化
xcLeigh1 个月前
打破机房围墙:VMware+cpolar构建跨网络虚拟实验室
vmware·内网穿透·cpolar·实验室·远程访问·1024程序员节
开开心心就好1 个月前
免费轻量电子书阅读器,多系统记笔记听书
linux·运维·服务器·安全·ddos·可信计算技术·1024程序员节
unable code1 个月前
流量包取证-大流量分析
网络安全·ctf·misc·1024程序员节·流量包取证