ceph中獲取osdmap和monmap的方式

ceph集羣中,能夠用osdmaptool和monmaptool,來建立、獲取osdmap和monmap的信息。

能夠查閱官方文檔:osdmaptoolmonmaptoolnode

 

1、 獲取osdmap

方法一:經過ceph命令ide

# ceph osd dump
epoch 95
fsid ced59665-9de8-42b7-b2c3-5a19cffe97c7
created 2016-03-25 21:13:13.595390
modified 2016-03-31 12:36:39.588974
flags sortbitwise
pool 0 'rbd' replicated size 2 min_size 2 crush_ruleset 0 object_hash rjenkins pg_num 128 pgp_num 128 last_change 16 flags hashpspool stripe_width 0
pool 1 'testpool' replicated size 2 min_size 2 crush_ruleset 0 object_hash rjenkins pg_num 512 pgp_num 512 last_change 95 flags hashpspool stripe_width 0
    removed_snaps [1~3]
max_osd 6
osd.0 up   in  weight 1 up_from 77 up_thru 88 down_at 70 last_clean_interval [54,61) 10.167.225.35:6812/3979 10.167.225.35:6813/3979 10.167.225.35:6814/3979 10.167.225.35:6815/3979 exists,up 5c0194c3-351b-4ce9-9864-083819a3e0cb
osd.1 up   in  weight 1 up_from 74 up_thru 91 down_at 70 last_clean_interval [51,61) 10.167.225.35:6808/3668 10.167.225.35:6809/3668 10.167.225.35:6810/3668 10.167.225.35:6811/3668 exists,up 02327243-d1e4-4ea5-9688-9c5e6f46ec44
osd.2 up   in  weight 1 up_from 68 up_thru 89 down_at 67 last_clean_interval [57,61) 10.167.225.35:6804/3107 10.167.225.35:6805/3107 10.167.225.35:6806/3107 10.167.225.35:6807/3107 exists,up 03a50780-9924-4f66-bf5c-71fa0b37bf2f
osd.3 up   in  weight 1 up_from 63 up_thru 89 down_at 62 last_clean_interval [48,61) 10.167.225.35:6800/2728 10.167.225.35:6801/2728 10.167.225.35:6802/2728 10.167.225.35:6803/2728 exists,up edaf6eda-6683-48bd-adf3-f9c748148036
osd.4 up   in  weight 1 up_from 85 up_thru 90 down_at 80 last_clean_interval [71,84) 10.167.225.63:6804/3048 10.167.225.63:6808/1003048 10.167.225.63:6809/1003048 10.167.225.63:6810/1003048 exists,up f57ba6b1-54e9-4bfc-930f-42adbdd036fb
osd.5 up   in  weight 1 up_from 85 up_thru 91 down_at 80 last_clean_interval [65,84) 10.167.225.63:6800/2559 10.167.225.63:6805/1002559 10.167.225.63:6807/1002559 10.167.225.63:6811/1002559 exists,up 583e265c-11c1-4230-81d6-7c9a58d0f463
工具

方法二:經過osdmaptool工具this

獲取osdmap的二進制文件代理

# sudo ceph osd getmap -o osds.map
got osdmap epoch 95
rest

使用文本方式查看osdmap日誌

# osdmaptool --print osds.map
osdmaptool: osdmap file 'osds.map'
epoch 95
fsid ced59665-9de8-42b7-b2c3-5a19cffe97c7
created 2016-03-25 21:13:13.595390
modified 2016-03-31 12:36:39.588974
flags sortbitwiseorm

pool 0 'rbd' replicated size 2 min_size 2 crush_ruleset 0 object_hash rjenkins pg_num 128 pgp_num 128 last_change 16 flags hashpspool stripe_width 0
pool 1 'testpool' replicated size 2 min_size 2 crush_ruleset 0 object_hash rjenkins pg_num 512 pgp_num 512 last_change 95 flags hashpspool stripe_width 0
    removed_snaps [1~3]對象

