Ceph開發者月報2019年4月版
本期看點:
librbd 新增 write-around,並作為默認緩存策略
introduce new default write-around cache policy #27229
本篇為 2019 年度《Ceph 開發者月報》專欄的第四篇,在《Ceph 開發者月報》中,我們 UMCloud 存儲團隊將以月度為單位,為大家分享當月 Ceph 社區的有趣的提交和重要的變更,方便大家即刻掌握一手 Ceph 社區開發資料。
每篇將以對象存儲、塊存儲、統一存儲層、集羣管理、基礎庫等模塊組織,為大家一一介紹。
對象存儲
pubsub 機制提供兼容 S3 的 API
S3 compatible pubsub API #27091(https://github.com/ceph/ceph/pull/27091)
塊存儲
1.librbd 新增 write-around,並作為默認緩存策略
introduce new default write-around cache policy #27229(https://github.com/ceph/ceph/pull/27229)
之前為默認為 write-back。
繞寫模式的好處是繞過緩存,直接寫後端數據,緩存失效後再刷新一遍,保證最終落盤的數據是正確的。這個可以讓 librbd 在 OSD 請求過程中可以立即完成寫 IO。後續的 flush 請求則會確保所有在處理過程中的寫IO 都會在請求結束前完成。
新增選項 rbd_cache_policy,可以設置為 writethrought、writeback、writearound 任一種模式
2. 刪除 parent image 時可以選擇將其移入回收站,這樣在與之相關的最後一個 clone image 被刪除時,該 parent image 會被自動刪除
librbd: optionally move parent image to trash on remove #27521(https://github.com/ceph/ceph/pull/27521)
相關命令:
rbd rm {parent-image} --rbd-move-parent-to-trash-on-remove=true
3. 從 EC data pool 創建的 RBD 鏡像支持稀疏化
librbd: support EC data pool images sparsify #27268(https://github.com/ceph/ceph/pull/27268)
統一存儲層
1. 基於 seastar 重構 OSD 的工作推進
crimson/net: lossy connection for ProtocolV2 #26710(https://github.com/ceph/ceph/pull/26710)
crimson: enable cephx for v2 msgr #27514 (https://github.com/ceph/ceph/pull/27514)
2. 新增兩個 bluestore 的健康警告: BLUESTORE_LEGACY_STATFS 和BLUESTORE_DISK_SIZE_MISMATCH
os/bluestore: introduce legacy statfs and dev size mismatch alerts #27519(https://github.com/ceph/ceph/pull/27519)
- BLUESTORE_LEGACY_STATFS
Nautilus 版本的 bluestore 會以存儲池為粒度跟蹤內部使用統計。如果有 OSD 使用在 Nautilus 版本前創建的 bluestore 卷,可能導致 ceph df 統計不準確。
可以停掉這些OSD,repair 後重啟,即可更新:
systemctl stop ceph-osd@123
ceph-bluestore-tool repair --path /var/lib/ceph/osd/ceph-123
systemctl start ceph-osd@123
bluestore_warn_on_legacy_statfs 選項可以開啟或關閉提醒檢測到舊版 bluestore 統計的告警。
- BLUESTORE_DISK_SIZE_MISMATCH
塊設備大小和 free list manager 檢測的大小不匹配會出現該警告。有問題的 OSD 需要重新部署,否則以後可能會掛掉。
集羣管理
為 Ceph 集羣添加默認的 Prometheus Alert 告警規則
monitoring: Prometheus default alerts #27596 (https://github.com/ceph/ceph/pull/27596)
基礎工具集
1. 為 CRUSH node 設置 no{out,down,in,out} flags
mon,osd: add no{out,down,in,out} flags on CRUSH nodes #27563(https://github.com/ceph/ceph/pull/27563)
之前只能為 OSD 設置 noout, nodown, noin, noout flag, 現在可以為 CRUSH node 設置了