找回密码
 注册
查看: 1895|回复: 1

Ceph监控 ceph集群添加监控

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2021-11-16 15:00:12 | 显示全部楼层 |阅读模式
1.命令行查看集群
监视Ceph集群是一项日常任务,包括监视MON、OSD、MDS、PG,以及存储供应服务,例如RBD、radosgw、Ceph FS和Ceph客户机。Ceph默认情况下提供了一组丰富的本地命令行工具和api来对这些组件执行监视。
  • 检查集群的健康状况
  • $ ceph health
  • $ ceph health detail
  • 查看集群事件
  • $ ceph -w # 集群的动态更改信息
  • $ ceph --watch-debug # debug
  • --watch-info: to watch info events
  • --watch-sec: to watch security events
  • --watch-warn: to watch warning events
  • --watch-error: to watch error events
  • 集群利用率统计
  • $ ceph df
  • GLOBAL:
  • SIZE AVAIL RAW USED %RAW USED
  • 180GiB 148GiB 31.9GiB 17.73
  • POOLS:
  • NAME ID USED %USED MAX AVAIL O
  • BJECTS
  • rbd 1 7.62GiB 15.15 42.7GiB 1971
  • .rgw.root 2 1.09KiB 0 42.7GiB 4
  • default.rgw.control 3 0B 0 42.7GiB 8
  • default.rgw.meta 4 0B 0 42.7GiB 0
  • default.rgw.log 5 0B 0 42.7GiB 207
  • cephfs_data 6 0B 0 42.7GiB 0
  • cephfs_metadata 7 2.19KiB 0 42.7GiB 21
  • ssd-pool 8 229B 0 15.2GiB 1
  • sata-pool 9 229B 0 15.3GiB 1
  • $ ceph df detail
  • 检查集群的状态
  • $ ceph status
  • $ ceph -s
  • 集群身份验证
  • $ ceph auth list
  • 检查 Mon 状态
  • $ ceph mon stat
  • $ ceph mon dump
  • $ ceph quorum_status -f json-pretty
  • OSD查看
  • $ ceph osd tree
  • $ ceph osd dump
  • Crush map的查看
  • $ ceph osd crush dump
  • $ ceph osd crush rule list
  • $ ceph osd crush rule dump
  • $ ceph osd find
  • PGs 的查看
  • $ ceph PG stat
  • $ ceph pg dump -f json-pretty
  • $ ceph pg query # 查询特定pg的详细信息
  • Ceph MDS 的查看
  • $ ceph PG stat
  • $ ceph pg dump -f json-pretty
  • $ ceph pg query # 查询特定pg的详细信息
    $ Y8 G- K- f7 Q/ f9 \% k
2.prometheus
官方参考地址:https://github.com/ceph/cephmetrics. s- a; i$ p4 s( _4 E% [. }
step 1. ceph集群启动 prometheus 模块
  • $ ceph mgr module enable prometheus
      U! _3 B: n( }; N8 n3 h, k
step 2. prometheus 安装
7 z8 H3 j+ i" \& d官方下载:https://prometheus.io/download/
$ W/ d5 e  S3 {1.prometheus 下载
  • wget https://github.com/prometheus/prometheus/releases/download/v2.9.2/prometheus-2.9.2.linux-amd64.tar.gz
  • tar -zxvf prometheus-2.9.2.linux-amd64.tar.gz
  • cd prometheus-2.9.2.linux-amd64! L$ f+ Y$ |+ X% ?- J
2.配置prometheus.yml
  • $vim prometheus.yml
  • ...
  • - job_name: 'ceph'
  •     honor_labels: true
  •     file_sd_configs:
  •         - files:
  •          - ceph_targets.yml" p& ]" I8 }$ ~. K, j5 V' `9 S
3.编辑ceph_targets.yml
  • $ cat ceph_targets.yml
  • [
  •     {
  •         "targets": ["chao-1:9283","chao-2:9283","chao-3:9283"],"labels": {}
  •     }
  • # m. y/ V1 y" P8 z- z  g, a* i
4.运行
  • $ nohup ./prometheus --config.file prometheus.yml >> /var/log/prometheus.
  • out 2>&1 &7 P& R. f: @: Y- W# ]& ^
5.测试; C# T7 ]* N  ~$ @0 J8 H
浏览器打开: http://192.168.13.17:9090
step 3. grafana 安装
, P4 s$ D$ p9 v2 d, t+ L官方下载:https://grafana.com/grafana/download" Q' U! J0 q% O* W; K4 f
1.软件下载
  • $ wget https://dl.grafana.com/oss/release/grafana-6.1.4-1.x86_64.rpm
  • $ sudo yum localinstall grafana-6.1.4-1.x86_64.rpm
  • 修改serverport 为需要的端口30000, \, D7 x! z7 u
2.启动服务
  • $ systemctl enable grafana-server$ systemctl start grafana-server: P* V% Y: d: u0 c2 @+ q8 O% F5 V
3.设置数据源, Q4 g) ?+ x8 d* M: M
http://192.168.13.17:9090
4.导入模板
  • Ceph-Cluster [ID: 2842
  • Ceph-OSD: [ID: 5336
  • Ceph-Pools: [ID: 53420 ~4 L; S. k, s; |. g, y+ _3 u

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-11-18 14:58:19 | 显示全部楼层
nohup /var/local/prometheus-2.29.0-rc.2.linux-amd64/prometheus --config.file  /var/local/prometheus-2.29.0-rc.2.linux-amd64/prometheus.yml &
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 01:00 , Processed in 0.019412 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表