max_osd 6
osd.0 up   in  weight 1 up_from 77 up_thru 88 down_at 70 last_clean_interval [54,61) 10.167.225.35:6812/3979 10.167.225.35:6813/3979 10.167.225.35:6814/3979 10.167.225.35:6815/3979 exists,up 5c0194c3-351b-4ce9-9864-083819a3e0cb
osd.1 up   in  weight 1 up_from 74 up_thru 91 down_at 70 last_clean_interval [51,61) 10.167.225.35:6808/3668 10.167.225.35:6809/3668 10.167.225.35:6810/3668 10.167.225.35:6811/3668 exists,up 02327243-d1e4-4ea5-9688-9c5e6f46ec44
osd.2 up   in  weight 1 up_from 68 up_thru 89 down_at 67 last_clean_interval [57,61) 10.167.225.35:6804/3107 10.167.225.35:6805/3107 10.167.225.35:6806/3107 10.167.225.35:6807/3107 exists,up 03a50780-9924-4f66-bf5c-71fa0b37bf2f
osd.3 up   in  weight 1 up_from 63 up_thru 89 down_at 62 last_clean_interval [48,61) 10.167.225.35:6800/2728 10.167.225.35:6801/2728 10.167.225.35:6802/2728 10.167.225.35:6803/2728 exists,up edaf6eda-6683-48bd-adf3-f9c748148036
osd.4 up   in  weight 1 up_from 85 up_thru 90 down_at 80 last_clean_interval [71,84) 10.167.225.63:6804/3048 10.167.225.63:6808/1003048 10.167.225.63:6809/1003048 10.167.225.63:6810/1003048 exists,up f57ba6b1-54e9-4bfc-930f-42adbdd036fb
osd.5 up   in  weight 1 up_from 85 up_thru 91 down_at 80 last_clean_interval [65,84) 10.167.225.63:6800/2559 10.167.225.63:6805/1002559 10.167.225.63:6807/1002559 10.167.225.63:6811/1002559 exists,up 583e265c-11c1-4230-81d6-7c9a58d0f463ip

 

其中(TODO)

fsid

The fsid is a unique identifier for the cluster, and stands for File System ID from the days when the Ceph Storage Cluster was principally for the Ceph Filesystem. Ceph now supports native interfaces, block devices, and object storage gateway interfaces too, so fsid is a bit of a misnomer.

 

Peering
The process of bringing all of the OSDs that store a Placement Group (PG) into agreement about the state of all of the objects (and their metadata) in that PG. Note that agreeing on the state does not mean that they all have the latest contents. 使存儲在配置組裏的全部OSD對配置組裏的全部對象(和他們的元數據)的狀態達成一致的過程。注意:狀態的達成一致不表示他們都得到了最新的內容。
Acting Set
The ordered list of OSDs who are (or were as of some epoch) responsible for a particular placement group. OSD(或者一些epoch)的有序集合,這些OSD負責具體的配置組。
Up Set
The ordered list of OSDs responsible for a particular placement group for a particular epoch according to CRUSH. Normally this is the same as the Acting Set, except when the Acting Set has been explicitly overridden via pg_temp in the OSD Map.
OSD負責特定配置組爲了一個根據CRUSH特定epoch的有序列表。一般這與Acting Set相同,除非在OSD映射裏,Acting Set已經經過pg_temp明顯地被重寫了。

Current Interval or Past Interval
A sequence of OSD map epochs during which the Acting Set and Up Set for particular placement group do not change. 在特定的配置組的代理設置和UP設置不會改變的期間,OSD映射epochs的序列。
 
Primary
The member (and by convention first) of the Acting Set, that is responsible for coordination peering, and is the only OSD that will accept client-initiated writes to objects in a placement group. 代理設置的成員(而且第一按照慣例),負責協調同等操做,也是配置組裏惟一的接受客戶端初始寫數據的OSD。
Replica
A non-primary OSD in the Acting Set for a placement group (and who has been recognized as such and activated by the primary). 配置組裏非主要OSD (而且它已被確認爲被主要的OSD激活)。
Stray
An OSD that is not a member of the current Acting Set, but has not yet been told that it can delete its copies of a particular placement group. 不屬於當前Acting Set成員的OSD,但也不是說能夠刪除它的副本。
Recovery
Ensuring that copies of all of the objects in a placement group are on all of the OSDs in the Acting Set. Once Peering has been performed, the Primary can start accepting write operations, and Recovery can proceed in the background.
確保配置組裏全部對象的副本都在Acting Set的全部OSD上。一旦Peering執行,主OSD開始接受寫操做,恢復操做在後臺進行。
 
 
PG Info
Basic metadata about the placement group’s creation epoch, the version for the most recent write to the placement group, last epoch started, last epoch clean, and the beginning of the current interval. Any inter-OSD communication about placement groups includes the PG Info, such that any OSD that knows a placement group exists (or once existed) also has a lower bound on last epoch clean or last epoch started.
配置組建立時期的基本元數據,配置組大部分最新寫入版本,最後epoch開始, 最後epoch 狀態爲clean, 和在當前時間間隔的開始。任何inter-OSD關於配置組的通信包含PG信息,爲了讓任何知道一個配置組存在的(或曾經存在的)OSD也有一個在最後 epoch狀態爲clean或最後一個epoch開始的下限
 
