windows 10使用metricbeat 7.15收集性能指标数据

1、安装 Metricbeat

官方教程:https://www.elastic.co/guide/en/beats/metricbeat/7.15/metricbeat-installation-configuration.html

1.1、官网下载Metricbeat
1.2、解压后,按以下命令安装
# 进入安装目录,执行install-service-metricbeat.ps1
PowerShell.exe -ExecutionPolicy UnRestricted -File .\install-service-metricbeat.ps1.

执行结果
在这里插入图片描述

1.3、在metricbeat.yml中配置kibana

有域名的配置域名,没有则配IP

# =================================== Kibana ===================================

# Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API.
# This requires a Kibana endpoint configuration.
setup.kibana:

  # Kibana Host
  # Scheme and port can be left out and will be set to the default (http and 5601)
  # In case you specify and additional path, the scheme is required: http://localhost:5601/path
  # IPv6 addresses should always be defined as: https://[2001:db8::1]:5601
  host: "kibana-host:5601"
  # kibana的用户名和密码,如果不配则使用Elasticsearch output里面的
  # username: "my_kibana_user"  
  # password: "{pwd}"
1.4、导入模拟数据(可选)

此步骤加载用于写入Elasticsearch的推荐索引模板,并部署用于在Kibana中可视化数据的示例仪表板。Metricbeat附带了用于解析、索引和可视化数据的预定义模拟数据。要加载这些数据,请执行以下操作:

# windows
metricbeat.exe setup -e

2、收集Elasticsearch指标

官方教程:https://www.elastic.co/guide/en/elasticsearch/reference/7.15/configuring-metricbeat.html

2.1、在Metricbeat 中启用并配置Elasticsearch x-pack模块(如果设置了密码需要该步骤)
# 进入安装目录,执行以下命令
D:\ELK\metricbeat-7.15.0>metricbeat modules enable elasticsearch-xpack
Enabled elasticsearch-xpack

然后配置modules.d/elasticsearch-xpack.yml
在这里插入图片描述
配置如下

- module: elasticsearch
  xpack.enabled: true
  period: 10s
  hosts: ["http://es-node-1-host:9200","http://es-node-2-host:9200"]
  username: "elastic"
  password: "123456"
2.2、在metricbeat.yml配置elasticsearch
# ================================== Outputs ===================================

# Configure what output to use when sending the data collected by the beat.

# ---------------------------- Elasticsearch Output ----------------------------
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["localhost:9200"]

  # Protocol - either `http` (default) or `https`.
  #protocol: "https"

  # Authentication credentials - either API key or username/password.
  #api_key: "id:api_key"
  #username: "elastic"
  #password: "changeme"
2.3、启动metricbeat
# 默认的日志路径:C:\ProgramData\metricbeat\Logs
D:\ELK\metricbeat-7.15.0>net start metricbeat 或双击metricbeat.exe

The metricbeat service was started successfully.
2.4、登录kibana查看

点【Management】-【堆栈监控】
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值