zl程序教程

您现在的位置是:首页 >  云平台

当前栏目

Ceph 普罗米修斯和granfan监控ceph

监控 ceph
2023-09-14 09:15:18 时间

ceph mgr prometheus插件配置


在ceph集群里面将prometheus组件打开

[root@cephnode01 ~]# ceph mgr module enable prometheus

检查端口
[root@cephnode03 ~]#  netstat -nltp | grep mgr 
tcp        0      0 192.168.179.104:7000    0.0.0.0:*               LISTEN      952/ceph-mgr        
tcp        0      0 0.0.0.0:6810            0.0.0.0:*               LISTEN      952/ceph-mgr        
tcp        0      0 0.0.0.0:6811            0.0.0.0:*               LISTEN      952/ceph-mgr        
tcp6       0      0 :::9283                 :::*                    LISTEN      952/ceph-mgr        

[root@cephnode03 ~]# curl 127.0.0.1:9283/metrics 
ceph_pg_forced_recovery{pool_id="1"} 0.0
ceph_pg_forced_recovery{pool_id="2"} 0.0
# HELP ceph_osd_recovery_bytes recovery bytes
# TYPE ceph_osd_recovery_bytes counter
ceph_osd_recovery_bytes{ceph_daemon="osd.1"} 0.0
ceph_osd_recovery_bytes{ceph_daemon="osd.2"} 0.0
ceph_osd_recovery_bytes{ceph_daemon="osd.0"} 0.0
# HELP ceph_prioritycache:inc_pri4_bytes bytes allocated to pri4
# TYPE ceph_prioritycache:inc_pri4_bytes gauge
ceph_prioritycache:inc_pri4_bytes{ceph_daemon="mon.cephnode02"} 0.0
ceph_prioritycache:inc_pri4_bytes{ceph_daemon="mon.cephnode01"} 0.0
ceph_prioritycache:inc_pri4_bytes{ceph_daemon="mon.cephnode03"} 0.0

 

 

配置promethus 


[root@localhost prometheus]# vim prometheus.yml 
    static_configs:
    - targets: ['localhost:9090']
  - job_name: 'ceph_cluster'
    static_configs:
    - targets: ['192.168.179.104:9283']
      labels:
        instance: ceph


[root@localhost prometheus]# ./promtool check config prometheus.yml 
Checking prometheus.yml
  SUCCESS: 1 rule files found

Checking rules/node.yml
  SUCCESS: 1 rules found

[root@localhost prometheus]# systemctl restart prometheus

 

 

配置grafana


1、浏览器登录 grafana 管理界面  

2、添加data sources,点击configuration--》data sources  

3、添加dashboard,点击HOME--》find dashboard on grafana.com  

4、搜索ceph的dashboard    

5、点击HOME--》Import dashboard, 选择合适的dashboard,记录编号