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、解压
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、测试

  • 4
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值