1、部署zookeeper_exporter

  1. #1、下载zookeeper_exporter,是一个二进制文件
  2. wget https://github.com/carlpett/zookeeper_exporter/releases/download/v1.0.2/zookeeper_exporter && chmod +x zookeeper_exporter
  3. #2、创建文件所在的目录
  4. mkdir -p /usr/local/zookeeper_exporter/
  5. mv zookeeper_exporter /usr/local/zookeeper_exporter/
  6. #3、把zookeeper_exporter添加到系统服务
  7. vi /etc/systemd/system/zook_exporter.service
  8. [Unit]
  9. Description=zook_exporter
  10. Documentation=https://github.com/carlpett/zookeeper_exporter
  11. After=network.target
  12. [Service]
  13. Type=simple
  14. ExecStart=/usr/local/zookeeper_exporter/zookeeper_exporter
  15. Restart=on-failure
  16. [Install]
  17. WantedBy=multi-user.target
  18. #4、启动服务并加入开机自启
  19. systemctl daemon-reload
  20. systemctl enable zook_exporter
  21. systemctl start zook_exporter
  22. #5、添加prometheus配置
  23. - job_name: 'zookeeper_exporter'
  24. static_configs:
  25. - targets: ['10.4.62.33:9141']
  26. labels:
  27. instance: Zookeeper
  28. #6、重启prometheus
  29. systemctl restart prometheus

2、Grafana配置zookeeper监控面板

image.png
image.png
image.png