prometheus监控kafka

kafka_exporter下载地址:https://github.com/danielqsj/kafka_exporter/releases/download/v1.2.0/kafka_exporter-1.2.0.linux-amd64.tar.gz

1.1 安装kafka_exporter

tar -xvf kafka_exporter-1.2.0.linux-amd64.tar.gz -C /usr/local
cd /usr/local
mv kafka_exporter-1.2.0.linux-amd64 kafka
vim /etc/systemd/system/kafka_exporter.service

1.2 配置system管理

[Unit]
Description=kafka_exporter
After=local-fs.target network-online.target network.target
Wants=local-fs.target network-online.target network.target

[Service]
ExecStart=/usr/local/kafka/kafka_exporter --kafka.server=172.22.15.84:9092     #此处需修改ip
Restart=on-failure
[Install]
WantedBy=multi-user.target                           
systemctl daemon-reload
systemctl start kafka_exporter.service
systemctl status kafka_exporter.service
systemctl enable kafka_exporter.service

测试:

curl localhost:9308/metrics

你可能感兴趣的:(prometheus,kafka,分布式)