环境:
window10
jdk11
目录
metricbeat为轻量型指标采集器,用于从系统和服务收集指标。Metricbeat 能够以一种轻量型的方式,输送各种系统和服务统计数据,从 CPU 到内存、 Redis、Nginx等等。
一、配置
metricbeat模块module
metricbeat也有很多module,需要收集哪个module的信息,即启动该module即可,命令与Filebeat类似
## 查module列表
metricbeat modules list
## 启用module
metricbeat modules enable 模块名
## 禁用module
metricbeat modules disable 模块名
采集系统指标输出到es
启用system模块
metricbeat modules enable system
修改metricbeat.yml
metricbeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: falsesetup.template.settings:
index.number_of_shards: 1
index.codec: best_compression
# #_source.enabled: falseoutput.elasticsearch:
hosts: ["http://localhost:9200"]
logging.level: debug# Kibana
setup.kibana:
http://localhost:5601/path
host: "192.168.1.90:5601"
采集es指标输出到es
启用elasticsearch模块
metricbeat modules enable elasticsearch
修改metricbeat.yml
metricbeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: falsesetup.template.settings:
index.number_of_shards: 1
index.codec: best_compressionoutput.elasticsearch:
hosts: ["http://localhost:9200"]
logging.level: debug# Kibana
setup.kibana:
http://localhost:5601/path
host: "192.168.1.90:5601"
输出到Logstash
注释Elasticsearch Output,取消注释Logstash Output
output.logstash:
hosts: ["localhost:5044"]
二、运行
cmd运行
metricbeat -e