# Storage 相關



# Ceph指令

##### <span style="color: rgb(35, 111, 161);">**\#建立Crush Rule**</span>

  
ceph osd crush rule create-replicated rule-nvme default host nvme  
ceph osd crush rule create-replicated rule-hdd default host hdd  
ceph osd crush rule rm replicated\_rule

#####  

##### <span style="color: rgb(35, 111, 161);">**為HDD Pool建立SSD快取**</span>

  
ceph osd tier add Ceph\_Pool Cache  
ceph osd tier cache-mode Cache writeback  
ceph osd tier set-overlay Ceph\_Pool Cache  
ceph osd pool set Cache hit\_set\_type bloom  
\#ceph osd pool set Cache hit\_set\_count 12  
\#ceph osd pool set Cache hit\_set\_period 14400

ceph osd pool set Cache target\_max\_bytes xxxxxx  
ceph osd pool set Cache target\_max\_objects xxxxxx  
ceph osd pool set Cache min\_read\_recency\_for\_promote 2  
ceph osd pool set Cache min\_write\_recency\_for\_promote 2

ceph osd pool set Cache cache\_target\_dirty\_ratio 0.4  
ceph osd pool set Cache cache\_target\_dirty\_high\_ratio 0.6  
ceph osd pool set Cache cache\_target\_full\_ratio 0.8  
ceph osd pool set Cache cache\_min\_flush\_age 600  
ceph osd pool set Cache cache\_min\_evict\_age 1800

##### <span style="color: rgb(35, 111, 161);">**\#remove Cache Pool**</span>

  
ceph osd tier cache-mode Cache readproxy  
radow -p Cache ls  
radow -p Cache cache-flush-evict-all  
ceph osd tire remove-overlay Ceph\_Pool  
ceph osd tire remove Ceph\_Pool Cache  
ceph delete Cache Cache --yes-i-really-really-mean-it

##### <span style="color: rgb(35, 111, 161);">**\#移除以前是Ceph LVM的Disk Lable**</span>

  
ceph-volume lvm zap /dev/sdX --destroy

##### <span style="color: rgb(35, 111, 161);">**\#確認Ceph 狀態**</span>

  
ceph -s

ceph osd pool stats

#####   
<span style="color: rgb(35, 111, 161);">**\#關閉ceph cluster準備**</span>

  
ceph osd set noout  
ceph osd set nobackfill  
ceph osd set norecover

##### <span style="color: rgb(35, 111, 161);">**\#ceph cluster開機後執行**</span>

  
ceph osd unset noout  
ceph osd unset nobackfill  
ceph osd unset norecover

# ZFS指令

# 設定ZFS使用SSD做Cache與Log

zpool add ZFS\_Pool cache &lt;&lt; /dev/xxxx &gt;&gt;

zpool add ZFS\_Pool log &lt;&lt; /dev/xxxx &gt;&gt;

# 顯示ZFS相關資訊

zfs list

[![image.png](https://mdfk.goddamn.idv.tw/uploads/images/gallery/2024-06/scaled-1680-/ty4image.png)](https://mdfk.goddamn.idv.tw/uploads/images/gallery/2024-06/ty4image.png)

zpool list

[![image.png](https://mdfk.goddamn.idv.tw/uploads/images/gallery/2024-06/scaled-1680-/XJfimage.png)](https://mdfk.goddamn.idv.tw/uploads/images/gallery/2024-06/XJfimage.png)

zpool status

[![image.png](https://mdfk.goddamn.idv.tw/uploads/images/gallery/2024-06/scaled-1680-/G9uimage.png)](https://mdfk.goddamn.idv.tw/uploads/images/gallery/2024-06/G9uimage.png)