书接上回
1.grafana与prometheus安装
2.prometheus监控服务器状态
此回将prometheus监控RabbitMQ
一、安装rabbitmq_exporter
1. 下载
wget https://github.com/kbudde/rabbitmq_exporter/releases/download/v0.29.0/rabbitmq_exporter-0.29.0.linux-amd64.tar.gz
2. 解压
tar -zxvf rabbitmq_exporter-0.29.0.linux-amd64.tar.gz
3. 启动
RABBIT_USER=geust RABBIT_PASSWORD=geust OUTPUT_FORMAT=JSON PUBLISH_PORT=9099 RABBIT_URL=http://ip:15672 nohup ./rabbitmq_exporter &
RABBIT_USER 用户名
RABBIT_PASSWORD 密码
PUBLISH_PORT 监控端口
RABBIT_URL 监控地址
二、配置prometheus
修改
prometheus.yml
- job_name: 'RabbitMQ'
static_configs:
- targets: ['ip:9099']
# labels:
# instance: RabbitMQ-ip
http://localhost:9090/targets 可以访问这个地址看服务监控是否成功
三、导入模板
https://grafana.com/dashboards/2121
效果
关注 Java有货领取更多资料
联系小编。微信:372787553,带您进群互相学习
左侧小编微信,右侧获取免费资料
技术博客:https://blog.csdn.net/weixin_38937840
SpringCloud学习代码: https://github.com/Dylan-haiji/javayh-cloud
Redis、Mongo、Rabbitmq、Kafka学习代码: https://github.com/Dylan-haiji/javayh-middleware
AlibabaCloud学习代码:https://github.com/Dylan-haiji/javayh-cloud-nacos
SpringBoot+SpringSecurity实现自定义登录学习代码:https://github.com/Dylan-haiji/javayh-distribution