案例研究:CEPH 檔案系統

访客 阅读:23 2024-07-14 02:00:46 评论:0
美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址
已完成

Ceph 是一種儲存體系統,其可部署在具有連接磁碟的大型伺服器叢集上。 下列影片介紹 Ceph 背後的基本概念。

Ceph is a storage system that can be deployed in a large web of servers with links to disks. The following video presents the basic concept behind Ceph.

Ceph 的設計目標2 包括下列各項:

圖 6:Ceph 生態系統

Figure 6: Ceph Biological System /em>

再深入探討,Ceph 的結構如下所示:

After further examination, Ceph's structure is as follows:

Ceph architecture.

圖 7:Ceph 結構

Figure 7: Ceph Structures /em >

Ceph 的核心是一種分散式物件儲存系統,稱為 RADOS。 用戶端可使用稱為 librados 的低階 API 直接與 RADOS 互動,此 API 以通訊端為基礎,且支援多種程式設計語言。 或者,用戶端也可以與提供 RADOS 三種不同抽象概念的 3 種較高階 API 互動。

The core of Ceph is a decentralized object storage system called RADOS. Clients can interact directly with RADOS using a low-level API known as librados, based on communication and supporting multiple programming languages. Alternatively, clients can interact with 3 higher-level APIs that provide three different abstract concepts of RADOS.

RADOS Gatewayradosgw 允許用戶端在 HTTP 上透過 REST 式閘道存取 RADOS。 這會模擬 Amazon S3 物件服務,並與使用 Amazon S3 API 或 Openstack SWIFT API 的應用程式相容。

RADOS Gateway or radosgw allow client access to RADOS via RTTP-style RTTP. This simulates Amazon S3 object service and is compatible with applications using Amazon S3 API or Openstack SWIFT API.

RADOS 區塊裝置,簡稱 RBD,會將 RADOS 物件存放區公開為一般用途的分散式區塊裝置,與 SAN 非常相似。 RBD 可供從 RADOS 切分出區塊裝置,掛接在使用核心驅動程式的 Linux 系統上。 RBD 也可作為 Xen、VMWare、KVM 和 QEMU 等熱門虛擬化系統的虛擬磁碟映像使用。

The RADOS block device, short for RBD, will make RADOS objects publicly available for general use as a decentralized block device similar to SAN. RBD can be used to separate blocks from RADOS and hang on Linux systems using the core driver. RBD can also be used as a virtual disk image of hot virtualised systems such as Xen, VMWare, KVM and QEMU.

Ceph FS 是符合 POSIX 規範的分散式檔案系統,位在可直接掛接在 Linux 用戶端檔案系統的 RADOS 分層中。 本頁稍後會詳細討論 Ceph FS。

Ceph FS is a POSIX-compliant decentralized file system located in a RADOS layer that can be attached directly to the Linux client file system. Ceph FS will be discussed in more detail later on this page.

Ceph 的核心是可靠自發的分散式物件存放區 (RADOS)。 在 RADOS 中,資料儲存為分散在機器叢集上的物件。 用戶端透過儲存和擷取物件來與 RADOS 叢集互動。 物件包含物件名稱 (用來識別物件的索引鍵) 以及物件的二進位內容 (與特定物件索引鍵建立關聯的值)。 RADOS 的角色是以可調整、可靠且容錯方式,將物件分散儲存在整個叢集中。

At the heart of Ceph is a reliable spontaneous collection of discrete objects (RADOS) . In RADOS, data is stored as objects scattered over the machine jungle. Clients interact with the RADOS jungle by saving and extracting objects. Objects contain the name of the object (the index key used to identify the object) and the binary content of the object (the value associated with the particular object index key). RADOS acts as a adjustable, reliable and faulty way of storing the object throughout the jungle.

RADOS 叢集有兩種節點類型:物件儲存精靈 (OSD)監視節點 (圖 8)。 OSD 會儲存物件,並回應物件的要求。 OSD 會使用每個節點的本機檔案系統,將這些物件儲存在節點上,並保留緩衝區快取以改善效能。 監視節點會監視叢集狀態以追蹤進入和離開叢集的 OSD。

