Skip to content

Commit 32cf9ac

Browse files
committed
ceph命令
1 parent dce95f5 commit 32cf9ac

File tree

1 file changed

+98
-1
lines changed

1 file changed

+98
-1
lines changed

README.md

Lines changed: 98 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,4 +204,101 @@ set pool 4 size to 1
204204
[root@master ~]# ceph osd pool delete test2 test2 --yes-i-really-really-mean-it
205205
pool 'test2' removed
206206
```
207-
***
207+
***
208+
# 命令汇总
209+
***
210+
* `ceph osd ls`,查看所有osd
211+
``` shell
212+
[root@master ~]# ceph osd ls
213+
0
214+
1
215+
2
216+
3
217+
```
218+
***
219+
* `ceph osd stat`,查看osd状态
220+
``` shell
221+
[root@master ~]# ceph osd stat
222+
4 osds: 4 up (since 47h), 4 in (since 47h); epoch: e1699
223+
```
224+
***
225+
* `ceph osd tree`,查看osd树形结构
226+
``` shell
227+
[root@master ~]# ceph osd tree
228+
ID CLASS WEIGHT TYPE NAME STATUS REWEIGHT PRI-AFF
229+
-1 0.03918 root default
230+
-7 0.00980 host master
231+
1 hdd 0.00980 osd.1 up 1.00000 1.00000
232+
-3 0.00980 host node1
233+
0 hdd 0.00980 osd.0 up 1.00000 1.00000
234+
-5 0.00980 host node2
235+
2 hdd 0.00980 osd.2 up 1.00000 1.00000
236+
-9 0.00980 host node3
237+
3 hdd 0.00980 osd.3 up 1.00000 1.00000
238+
```
239+
***
240+
* `ceph osd dump`,导出osd详细信息
241+
``` shell
242+
[root@master ~]# ceph osd dump
243+
epoch 1699
244+
fsid 2ceb7b6b-78a0-40cc-8a2f-abd695c70914
245+
created 2022-06-10T16:48:19.983619+0000
246+
modified 2022-06-12T15:23:03.169874+0000
247+
flags sortbitwise,recovery_deletes,purged_snapdirs,pglog_hardlimit
248+
crush_version 7
249+
full_ratio 0.95
250+
backfillfull_ratio 0.9
251+
nearfull_ratio 0.85
252+
require_min_compat_client luminous
253+
min_compat_client jewel
254+
require_osd_release octopus
255+
pool 1 'device_health_metrics' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 1 pgp_num 1 autoscale_mode on last_change 22 flags hashpspool stripe_width 0 pg_num_min 1 application mgr_devicehealth
256+
pool 4 'test11' replicated size 2 min_size 1 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 1695 lfor 0/1224/1222 flags hashpspool,pool_snaps max_bytes 102400 max_objects 10000 stripe_width 0 application rbd
257+
snap 3 'test11-snap01' 2022-06-11T17:56:30.251872+0000
258+
max_osd 4
259+
osd.0 up in weight 1 up_from 9 up_thru 1695 down_at 0 last_clean_interval [0,0) [v2:10.244.2.236:6800/118535083,v1:10.244.2.236:6801/118535083] [v2:10.244.2.236:6802/118535083,v1:10.244.2.236:6803/118535083] exists,up affad9fa-2e9b-4a51-86a6-25623489d826
260+
osd.1 up in weight 1 up_from 12 up_thru 1695 down_at 0 last_clean_interval [0,0) [v2:10.244.0.200:6800/2167737203,v1:10.244.0.200:6801/2167737203] [v2:10.244.0.200:6802/2167737203,v1:10.244.0.200:6803/2167737203] exists,up 94d2bece-d6ca-4209-8fdf-b0e76e396da5
261+
osd.2 up in weight 1 up_from 12 up_thru 1695 down_at 0 last_clean_interval [0,0) [v2:10.244.1.178:6800/3465597621,v1:10.244.1.178:6801/3465597621] [v2:10.244.1.178:6802/3465597621,v1:10.244.1.178:6803/3465597621] exists,up 24da08d8-973b-4de8-9735-fac864f1d5ed
262+
osd.3 up in weight 1 up_from 17 up_thru 1695 down_at 0 last_clean_interval [0,0) [v2:10.244.3.47:6800/1888772417,v1:10.244.3.47:6801/1888772417] [v2:10.244.3.47:6802/1888772417,v1:10.244.3.47:6803/1888772417] exists,up 3b4fcd7b-533b-40a5-ab05-a61e0c2b8492
263+
```
264+
***
265+
* `ceph mon stat`,查看Monitor状态
266+
``` shell
267+
[root@master ~]# ceph mon stat
268+
e1: 1 mons at {a=[v2:10.100.154.12:3300/0,v1:10.100.154.12:6789/0]}, election epoch 3, leader 0 a, quorum 0 a
269+
```
270+
***
271+
* `ceph mon dump`,导出Monitor详细信息
272+
``` shell
273+
[root@master ~]# ceph mon dump
274+
dumped monmap epoch 1
275+
epoch 1
276+
fsid 2ceb7b6b-78a0-40cc-8a2f-abd695c70914
277+
last_changed 2022-06-10T16:48:19.048859+0000
278+
created 2022-06-10T16:48:19.048859+0000
279+
min_mon_release 15 (octopus)
280+
0: [v2:10.100.154.12:3300/0,v1:10.100.154.12:6789/0] mon.a
281+
```
282+
***
283+
* `ceph pg dump`,导出PG详细信息
284+
***
285+
* `ceph osd crush dump`,导出CRUSH详细信息
286+
***
287+
* `ceph -s``ceph status`,查看ceph集群的状态
288+
``` shell
289+
[root@master ~]# ceph -s
290+
cluster:
291+
id: 2ceb7b6b-78a0-40cc-8a2f-abd695c70914
292+
health: HEALTH_OK
293+
294+
services:
295+
mon: 1 daemons, quorum a (age 47h)
296+
mgr: a(active, since 47h)
297+
osd: 4 osds: 4 up (since 47h), 4 in (since 47h)
298+
299+
data:
300+
pools: 2 pools, 33 pgs
301+
objects: 0 objects, 0 B
302+
usage: 4.5 GiB used, 36 GiB / 40 GiB avail
303+
pgs: 33 active+clean
304+
```

0 commit comments

Comments
 (0)