# Ceph Object Storage

### Ceph 分散式檔案系統是一套相當成熟的儲存系統, 不僅免費、開放原始碼, 也相當的可靠以及穩定. Ceph 系統不僅僅可以提供平行化的效能, 還有自動備份、資料遷移等等的功能

## 三個節點都要安裝Ceph

![](/files/-LqYbfR8Gjo1z-9uOA84)

![](/files/-LqYbv-VD51IFVeHpmy-)

![](/files/-LqYc4vI11iwi_zcx-iN)

第二台安裝

![](/files/-LqYdPr492Vww68vVy7x)

![](/files/-LqYdhl7eV0oOYhi2CCc)

## 建立osd

![](/files/-LqYgSj2yhluys49TeyU)

![](/files/-LuoGqR38-NgOHXkdPgf)

![](/files/-LuoHOhBpAnf6fj_RllN)

![](/files/-LuoIF42SHrmjmRVx71H)

建立Ceph Pools

![](/files/-Lqj6Pa1sOwzobNQ7Wks)

![](/files/-Lqj6lLd3ByR-ZJZOy9d)

MDS 是 option的，建立 cephFS才需要

![](/files/-LqjJWTbdvlloAKcU3jC)

![](/files/-LqZ4a1KMXOnt4uLc-YX)

**Ceph存儲集群至少需要一個Ceph Monitor，Ceph Manager和Ceph OSD（對象存儲守護進程）。運行Ceph Filesystem客戶端時也需要Ceph元數據服務器（ Metadata Server ）。**

Ceph OSDs: Ceph OSD 守護進程（ceph-osd）的功能是存儲數據，處理數據的復制、恢復、回填、再均衡，並通過檢查其他 OSD 守護進程的心跳來向 Ceph Monitors 提供一些監控信息。冗余和高可用性通常至少需要3個Ceph OSD。當 Ceph 存儲集群設定為有2個副本時，至少需要2個 OSD 守護進程，集群才能達到 active+clean 狀態（ Ceph 默認有3個副本，但你可以調整副本數）。

Monitors: Ceph Monitor（ceph-mon） 維護著展示集群狀態的各種圖表，包括監視器圖、 OSD 圖、歸置組（ PG ）圖、和 CRUSH 圖。 Ceph 保存著發生在Monitors 、 OSD 和 PG上的每一次狀態變更的歷史信息（稱為 epoch ）。監視器還負責管理守護進程和客戶端之間的身份驗證。冗余和高可用性通常至少需要三個監視器。

Managers: Ceph Manager守護進程（ceph-mgr）負責跟蹤運行時指標和Ceph集群的當前狀態，包括存儲利用率，當前性能指標和系統負載。Ceph Manager守護進程還托管基於python的插件來管理和公開Ceph集群信息，包括基於Web的Ceph Manager Dashboard和 REST API。高可用性通常至少需要兩個管理器。

MDSs: Ceph 元數據服務器（ MDS ）為 Ceph 文件系統存儲元數據（也就是說，Ceph 塊設備和 Ceph 對象存儲不使用MDS ）。元數據服務器使得 POSIX 文件系統的用戶們，可以在不對 Ceph 存儲集群造成負擔的前提下，執行諸如 ls、find 等基本命令。

軟體定義儲存，同時支援區塊式儲存、物件式儲存、檔案系統層級儲存

Ceph的底層是叢集式的伺服器環境，若想要擴充儲存容量與使用規模，只需將更多臺伺服器加入叢集即可。而在這樣的環境下，Ceph也具備很高的可靠度，能自動修復和管理，資料也會同時複寫到多臺節點，一旦叢集中的節點發生故障情形時，不會影響整個儲存系統的運作，以及導致資料毀損。

我們可以把 Ceph 的目標可以簡單定義為以下：

* 容易擴充到 PB 級別的儲存容量
* **在不同負載情況下的高效能（每秒輸入/輸出操作數\[IPOS]、帶寬）**

Ceph以單一架構，同時提供物件、區塊、檔案的儲存，藉由RADOS函式庫中介，程式可直接存取底層叢集，並提供物件儲存閘道、區塊儲存裝置來對應存取，也可搭配元資料伺服器來提供檔案系統服務，而底層則是由多個RADOS節點組成的叢集所構成，可橫向擴充數千個節點，並以此提供PB、甚至EB等級的儲存空間。

​

![資料來源：Red Hat、迎棧科技，iThome整理，2015年9月](https://s4.itho.me/sites/default/files/images/730%20%E5%B0%81%E9%9D%A23%20\(P_28_29\)-600-1.png)

RADOS（Reliable, Autonomic Distributed Object Store），顧名思義，它提供了一個可靠、能自我管理的分散式物件儲存區。

![](/files/-Lqocms8JhDl1Nw6pvCa)

狀態是HEALTH\_WARN，Monitor clock skew detected

ceph叢集監控狀態是HEALTH\_WARN， clock skew detected on mon.cephmon154, Monitor clock skew detected

說明2個mon之間的時間相差超過允許值了，需要做同步。

clock skew detected on mon.pve1

Log報錯資訊：

```
mon.pve1 clock skew 0.0668655s > max 0.05s (latency 0.00100117s)
```

【解決方法】在ceph上面/etc/ceph/ceph.conf中設定monitor間的允許時鐘偏移最大值

\[mon]

mon clock drift allowed = 2 #允許在mon之間差多少時間，預設為0.050秒

重啟ceph

\#service ceph restart


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kawsing.gitbook.io/opensystem/andoid-shou-ji/pomoxve/ceph-object-storage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
