分布式存儲系統之Ceph集群啟用Dashboard及使用Prometheus監控Ceph( 六 )

訪問Prometheus server所在主機的9090端口

分布式存儲系統之Ceph集群啟用Dashboard及使用Prometheus監控Ceph

文章插圖
提示:可以看到訪問Prometheus 所在主機的9090端口,對應能夠查到node_exporter采集到數據;說明Prometheus server和node_exporter是部署是沒有問題;
Ceph mgr啟用Prometheus模塊
Ceph Manager內置了眾多模塊,包括prometheus模塊,用于直接輸出Prometheus?格的指標數據 。
分布式存儲系統之Ceph集群啟用Dashboard及使用Prometheus監控Ceph

文章插圖
提示:Prometheus模塊默認監聽于TCP協議的9283端口;這里需要說明一下 , ceph只要啟用了Prometheus模塊以后,只要運行的有mgr的節點,對應都會監聽9283端口;
驗證:查看mgr運行主機是否監聽9283端口?對應端口是否可訪問?
[root@ceph-admin ~]# ceph mgr services{"dashboard": "https://0.0.0.0:8443/","prometheus": "http://ceph-mgr01.ilinux.io:9283/"}[root@ceph-admin ~]# ssh ceph-mgr01 'ss -tnl'StateRecv-Q Send-Q Local Address:PortPeer Address:PortLISTEN05*:8443*:*LISTEN0128172.16.30.74:6800*:*LISTEN0128192.168.0.74:6800*:*LISTEN0128192.168.0.74:6801*:*LISTEN0128172.16.30.74:6801*:*LISTEN0128172.16.30.74:6802*:*LISTEN0128192.168.0.74:6802*:*LISTEN0128192.168.0.74:6803*:*LISTEN0128172.16.30.74:6803*:*LISTEN0128192.168.0.74:6804*:*LISTEN0128*:22*:*LISTEN0100127.0.0.1:25*:*LISTEN05[::]:9283[::]:*LISTEN0128[::]:22[::]:*LISTEN0100[::1]:25[::]:*[root@ceph-admin ~]# curl http://ceph-mgr01.ilinux.io:9283/<!DOCTYPE html><html><head><title>Ceph Exporter</title></head><body><h1>Ceph Exporter</h1><p><a >Metrics</a></p></body></html>[root@ceph-admin ~]#
分布式存儲系統之Ceph集群啟用Dashboard及使用Prometheus監控Ceph

文章插圖
提示:可以看到對應ceph-mgr01的9283是處于監聽狀體,并且也是可以正常訪問的;
將ceph exporter納入Prometheus server中去
分布式存儲系統之Ceph集群啟用Dashboard及使用Prometheus監控Ceph

文章插圖
重啟Prometheus server
[root@ceph-mgr02 prometheus]# systemctl restart prometheus.service[root@ceph-mgr02 prometheus]# systemctl status prometheus.service● prometheus.service - The Prometheus 2 monitoring system and time series database.Loaded: loaded (/usr/lib/systemd/system/prometheus.service; disabled; vendor preset: disabled)Active: active (running) since Sun 2022-10-09 22:37:16 CST; 5s agoDocs: https://prometheus.io Main PID: 2481 (prometheus)CGroup: /system.slice/prometheus.service└─2481 /usr/local/prometheus/prometheus --storage.tsdb.path=/var/lib/prometheus --config.file=/usr/local/prometh...Oct 09 22:37:16 ceph-mgr02.ilinux.io prometheus[2481]: ts=2022-10-09T14:37:16.347Z caller=head.go:613 level=info compo...ent=2Oct 09 22:37:16 ceph-mgr02.ilinux.io prometheus[2481]: ts=2022-10-09T14:37:16.387Z caller=head.go:613 level=info compo...ent=2Oct 09 22:37:16 ceph-mgr02.ilinux.io prometheus[2481]: ts=2022-10-09T14:37:16.393Z caller=head.go:613 level=info compo...ent=2Oct 09 22:37:16 ceph-mgr02.ilinux.io prometheus[2481]: ts=2022-10-09T14:37:16.393Z caller=head.go:619 level=info compo…77763msOct 09 22:37:16 ceph-mgr02.ilinux.io prometheus[2481]: ts=2022-10-09T14:37:16.394Z caller=main.go:993 level=info fs_ty...MAGICOct 09 22:37:16 ceph-mgr02.ilinux.io prometheus[2481]: ts=2022-10-09T14:37:16.394Z caller=main.go:996 level=info msg="...rted"Oct 09 22:37:16 ceph-mgr02.ilinux.io prometheus[2481]: ts=2022-10-09T14:37:16.394Z caller=main.go:1177 level=info msg=...s.ymlOct 09 22:37:16 ceph-mgr02.ilinux.io prometheus[2481]: ts=2022-10-09T14:37:16.395Z caller=main.go:1214 level=info msg="Comp…μsOct 09 22:37:16 ceph-mgr02.ilinux.io prometheus[2481]: ts=2022-10-09T14:37:16.395Z caller=main.go:957 level=info msg="...sts."Oct 09 22:37:16 ceph-mgr02.ilinux.io prometheus[2481]: ts=2022-10-09T14:37:16.395Z caller=manager.go:941 level=info co...r..."Hint: Some lines were ellipsized, use -l to show in full.[root@ceph-mgr02 prometheus]# ss -tnlStateRecv-Q Send-QLocal Address:PortPeer Address:PortLISTEN0128172.16.30.75:6800*:*LISTEN0128192.168.0.75:6800*:*LISTEN0128172.16.30.75:6801*:*LISTEN0128192.168.0.75:6801*:*LISTEN0128192.168.0.75:6802*:*LISTEN0128172.16.30.75:6802*:*LISTEN0128192.168.0.75:6803*:*LISTEN0128172.16.30.75:6803*:*LISTEN0128*:22*:*LISTEN0100127.0.0.1:25*:*LISTEN05*:8443*:*LISTEN0128[::]:22[::]:*LISTEN0100[::1]:25[::]:*LISTEN0128[::]:9090[::]:*LISTEN05[::]:9283[::]:*[root@ceph-mgr02 prometheus]#訪問Prometheus server的9090端口,看看對應ceph exporter的指標數據是否已經有了?
分布式存儲系統之Ceph集群啟用Dashboard及使用Prometheus監控Ceph

文章插圖
提示:可以看到現在訪問prometheus server 的9090端口多了許多以ceph開頭的指標,說明ceph exporter已經將數據發送給Prometheus server;

推薦閱讀