ELK 使用 metricbeat监控数据

IP 功能 版本
192.168.140.153 elk-1 8.13.4
192.168.140.153 metricbeat 8.13.4
192.168.140.156 elk-2 8.13.4
192.168.140.156 metricbeat 8.13.4
192.168.140.159 logstash 8.13.4
192.168.140.159 kibana 8.13.4

一、安装ELK

参考文档:

https://download.csdn.net/download/weixin_44295677/89374143?spm=1001.2014.3001.5503icon-default.png?t=N7T8https://download.csdn.net/download/weixin_44295677/89374143?spm=1001.2014.3001.5503

二、安装metricbeat(elastic所在服务器都需要执行)

1、下载metricbeat

可以跟据自己需要选择安装方式(该文档使用tar包安装)

2、解压
tar -zxvf metricbeat-8.13.4-linux-x86_64.tar.gz
mv metricbeat-8.13.4 /opt/metricbeat

3、开启elasticsearch-xpack模块
cd /opt/metricbeat
ln -s /opt/metricbeat/metricbeat /usr/bin/metricbeat
metricbeat modules enable elasticsearch-xpack

4、修改配置文件
vi /opt/metricbeat/modules.d/elasticsearch-xpack.yml
# 修改如下
- module: elasticsearch
  xpack.enabled: true
  period: 10s
  hosts: ["https://192.168.140.153:9200"]
  username: "elastic"
  password: "password"
  ssl.enabled: true
  ssl.certificate_authorities: ["/opt/es/config/certs/http_ca.crt"]


vi /opt/metricbeat/metricbeat.yml
# =================================== Kibana ===================================
setup.kibana:
  host: "192.168.140.153:5601"
  protocol: "https"
  ssl.certificate_authorities: ["/opt/metricbeat/certs/kibana-server.crt"]
  ssl.verification_mode: "none"
  ssl.certificate: "/opt/metricbeat/certs/kibana-server.crt"
  ssl.key: "/opt/metricbeat/certs/kibana-server.key"

# ---------------------------- Elasticsearch Output ----------------------------
output.elasticsearch:
  hosts: ["192.168.140.153:9200"]
  preset: balanced
  protocol: "https"
  username: "elastic"
  password: "introcks"
  ssl.enabled: true
  ssl.certificate_authorities: ["/opt/es/config/certs/http_ca.crt"]

5、检测配置文件格式
[root@localhost metricbeat]# metricbeat test config
Config OK
[root@localhost metricbeat]# metricbeat test output
elasticsearch: https://192.168.140.153:9200...
  parse url... OK
  connection...
    parse host... OK
    dns lookup... OK
    addresses: 192.168.140.153
    dial up... OK
  TLS...
    security: server's certificate chain verification is enabled
    handshake... OK
    TLS version: TLSv1.3
    dial up... OK
  talk to server... OK
  version: 8.13.4
6、编写启动脚本
[root@localhost metricbeat]# vi /etc/systemd/system/metricbeat.service
[Unit]
Description=Metricbeat service
After=network.target

[Service]
Type=simple
User=root
Group=root
ExecStart=/opt/metricbeat/metricbeat -c /opt/metricbeat/metricbeat.yml
Restart=always
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target

7、启动服务
systemctl daemon-reload
systemctl start metricbeat.service
systemctl enable metricbeat.service

8、测试

相关推荐

  1. MetricBeat监控Redis

    2024-06-07 04:42:04       58 阅读
  2. 数据库监控监听

    2024-06-07 04:42:04       38 阅读
  3. ELK架构监控MySQL慢日志

    2024-06-07 04:42:04       60 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-06-07 04:42:04       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-06-07 04:42:04       100 阅读
  3. 在Django里面运行非项目文件

    2024-06-07 04:42:04       82 阅读
  4. Python语言-面向对象

    2024-06-07 04:42:04       91 阅读

热门阅读

  1. 023、键管理_数据库

    2024-06-07 04:42:04       27 阅读
  2. dubbo服务调用过程

    2024-06-07 04:42:04       28 阅读
  3. 数据计算的基本模式与范式

    2024-06-07 04:42:04       30 阅读
  4. matlab计算图像信噪比SNR

    2024-06-07 04:42:04       32 阅读
  5. 待定待定待定

    2024-06-07 04:42:04       35 阅读
  6. 原生js访问http获取数据的方法

    2024-06-07 04:42:04       27 阅读
  7. CSS中z-index不生效的原因和解决办法

    2024-06-07 04:42:04       32 阅读
  8. 21data 数据可视化

    2024-06-07 04:42:04       35 阅读
  9. Python 设计模式(行为型)

    2024-06-07 04:42:04       23 阅读
  10. 【设计模式】单例模式(创建型)⭐⭐⭐

    2024-06-07 04:42:04       29 阅读
  11. 完全背包(从二维数组到一维滚动数组)

    2024-06-07 04:42:04       29 阅读
  12. [高频]Linux中常见的命令及常见面试题

    2024-06-07 04:42:04       36 阅读
  13. 使用redis的setnx实现分布式锁

    2024-06-07 04:42:04       34 阅读