Elasticsearch-6.5.4之MetricBeat学习

MetricBeat

在这里插入图片描述

  • 定期收集操作系统或者应用服务的指标
  • 存储到ElasticSearch中,进行实时的分析
1.1 MetricBeat组成
- Module: 收集对象,mysql, redis, nginx 等
-  Metricset 收集指标的集合, cpu, memory, network 等

1.2 部署与收集系统指标
tar -xvf metricbeat-6.5.4-linux-x86_64.tar.gz
cd metricbeat-6.5.4-linux-x86_64
vim metricbeat.yml
metricbeat.config.modules:
  path: ${path.config}/modules.d/*.yml
  reload.enabled: false
setup.template.settings:
  index.number_of_shards: 1
  index.codec: best_compression
setup.kibana:
output.elasticsearch:
  hosts: ["192.168.40.133:9200","192.168.40.134:9200","192.168.40.135:9200"]
processors:
- add_host_metadata: ~
- add_cloud_metadata: ~
#启动
./metricbeat -e

在elasticsearch里面可以看到相关的数据
在这里插入图片描述

1.3 Module

./metricbeat modules list #查看列表
Enabled:
system #默认启用
Disabled:
aerospike
apache
ceph
couchbase
docker
dropwizard
elasticsearch
envoyproxy
etcd
golang
graphite
haproxy
http
jolokia
kafka
kibana
kubernetes
kvm
logstash
memcached
mongodb
munin
mysql
nginx
php_fpm
postgresql
prometheus
rabbitmq
redis
traefik
uwsgi
vsphere
windows

1.4 Nginx Module配置

在nginx中,需要开启状态查询,才能查询到指标数据。

#重新编译nginx
./configure --prefix=/usr/local/nginx --with-http_stub_status_module
make
make install
./nginx -V #查询版本信息
nginx version: nginx/1.11.6
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC)
configure arguments: --prefix=/usr/local/nginx --with-http_stub_status_module
#配置nginx
vim nginx.conf
location /nginx-status {
stub_status on;
access_log off;
}

开始配置nginx module

#启用redis module
./metricbeat modules enable nginx
#修改redis module配置
vim modules.d/nginx.yml
# Module: nginx
# Docs: https://www.elastic.co/guide/en/beats/metricbeat/6.5/metricbeat-modulenginx.html
- module: nginx
#metricsets:
# - stubstatus
period: 10s
# Nginx hosts
hosts: ["http://192.168.40.133"]
# Path to server status. Default server-status
server_status_path: "nginx-status"
#username: "user"
#password: "secret"
#启动
./metricbeat -e
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值