There are two types of nodes in the RADOS jungle: objects save elves (OSD) and monitor nodes (figure 8). OSD will save objects and respond to objects. OSD will use its own file system for each node to store them on nodes and keep buffers fast to improve efficiency.

FRADOS Architecture. OSDs are responsible for data on a node (typically one OSD is deployed per physical disk). The nodes marked in M are the Monitor nodes.

圖 8:RADOS 結構。 OSD 負責節點上的資料 (通常每個實體磁碟會部署一個 OSD)。 標記為 M 的節點就是監視節點。

graph 8: RADOS structure. OSD is responsible for data on nodes (normally every real disk will deploy an OSD). Node marked M is a monitoring node.

RADOS 叢集的狀態會封裝到稱為叢集對應的物件中,供叢集中的所有節點共用。 叢集對應包含任何指定時間的叢集狀態相關資訊,包括目前存在的 OSD 數目、如何在 OSD 間散發資料的精簡標記法 (將於下一節詳細討論),以及指出建置此叢集對應時間的邏輯時間戳記。 監視節點會以對等累加方式更新叢集對應。 這表示在叢集的節點間,只會通訊一個時間戳記到另一個時間戳記的叢集對應變更,以保持節點之間的資料傳輸量小。

The status of the RADOS jungle will be enclosed to an object known as for all nodes of the jungle. The jungle will be shared with all nodes of the jungle. The jungle will be concerned with information related to the state of the jungle that contains any specified time, including the number of OSDs currently in existence, the simple marking of how to distribute data between OSDs (which will be discussed in detail in the next section), and the logical time stamping of the time to build the jungle.

RADOS 中監視器會儲存叢集對應的主要複本,並在 OSD 狀態發生變更時送出定期更新,以共同負責管理儲存系統。 監視器是根據 paxos 演算法組織,需要大部分的監視器來讀取或更新叢集對應。 這些監視器會確保對應更新已序列化且一致。 RADOS 叢集設計為擁有少量 (>3) 且通常是奇數的監視器,以確保當個別監視器必須取得共識時,不會平手。

The RADOS monitor will store the main copy of the jungle set and send it regularly updated when the OSD state changes to manage the storage system. The monitor is based on the paxos algorithm, which requires most of the monitors to read or update the bush set. These monitors will ensure that the update is sequenced and consistent. RADOS jungle design is designed to have a small (> 3) and usually odd number of monitors to ensure that when a particular monitor must have a common understanding, it will not be even.

為使分散式物件儲存體正常運作,用戶端必須能夠連絡正確的 OSD,才能與物件互動。 首先,用戶端會連絡監視器,以擷取指定儲存叢集的叢集對應。 叢集對應所包含資訊,可用於判斷負責叢集中特定物件的確切 OSD。

In order for a dispersed object to function properly, the user must be able to connect to the correct OSD to interact with the object. First, the client will contact the monitor to extract the stock of the specified stock. The information contained in the stock is used to determine the exact amount of OSD that is responsible for the concentration of specific objects in the jungle.

第一個步驟是決定特定物件的放置群組 (圖 9)。 您可將放置群組想像為物件所在的貯體。 這會使用雜湊函式來完成 (要使用的最新雜湊函式一律從叢集對應取得)。 決定了指定物件的放置群組之後,用戶端就必須尋找負責該放置群組的 OSD。

The first step is , which determines the placement of a particular object, (figure 9). You can place the group as the body in which the object is located. This will be done by using a miscellaneous function (the latest hybrid to be used is always obtained from the jungle counterpart). After determining the placement of the specified object, the client will have to find the OSD responsible for the placement of the group.

Locating an Object to a Placement Group and finally to an OSD using the CRUSH algorithm.

圖 9:使用 CRUSH 演算法依序找到物件和放置群組,最終找到 OSD。

