构建ceph可视化监控(prometheu+grafana)
生活随笔
收集整理的這篇文章主要介紹了
构建ceph可视化监控(prometheu+grafana)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
快速構建ceph可視化監控系統(在任意mon節點安裝)
前言
ceph的可視化方案很多,本篇介紹的是比較簡單的一種方式,并且對包都進行了二次封裝,所以能夠在極短的時間內構建出一個可視化的監控系統
本系統組件如下:
-
ceph-jewel版本
-
ceph_exporter的jewel版本
-
prometheus的2.3.2版本
-
grafana的grafana-5.3.0版本
-
適配的系統為centos7
資源如下:
http://static.zybuluo.com/zphj1987/jiwx305b8q1hwc5uulo0z7ft/ceph_exporter-2.0.0-1.x86_64.rpm
http://static.zybuluo.com/zphj1987/7ro7up6r03kx52rkwy1qjuwm/prometheus-2.3.2-1.x86_64.rpm
https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.2.1-1.x86_64.rpm
http://static.zybuluo.com/zphj1987/1nu2k4cpcery94q2re3u6s1t/ceph-cluster_rev1.json
以上資源均可以直接用wget進行下載,然后直接安裝(本地源中tools目錄也有 可以直接下載)
監控的架構介紹
通過ceph_exporter抓取的ceph相關的數據并且在本地監聽端口9128端口
prometheus抓取ceph_exporter的9128的端口的數據存儲在本地的/var/lib/prometheus/目錄下面
grafana抓取prometheus的數據進行渲染成web頁面
頁面的模板就是使用的grafana的ceph模板插件
那么我們就根據上面的架構去一步步的把系統配置起來
配置監控系統
安裝ceph_exporter
[root@ceph-node2 ~]# ls ceph_exporter-2.0.0-1.x86_64.rpm grafana-5.3.0-1.x86_64.rpm prometheus-2.3.2-1.x86_64.rpm [root@ceph-node2 ~]# rpm -qpl ceph_exporter-2.0.0-1.x86_64.rpm /usr/bin/ceph_exporter /usr/lib/systemd/system/ceph_exporter.service [root@ceph-node2 ~]# rpm -ivh ceph_exporter-2.0.0-1.x86_64.rpm 準備中... ################################# [100%] 正在升級/安裝...1:ceph_exporter-2:2.0.0-1 ################################# [100%] [root@ceph-node2 ~]# systemctl start ceph_exporter [root@ceph-node2 ~]# systemctl enable ceph_exporter [root@ceph-node2 ~]# netstat -utpln |grep 9128 tcp6 0 0 :::9128 :::* LISTEN 30641/ceph_exporter可以看到端口起來了就是安裝成功了,這個ceph_exporter建議是安裝在管理節點上,也就是能夠執行出ceph -s的節點上面的
安裝prometheus
[root@ceph-node2 ~]# rpm -qpl prometheus-2.3.2-1.x86_64.rpm /etc/ceph/prometheus.yml /usr/bin/prometheus /usr/lib/systemd/system/prometheus.service [root@ceph-node2 ~]# rpm -ivh prometheus-2.3.2-1.x86_64.rpm 準備中... ################################# [100%] 正在升級/安裝...1:prometheus-2:2.3.2-1 ################################# [100%] [root@ceph-node2 ~]# systemctl start prometheus [root@ceph-node2 ~]# netstat -utpln |grep 9090 tcp6 0 0 :::9090 :::* LISTEN 30750/prometheus這個地方默認是認為prometheus和ceph_exporter在一臺機器上面,所以配置文件的/etc/ceph/prometheus.yml里面的targets寫的是127.0.0.1,如果不同機器,需要修改成exporter ip地址
prometheus的默認監聽端口為9090,到這個時候直接去web 上面就可以看到prometheus的抓取的數據了
到這里是數據到prometheus的已經完成了,下面就去做跟grafana相關的配置了
安裝grafana
[root@ceph-node2 ~]# yum localinstall grafana-5.3.0-1.x86_64.rpm [root@ceph-node2 ~]# systemctl start grafana-server.service [root@ceph-node2 ~]# netstat -tunlp|grep gra Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp6 0 0 :::3000 :::* LISTEN 31164/grafana-servegrafana默認監聽的3000的端口
默認登陸的用戶名密碼為admin admin,登陸成功后會強制修改密碼
配置grafana
這里如果能上網就直接輸入id 917 ,如果不能上網就把上面的ceph-cluster_rev1.json文件弄到本地去,導入進去即可
監控配置完成
總結
以上是生活随笔為你收集整理的构建ceph可视化监控(prometheu+grafana)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux kernel --- che
- 下一篇: 兆比特每秒和兆字节每秒_比特 千比特 兆