【OSD】PG相关命令

PG相关命令

要检索特定放置组的统计信息,请执行以下操作:

ceph pg {pg-id} query

这里的query其实是一种元数据信息,部分形式如下:

【OSD】PG相关命令
 1 {
 2     "snap_trimq": "[]",
 3     "snap_trimq_len": 0,
 4     "state": "active+clean",
 5     "epoch": 236,
 6     "up": [
 7         1,
 8         2,
 9         0
10     ],
11     "acting": [
12         1,
13         2,
14         0
15     ],
16     "acting_recovery_backfill": [
17         "0",
18         "1",
19         "2"
20     ],
21     "info": {
22         "pgid": "1.0",
23         "last_update": "223'23",
24         "last_complete": "223'23",
25         "log_tail": "0'0",
26         "last_user_version": 23,
27         "last_backfill": "MAX",
28         "purged_snaps": [],
29         "history": {
30             "epoch_created": 2,
31             "epoch_pool_created": 2,
32             "last_epoch_started": 221,
33             "last_interval_started": 220,
34             "last_epoch_clean": 221,
35             "last_interval_clean": 220,
36             "last_epoch_split": 0,
37             "last_epoch_marked_full": 0,
38             "same_up_since": 220,
39             "same_interval_since": 220,
40             "same_primary_since": 212,
41             "last_scrub": "189'21",
42             "last_scrub_stamp": "2020-12-14T06:56:57.181447+0800",
43             "last_deep_scrub": "189'20",
44             "last_deep_scrub_stamp": "2020-12-13T04:09:17.431508+0800",
45             "last_clean_scrub_stamp": "2020-12-14T06:56:57.181447+0800",
46             "prior_readable_until_ub": 0
47         },
48 ...
49 }
View Code

我们可以看到很多理论部分讲过的元数据,比如 up 、acting、info、epoch、peer、interval等。snap_trimq表示快照删除队列。

 

获取PG Map:

要获取特定放置组的放置组映射,请执行以下操作:

ceph pg map {pg-id}

例如:

ceph pg map 1.6c

Ceph将返回放置组图,放置组和OSD状态:

osdmap e13 pg 1.6c (1.6c) -> up [1,0] acting [1,0]

解释一下,这里表示 pg 1.6c被映射到 编号为 [1,0]的两个OSD上。 Acting 表示Acting Set。

 

参考资料:

1. 迁移之美——PG读写流程与状态迁移详解

上一篇:Ceph-OSD基本操作


下一篇:CEPHFS文件系统基本操作