找回密码
 注册
查看: 1893|回复: 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的详细信息
    9 I& U8 Z, z9 L0 ]0 `
2.prometheus
官方参考地址:https://github.com/ceph/cephmetrics- ?3 p; g4 Z# C0 ]# m3 R8 W
step 1. ceph集群启动 prometheus 模块
  • $ ceph mgr module enable prometheus4 a6 N5 M5 }% g; z0 u
step 2. prometheus 安装
: E8 D# A  j7 K! d4 M+ B官方下载:https://prometheus.io/download/
1 \  j- w6 o3 l  e1.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+ j6 U* r0 h6 B  ?1 C1 ]. g3 o/ B
2.配置prometheus.yml
  • $vim prometheus.yml
  • ...
  • - job_name: 'ceph'
  •     honor_labels: true
  •     file_sd_configs:
  •         - files:
  •          - ceph_targets.yml
    ' Q, T, u# u7 j1 C
3.编辑ceph_targets.yml
  • $ cat ceph_targets.yml
  • [
  •     {
  •         "targets": ["chao-1:9283","chao-2:9283","chao-3:9283"],"labels": {}
  •     }

  • 6 Y* n5 w0 _6 b% G
4.运行
  • $ nohup ./prometheus --config.file prometheus.yml >> /var/log/prometheus.
  • out 2>&1 &
      n! k3 w+ P, ^- Q) W
5.测试( E# @% \* _# V0 O0 }
浏览器打开: http://192.168.13.17:9090
step 3. grafana 安装( G, K) e- j2 Z
官方下载:https://grafana.com/grafana/download
$ Q# Z2 o; i, q  B. h2 R9 b1.软件下载
  • $ 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 为需要的端口300004 Q% l) z$ H5 [3 g3 V' {1 E
2.启动服务
  • $ systemctl enable grafana-server$ systemctl start grafana-server. |7 x# j3 a, d8 G. D2 M
3.设置数据源
8 t' [/ }$ A3 O7 M. _http://192.168.13.17:9090
4.导入模板
  • Ceph-Cluster [ID: 2842
  • Ceph-OSD: [ID: 5336
  • Ceph-Pools: [ID: 5342/ R0 @* e, l4 C' c: p' j

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 00:03 , Processed in 0.020976 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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