第36讲:使用Prometheus监控系统全方面监控Ceph集群

文章目录

1.启用Manager组件的Prometheus模块

Manager组件的Prometheus模块提供了Ceph exporter客户端程序,会在集群的每一个节点汇总部署Ceph exporter,通过Ceph exporter采集Ceph集群的监控指标,最后由Prometheus监控系统展示监控数据。

sh 复制代码
[root@ceph-node-1 ~]# ceph mgr module enable prometheus

Prometheus模块启用成功。

Prometheus模块开启后会在集群中启动一个9283的端口。

sh 复制代码
[root@ceph-node-1 ~]# netstat -lnpt | grep 9283
tcp6       0      0 :::9283                 :::*                    LISTEN      938527/ceph-mgr

浏览器访问https://192.168.20.20:9283/metrics即可看到Ceph exporter采集的监控指标。

2.部署并配置Prometheus

2.1.部署Prometheus服务端

1)准备Prometheus监控系统的yum源

sh 复制代码
[root@ceph-node-1 ~]# vim /etc/yum.repos.d/prometheus.repo
[prometheus]
name=prometheus
baseurl=https://packagecloud.io/prometheus-rpm/release/el/$releasever/$basearch
repo_gpgcheck=1
enabled=1
gpgcheck=0
metadata_expire=300

2)安装Prometheus

sh 复制代码
[root@ceph-node-1 ~]# yum -y install prometheus

3)启动Prometheus

sh 复制代码
[root@ceph-node-1 ~]# systemctl start prometheus
[root@ceph-node-1 ~]# systemctl status prometheus
● prometheus.service - The Prometheus monitoring system and time series database.
   Loaded: loaded (/usr/lib/systemd/system/prometheus.service; disabled; vendor preset: disabled)
   Active: active (running) since 一 2022-04-25 15:47:31 CST; 4s ago
     Docs: https://prometheus.io

浏览器访问http://192.168.20.20:9090进入Prometheus监控系统。

2.2.配置Prometheus添加Ceph集群的监控信息

主要是在Prometheus中将Ceph exporter组件的地址添加到监控系统中,用于展示Ceph集群的监控数据。

yaml 复制代码
[root@ceph-node-1 ~]# vim /etc/prometheus/prometheus.yml 
global:
  scrape_interval:     15s 
  evaluation_interval: 15s
  external_labels:
      monitor: 'codelab-monitor'

rule_files:

scrape_configs:
  - job_name: 'prometheus'
    static_configs:
      - targets: ['192.168.20.20:9090']

  - job_name: 'ceph_cluster'
    static_configs:
      - targets: ['192.168.20.20:9283']

注意:填写Ceph exporter组件的地址时,要填写处于Active状态的Manager组件地址。

重启Prometheus监控系统。

sh 复制代码
[root@ceph-node-1 ~]# systemctl restart prometheus

2.3.观察Prometheus监控系统中是否能浏览Ceph集群的监控数据

在Targets中可以看到监控主机的信息。

在首页搜索框中也可以看到大量的Ceph监控指标和数据。

3.部署Grafana用于展示Prometheus的监控数据

3.1.部署Grafana仪表盘

sh 复制代码
1.下载Grafana的rpm包
[root@ceph-node-1 ~]# wget https://repo.huaweicloud.com/grafana/8.5.0/grafana-enterprise-8.5.0-1.x86_64.rpm

2.安装Grafana
[root@ceph-node-1 ~]# yum -y localinstall grafana-enterprise-8.5.0-1.x86_64.rpm

3.启动Grafana
[root@ceph-node-1 ~]# systemctl start grafana-server

访问Grafana仪表盘http://192.168.20.20:3000/login,默认占用系统的3000端口,默认账号密码都是admin。

3.2.Grafana仪表盘首页

3.3.配置连接Prometheus数据源

点击设置--->Date Source--->Add data source--->选择Prometheus--->填写Prometheus监控系统的地址--->保存。

3.4.导入Ceph集群监控模板

在Grafana官方搜索的Ceph集群监控模板,其中ID为2842和5336的图形模板展示的内容非常丰富。

2842模板主要展示集群的相关信息,非常全面。

5336模板主要展示OSD的相关信息。

3.4.1.导入Grafana监控模板

1)点击+号--->选择Import--->输入2842--->点击Load。

2)数据源选择Prometheus的数据源。

3.4.2.ID为2842号模板展示

ID为2842号模板展示的Ceph集群监控数据非常全面,包括集群的状态、读写性能指标、组件数量、PG、OSD等等非常丰富的监控数据展示。

3.4.3.ID为5336号模板展示

ID为5336号模板主要是来展示OSD的监控信息的,可以看到很多有价值的监控指标。

相关推荐
likfishdn21 分钟前
Linux的文件与目录管理
linux·运维·服务器
chian-ocean40 分钟前
Linux 文件缓冲区:高效数据访问的幕后推手
linux·运维·服务器
加油=^_^=42 分钟前
【Linux】进程优先级 | 进程调度(三)
linux·运维·服务器
Dontla1 小时前
Docker run --add-host参数解析(在容器启动时向/etc/hosts文件中添加自定义的主机名与IP映射)(适用于临时调试或测试)
tcp/ip·docker·容器
深度Linux1 小时前
深入探讨Ceph:分布式存储架构的未来
分布式·ceph·架构·c/c++
西西小飞龙1 小时前
Docker和K8S中pod、services、container的介绍和关系
docker·容器·kubernetes
斯普信专业组1 小时前
基于Rook的Ceph云原生存储部署与实践指南(下)
ceph
斯普信专业组1 小时前
基于Rook的Ceph云原生存储部署与实践指南(上)
ceph
一只小姜丝3321 小时前
解决各大浏览器中http地址无权限调用麦克风摄像头问题
网络·vue.js·网络协议·http
吃汤圆的抹香鲸1 小时前
GoLand 安装包 绿色版 Win,Mac,Linux 包含IntelliJ全家桶 专为Go语言设计的集成开发环境(IDE)
linux·windows·macos·go·intellij-idea·go1.19