查看osdmap命令

标签(空格分隔): ceph,ceph运维,osdmap


方法一:

最直接,简单的命令:

[root@node3 ~]# ceph osd tree
ID CLASS WEIGHT  TYPE NAME      STATUS REWEIGHT PRI-AFF 
-1       0.05878 root default                           
-3       0.01959     host node1                         
 0   hdd 0.00980         osd.0      up  1.00000 1.00000 
-5       0.01959     host node2                         
 1   hdd 0.00980         osd.1      up  1.00000 1.00000 
-7       0.01959     host node3                         
 2   hdd 0.00980         osd.2      up  1.00000 1.00000 

这个命令获取的信息较为简单,下面的是获取详细信息的命令

[root@node3 ~]# ceph osd dump
osdmaptool: osdmap file 'osdmap'
epoch 40
fsid b8b4aa68-d825-43e9-a60a-781c92fec20e
created 2017-10-16 15:51:13.675888
modified 2017-10-16 16:14:25.041923
flags sortbitwise,recovery_deletes,purged_snapdirs
crush_version 13
full_ratio 0.95
backfillfull_ratio 0.9
nearfull_ratio 0.85
require_min_compat_client jewel
min_compat_client jewel
require_osd_release luminous

pool 1 'rbd' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 64 pgp_num 64 last_change 26 flags hashpspool stripe_width 0

max_osd 3
osd.0 up   in  weight 1 up_from 30 up_thru 38 down_at 28 last_clean_interval [5,29) 192.168.197.154:6801/7155 192.168.197.154:6809/1007155 192.168.197.154:6810/1007155 192.168.197.154:6811/1007155 exists,up 26c07bad-69d3-4c9f-80ee-9c0af7c9fc92
osd.1 up   in  weight 1 up_from 35 up_thru 38 down_at 31 last_clean_interval [9,28) 192.168.197.156:6800/6496 192.168.197.156:6801/6496 192.168.197.156:6802/6496 192.168.197.156:6803/6496 exists,up 013fafd1-cfde-48e7-82ed-1e5c0d7c0b74
osd.2 up   in  weight 1 up_from 35 up_thru 35 down_at 29 last_clean_interval [13,28) 192.168.197.157:6800/6433 192.168.197.157:6801/6433 192.168.197.157:6802/6433 192.168.197.157:6803/6433 exists,up f9c20128-2c2d-46ba-adfd-12e8263d3077

这里的epoch 40表示的是osdmap的版本号,说明当前的osdmap的版本号为40

方法二:

1. 从集群获取osdmap:

[root@node3 ~]# ceph osd getmap -o osdmap
got osdmap epoch 40

这里的epoch 40表示的是osdmap的版本号,说明当前的osdmap的版本号为40

2. 查看上一步获取的osdmap:

[root@node3 ~]# osdmaptool --print osdmap
osdmaptool: osdmap file 'osdmap'
epoch 40
fsid b8b4aa68-d825-43e9-a60a-781c92fec20e
created 2017-10-16 15:51:13.675888
modified 2017-10-16 16:14:25.041923
flags sortbitwise,recovery_deletes,purged_snapdirs
crush_version 13
full_ratio 0.95
backfillfull_ratio 0.9
nearfull_ratio 0.85
require_min_compat_client jewel
min_compat_client jewel
require_osd_release luminous

pool 1 'rbd' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 64 pgp_num 64 last_change 26 flags hashpspool stripe_width 0

max_osd 3
osd.0 up   in  weight 1 up_from 30 up_thru 38 down_at 28 last_clean_interval [5,29) 192.168.197.154:6801/7155 192.168.197.154:6809/1007155 192.168.197.154:6810/1007155 192.168.197.154:6811/1007155 exists,up 26c07bad-69d3-4c9f-80ee-9c0af7c9fc92
osd.1 up   in  weight 1 up_from 35 up_thru 38 down_at 31 last_clean_interval [9,28) 192.168.197.156:6800/6496 192.168.197.156:6801/6496 192.168.197.156:6802/6496 192.168.197.156:6803/6496 exists,up 013fafd1-cfde-48e7-82ed-1e5c0d7c0b74
osd.2 up   in  weight 1 up_from 35 up_thru 35 down_at 29 last_clean_interval [13,28) 192.168.197.157:6800/6433 192.168.197.157:6801/6433 192.168.197.157:6802/6433 192.168.197.157:6803/6433 exists,up f9c20128-2c2d-46ba-adfd-12e8263d3077
原文地址:https://www.cnblogs.com/sisimi/p/7737177.html