|
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的详细信息
* E/ c9 H# S0 S' S 2.prometheus- $ ceph mgr module enable prometheus
+ E( S: N3 W/ y5 \5 I) o3 S) ]# K
- 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
/ q) J# ]- O7 q
2.配置prometheus.yml - $vim prometheus.yml
- ...
- - job_name: 'ceph'
- honor_labels: true
- file_sd_configs:
- - files:
- - ceph_targets.yml. @+ Z; \) O( S" C6 C
3.编辑ceph_targets.yml - $ cat ceph_targets.yml
- [
- {
- "targets": ["chao-1:9283","chao-2:9283","chao-3:9283"],"labels": {}
- }
, D$ Q; U& s( t) n
4.运行 - $ nohup ./prometheus --config.file prometheus.yml >> /var/log/prometheus.
- out 2>&1 &" d3 L5 p2 |: q" y1 }7 H
- $ 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
7 U6 o5 A# F1 O" ~. {# ]$ u
2.启动服务 - $ systemctl enable grafana-server$ systemctl start grafana-server
1 ^% G) s2 y0 w$ r# [9 _. W
4.导入模板 - Ceph-Cluster: [ID: 2842
- Ceph-OSD: [ID: 5336
- Ceph-Pools: [ID: 5342
; _$ w5 y3 r% t. Q) |
|