• ELK 使用 metricbeat监控数据


    IP功能版本
    192.168.140.153elk-18.13.4
    192.168.140.153metricbeat8.13.4
    192.168.140.156elk-28.13.4
    192.168.140.156metricbeat8.13.4
    192.168.140.159logstash8.13.4
    192.168.140.159kibana8.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、解压
    1. tar -zxvf metricbeat-8.13.4-linux-x86_64.tar.gz
    2. mv metricbeat-8.13.4 /opt/metricbeat

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

    4、修改配置文件
    1. vi /opt/metricbeat/modules.d/elasticsearch-xpack.yml
    2. # 修改如下
    3. - module: elasticsearch
    4. xpack.enabled: true
    5. period: 10s
    6. hosts: ["https://192.168.140.153:9200"]
    7. username: "elastic"
    8. password: "password"
    9. ssl.enabled: true
    10. ssl.certificate_authorities: ["/opt/es/config/certs/http_ca.crt"]
    11. vi /opt/metricbeat/metricbeat.yml
    12. # =================================== Kibana ===================================
    13. setup.kibana:
    14. host: "192.168.140.153:5601"
    15. protocol: "https"
    16. ssl.certificate_authorities: ["/opt/metricbeat/certs/kibana-server.crt"]
    17. ssl.verification_mode: "none"
    18. ssl.certificate: "/opt/metricbeat/certs/kibana-server.crt"
    19. ssl.key: "/opt/metricbeat/certs/kibana-server.key"
    20. # ---------------------------- Elasticsearch Output ----------------------------
    21. output.elasticsearch:
    22. hosts: ["192.168.140.153:9200"]
    23. preset: balanced
    24. protocol: "https"
    25. username: "elastic"
    26. password: "introcks"
    27. ssl.enabled: true
    28. ssl.certificate_authorities: ["/opt/es/config/certs/http_ca.crt"]

    5、检测配置文件格式
    1. [root@localhost metricbeat]# metricbeat test config
    2. Config OK
    3. [root@localhost metricbeat]# metricbeat test output
    4. elasticsearch: https://192.168.140.153:9200...
    5. parse url... OK
    6. connection...
    7. parse host... OK
    8. dns lookup... OK
    9. addresses: 192.168.140.153
    10. dial up... OK
    11. TLS...
    12. security: server's certificate chain verification is enabled
    13. handshake... OK
    14. TLS version: TLSv1.3
    15. dial up... OK
    16. talk to server... OK
    17. version: 8.13.4
    6、编写启动脚本
    1. [root@localhost metricbeat]# vi /etc/systemd/system/metricbeat.service
    2. [Unit]
    3. Description=Metricbeat service
    4. After=network.target
    5. [Service]
    6. Type=simple
    7. User=root
    8. Group=root
    9. ExecStart=/opt/metricbeat/metricbeat -c /opt/metricbeat/metricbeat.yml
    10. Restart=always
    11. LimitNOFILE=65535
    12. [Install]
    13. WantedBy=multi-user.target

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

    8、测试

  • 相关阅读:
    13.DesignForSip[Apd]\1.DownrevSip[Apd]17.2-17.4to16.6
    「System Design」设计一个支持百万用户的系统
    深度学习基础 - 牛顿法
    51. N 皇后
    元宇宙006 | 你不了解的“养成系”人工智能就此诞生
    2023/9/17总结
    测开 (性能测试)
    两个宝藏|关于我在github上冲浪时的一个小技巧。
    NeurIPS 2023 | AD-PT:首个大规模点云自动驾驶预训练方案
    常用docker命令
  • 原文地址:https://blog.csdn.net/weixin_44295677/article/details/139328453