背景:
从L版本的ceph后mgr内置自带Prometheus监控模块了,方便了对ceph集群的监控。
操作流程:
一、ceph mgr启动Prometheus监控模块
#开启监控模块
ceph mgr module enable prometheus
#查询已开启模块
ceph mgr module ls | grep enable -A 5
#查看是否起来,一般默认监听端口为9283,http://<MGR>:9283/metrics
netstat -nltp | grep mgr
二、安装Prometheus
怎么安装就不细说了,自行找相关部署文档
这里说一下配置ceph-exporter的config, 即mgr的节点
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: "prometheus"
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ["localhost:9090"]
# 新增如下部分采集ceph exporter监控数据,targets指定所有MGR的IP,端口为9283
- job_name: "Ceph"
static_configs:
- targets: ["172.26.2.234:9283","172.26.2.233:9283"]
三、在grafana上添加ceph的json模版,在grafana官网找自己想要的Dashboard模版即可。