Chart 9: Find objects and place groups in sequence using the CRUSH algorithm and eventually find OSD.

將放置群組指派給 OSD 所用的演算法,稱為 可調整雜湊下的受控制複寫 (Controlled Replication Under Scalable Hashing,CRUSH)1 演算法 (圖 9)。 CRUSH 會以似隨機但確定性的方式,將放置群組指派到全叢集。 當 OSD 進入或離開叢集時,CRUSH 會確保大部分的放置群組都留在原位,只轉移少量的資料以維持分佈平衡,就此而言,CRUSH 比雜湊函式更穩定。 另一方面,簡單的雜湊函式則需要在新增或移除貯體時,重新分配大部分的索引鍵。 CRUSH 演算法的完整說明不在本文討論範圍內。 感興趣的讀者請參閱 CRUSH:以受控制的可調整分散式方法放置複寫資料

The group is assigned to the algorithms used by the OSD, known as , the controlled duplicates (Contorted University Natural Hashing, CRUSH)

當物件名稱雜湊至放置群組時,CRUSH 會產生一份負責放置群組的確切 r OSD 清單。 r 在此表示指定物件的複本數。 根據叢集對應的資訊找到此對應內作用中 OSD,然後可連絡該 OSD 以與指定的物件互動 (例如建立、讀取、更新、刪除等操作)。

When the object name is mixed to the placement group, CRUSH produces a list of r OSDs that are responsible for placing the group. r here indicates the number of copies of the specified object. Based on the information from the stockset, an OSD is found in this context, which can then be linked to the OSD to interact with the specified object (e.g. to create, read, update, delete, etc.).

在 RADOS 中,物件會在多個與該物件放置群組建立關聯的 OSD 中複寫。 這可確保當某些 OSD 失敗時,仍有多份特定物件的複本。 RADOS 有多個可實際執行複寫的可用配置:主要複本展開複寫配置 (圖 10)。

In RADOS, objects are copied in multiple OSDs associated with the placement of the object group. This ensures that when some OSDs fail, there are still multiple copies of specific objects. RADOS has several practical available configurations: main copy, chain and expand (figure 10).

The replication modes supported in RADOS.

圖 10:RADOS 支援的複寫模式。 (來源 2)