PG Log
A list of recent updates made to objects in a placement group. Note that these logs can be truncated after all OSDs in the Acting Set have acknowledged up to a certain point. 配置組裏對象的最新的更新集合。注意:在Acting Set裏全部OSD到達某個點後,這些日誌會被截斷。
Missing Set
Each OSD notes update log entries and if they imply updates to the contents of an object, adds that object to a list of needed updates. This list is called the Missing Set for that <OSD,PG>.

每一個OSD說明更新日誌條目,若是它們表示更新的對象的內容,增長了該對象所需的更新列表。 這個列表爲了<OSD,PG>調用 Missing Set .

Authoritative History
A complete, and fully ordered set of operations that, if performed, would bring an OSD’s copy of a placement group up to date. 全部操做的有序集合,一旦完成,OSD的副本將到達最新。
Epoch
A (monotonically increasing) OSD map version number。 一個(單調遞增)的OSD映射版本號
 
Last Epoch Start
The last epoch at which all nodes in the Acting Set for a particular placement group agreed on an Authoritative History. At this point, Peering is deemed to have been successful.
擁有爲一個特定的配置組的代理設置裏的全部節點的最後時期,這由Authoritative History所決定的。在這一點上,對等操做被視爲是成功的。
 
up_thru

Before a Primary can successfully complete the Peering process, it must inform a monitor that is alive through the current OSD map Epoch by having the monitor set its up_thru in the osd map. This helps Peering ignore previous Acting Sets for which Peering never completed after certain sequences of failures, such as the second interval below:

  • acting set = [A,B]
  • acting set = [A]
  • acting set = [] very shortly after (e.g., simultaneous failure, but staggered detection)
  • acting set = [B] (B restarts, A does not)

在一個主要部分能順利完成對等的過程以前,它必須經過現有的osd映射Epoch,由在osd映射上設置監視器的up_thru來確認一個狀態爲active監視器。這幫助對等操做那些先前對等操做在一系列的失敗後從沒完成的代理設置,例以下面的第二個時間間隔後:

  • acting set = [A,B]
  • acting set = [A]
  • acting set = [] 以後不久 (好比, 同時失效,但交錯的檢測等)
  • acting set = [B] (B 重啓了, A沒有)
Last Epoch Clean
The last Epoch at which all nodes in the Acting set for a particular placement group were completely up to date (both placement group logs and object contents). At this point, recovery is deemed to have been completed.
最後的版本號,此時配置組的代理設置裏的全部節點已經徹底的到達最新(配置組日誌和對象內容)。此時,能夠認爲恢復成功完成。

 

2、獲取monmap

方法一:所有經過montoolmap工具,優勢是能夠查看指定Monitor的monmap

(1)用montoolmap生成指定的monitors 的map,添加mon能夠經過 --add參數

# monmaptool  --create  --add  mon.a 10.167.225.35:6789  --clobber monmap
monmaptool: monmap file monmap
monmaptool: generated fsid 7c2bd6f1-a32b-462c-8287-a326a46a15c6
monmaptool: writing epoch 0 to monmap (1 monitors)

(2) 使用montoolmap工具查看map

#  monmaptool --print monmap
monmaptool: monmap file monmap
epoch 0
fsid 7c2bd6f1-a32b-462c-8287-a326a46a15c6
last_changed 2016-03-31 18:35:09.778357
created 2016-03-31 18:35:09.778357
0: 10.167.225.35:6789/0 mon.mon.a

 

方法二:獲取全部的monitor的信息

# ceph mon getmap -o monmap.map
got monmap epoch 1

# monmaptool --print monmap.map
monmaptool: monmap file monmap.map
epoch 1
fsid ced59665-9de8-42b7-b2c3-5a19cffe97c7
last_changed 0.000000
created 0.000000
0: 10.167.225.35:6789/0 mon.node1

 

方法3、經過「ceph mon dump」命令

# ceph mon dumpdumped monmap epoch 1epoch 1fsid ced59665-9de8-42b7-b2c3-5a19cffe97c7last_changed 0.000000created 0.0000000: 10.167.225.35:6789/0 mon.node1

相關文章
相關標籤/搜索