. (Source

圖 11: RADOS 的 Ack 與認可訊息(來源 2)

Image 11: Ack and recognition (source )

RADOS 的每則訊息 (來自用戶端的訊息以及節點中對等訊息) 都標有時間戳記,以確保依一致的方式排列及套用訊息。 如果 OSD 因訊息要求者的過期叢集對應而偵測到錯誤訊息,就會傳送累加對應更新,讓訊息要求者保持在最新狀態。

Every RADOS message (from a client and peer-to-peer message in a node) is marked with a time stamp to ensure that the message is arranged and applied in a consistent manner. If an OSD detects a wrong message because of an end-of-life stocking by the requester, it sends a cumulative update to keep the message requester up to date.

在一些極端案例中,您必須謹慎處理 RADOS 提供的嚴格一致性保證。 如果特定 OSD 的放置群組對應有所變更 (叢集對應發生變更時),則系統必須確保以無縫且一致的方式來完成新舊 OSD 之間的放置群組交付。 在放置群組變更期間,新 OSD 需要連絡舊 OSD 以移交狀態,在此期間,舊 OSD 會發現變更並停止回應對這些特定放置群組的查詢。

In some extreme cases, you must be careful to deal with the strict consistency assurances provided by RADOS. If a particular OSD placement group changes (when the jungle changes), the system must ensure that the placement group delivery between the old and the new OSD is performed seamlessly and consistently. During the placement group change, the new OSD needs to connect with the old OSD to transfer status, during which time the former OSD will find the changes and stop responding to queries about these particular placement groups.

另一種難以達成嚴格一致性保證的情況,就是導致網路磁碟分割的網路故障。 在此情況下,有些具有舊叢集對應的用戶端可能會繼續在該 OSD 上執行讀取作業,但已更新對應可能會變更負責該放置群組的 OSD。 請回想一下,這是先前針對 CAP 定理的討論中,特別提到的失敗案例。 在此情況下,一定會有此不一致期間。 RADOS 會要求所有 OSD 以預設 2 秒的間隔,與其他複本傳送活動訊號,以降低此情節造成的影響。 如果特定 OSD 無法在特定閾值內與其他複本群組連繫,則會封鎖其讀取。 此外,指派給特定放置群組以作為新的主要 OSD,應該會收到來自舊放置群組主要 OSD 的移交通知,或等候活動訊號間隔,以假設舊放置群組的主要 OSD 已停止運作。 如此一來,在網路磁碟分割的情況下,就能減少 RADOS 叢集中潛在的不一致期間。

RADOS will require all OSDs to preset a 2-second gap between the former group of major OSDs, or to wait for the event, to mitigate the impact of this scenario. If a particular OSD cannot connect with other groups of repeaters within a given value, it will block its reading.

當指派 OSD 給放置群組,或 OSD 與監視器節點之間的通訊失敗時,便會偵測到 RADOS 中的節點失敗。 如果節點無法在有限的重新連線嘗試次數內回應,則會將其宣告為失效。 放置群組中的 OSD 會交換活動訊號訊息,以確保能夠偵測到失敗。 這會讓監視器節點引導更新叢集對應,並透過累加式對應更新訊息通知所有節點。 更新叢集對應之後,OSD 會互相交換物件,以確保為每個放置群組維持所需的複本數目。 如果 OSD 透過已宣告為失效的訊息進行探索,就會將其緩衝區同步處理至磁碟並自行終止,以確保行為是一致的。

If an OSD is assigned to place a group, or if a communication between an OSD and the monitor node fails, the node in RADOS is detected to fail. If node fails to respond in a limited number of reconnection attempts, it is declared invalid. If an OSD in the group swaps the activity message to make sure that it is detected. This will enable the monitor node to lead the update to theset and to notify all nodes of the update through an incremental approach.

如上圖所示,Ceph FS 是 RADOS 儲存體系統上的抽象層。 RADOS 除了物件名稱以外,沒有任何物件中繼資料的概念。 Ceph 檔案系統可供檔案中繼資料在儲存於 RADOS 中的個別檔案物件之上進行分層。 下列影片會說明 CephFS 的概念。

As shown in the figure above, Ceph FS is the abstract layer on the RADOS storage system. RADOS does not have any item metadata concept except for the object name. The RADOS file system allows the file metadata to be layered over a separate file object stored in RADOS. The following video describes the CephFS concept.

除了 OSD 與監視器的叢集節點角色之外,Ceph FS 也引進中繼資料 (MDS) 伺服器 (圖12)。 這些伺服器會儲存檔案系統中繼資料 (目錄樹狀結構,以及每個檔案的存取控制清單和權限、模式、擁有權資訊和時間戳記)。

In addition to the OSD and monitor's jungle node role, Ceph FS is also introduced into metadata (MDS) servers (figure 12). These servers store metadata in the file system (directorial tree structure, access control lists and rights, mode, ownership information and time stampes for each file).

Metadata servers in the Ceph file system.

圖 12:Ceph 檔案系統中的中繼資料伺服器

Diagram 12: Metadata Server in Ceph File System

Ceph FS 所使用中繼資料,與本機檔案系統所使用中繼資料,有一些不同的地方。 請回想一下,Inode 會在本機檔案系統中描述檔案,其中包含指向檔案資料區塊的指標清單。 本機檔案系統中目錄是具有連結至其他 Inode 的特殊檔案,而這些 Inode 亦可能為其他目錄或檔案。 在 Ceph FS 中,中繼資料伺服器中目錄物件包含內嵌在其中的所有 Inode。

The metadata used by Ceph FS are somewhat different from the metadata used by the current file system. Please recall that Inode describes files in the current file system and contains a list of icons pointing to file data blocks. The folders in this system are special files connected to other Inodes, and these Inodes may be other directories or files. In Ceph FS, the metadata server contains all Inodes embedded in them.

在一開始,單一中繼資料伺服器會負責叢集的整個中繼資料。 當中繼資料伺服器新增至叢集時,檔案系統的目錄樹狀結構會進行分割,並指派給所產生的中繼資料伺服器群組 (圖13)。 每個 MDS 都會使用計數器來測量其目錄階層中的中繼資料普及程度。 加權配置3不僅用於更新目錄中特定分葉節點的計數器,亦會用於更新該目錄直到根的上階項目。 因此,每個 MDS 都能夠保留中繼資料中的作用區清單,以便在新增至叢集時移至新的 MDS。

At the outset, the single metadata server will be responsible for the entire metadata collection. When the metadata server is newly added to the jungle, the folder tree structure of the file system will be divided and assigned to the resulting metadata server group (figure 13). Each MDS will use a calculator to measure the extent of its metadata availability in the catalogue. The power configuration

Dynamic subtree partitioning in the Ceph file system.

圖 13:Ceph 檔案系統中的動態樹狀子目錄分割

Diagram 13: The dynamic tree folder in the Ceph filesystem splits

Ceph FS 中的中繼資料伺服器通常會快取記憶體中的中繼資料資訊,並在記憶體不足時處理大多數要求。 此外,MDS 伺服器也會使用一種日誌的形式,其中更新會作為日誌物件往下遊傳送到 RADOS,並在每個中繼資料伺服器中將其寫出。 在中繼資料伺服器失敗的情況下,可以重送日誌,以在新 MDS 或現有 MDS 上重建樹狀結構中失敗的 MDS 伺服器部分。

In addition, the MDS server will also use a journal in which updates will be sent down to RADOS as journal objects and written in every metadata server. In the event of failure of the metadata server, the journal can be sent back to restore the failure of the MDS server part of the tree structure on the new MDS or on the existing MDS.


  1. 威爾,S.,布蘭特,S.A.,米勒,E.L.,和瑪律扎恩,C.(2006年)。 CRUSH: Controlled, scalable, decentralized placement of replicated data (CRUSH:複寫資料的受控制、可調整及分散式位置) 2006 年 ACM/IEEE 超級運算會議發表文章 122 頁
  2. 威爾,S.,布蘭特,S.A.,米勒,E.L.,和瑪律扎恩,C.(2006年)。 Ceph: A scalable, high-performance distributed file system (Ceph:可調整的高效能分散式檔案系統) 第 7 屆作業系統設計與實作 (OSDI) 座談會發表文章 307-320 頁
  3. 威爾,美國,波拉克,K.T.,布蘭特,S.,美國,和米勒,E.L.(2004年)。 Dynamic metadata management for petabyte-scale file systems (PB 規模檔案系統的動態中繼資料管理) 2004 年 ACM/IEEE 超級運算會議發表文章 4 頁

1.

就核心而言,Ceph 是:

At the core, Ceph is:

2.

撰寫使用 Ceph 儲存體叢集的應用程式時,開發人員受限於 RADOSGW、RBD 或 CephFS API。

The developers are limited to RADOSGW, RBD, or CephFS API when writing applications using Ceph to store the jungle.

文字格式和图片示例

注册有任何问题请添加 微信:MVIP619 拉你进入群

弹窗与图片大小一致 文章转载注明 网址:
https://netpsp.com/?id=70281

美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址
可以去百度分享获取分享代码输入这里。
声明

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

发表评论
平台列表
美化布局示例

欧易(OKX)

  全球官网 大陆官网

币安(Binance)

  官网

火币(HTX)

  官网

Gate.io

  官网

Bitget

  官网

deepcoin

  官网
关注我们

若遇到问题,加微信客服---清歌

搜索
排行榜
扫一扫,加我为微信好友加我为微信好友