資源池建立 cephfs建立

2021-10-04 04:32:59 字數 1954 閱讀 1594

ceph osd crush add-bucket test_root root  #建立根

ceph osd crush add-bucket test_host1 host #建立host

ceph osd crush add-bucket test_host2 host #建立host

ceph osd crush move test_host1 root=test_root #把test_host1加入根

ceph osd crush move test_host2 root=test_root #把test_host2加入根

ceph osd crush move test_host3 root=test_root #把test_host3加入根

ceph osd crush add osd.0 1 root=test_root host=test_host1  #給test_host1新增osd,權重1

ceph osd crush add osd.1 1 root=test_root host=test_host1  #給test_host1新增osd,權重1

ceph osd crush add osd.2 1 root=test_root host=test_host1  #給test_host1新增osd,權重1

執行完以上命令就形成了乙個樹狀結構

test_root

||   |   |

|     |     |

test_host1 test_host2 test_host3

|        |         |

osd.0    osd.1    osd.2

1)副本規則

ceph osd crush rule create-****** test_rule test_root host firstn  #建立test_rule 規則,型別為副本

ceph osd pool create test_pool 64 test_rule #建立test_pool

ceph osd pool set test_pool size 1 #設定副本數

2)erasure code規則:

ceph osd erasure-code-profile set $profile_name k=2 m=1 crush-failure-domain=host crush-root=test_root #建立profile策略,2+1,故障域crush-failure-domain為host,可已設定為osd 

規則建立

ceph osd crush rule create-erasure $rule_name $profile_name

根據profile和rule建立ec-pool:

ceph osd pool create $pool_name $pg_num $pg_num erasure $profile_name $rule_name

設定ec overwrite特性        

ceph osd pool set $pool_name allow_ec_overwrites 1 --yes-i-really-mean-it 

ceph fs new

ceph-deploy mds create node1,node2,node3

mount -t ceph "$mon_host":/ "$local_mount_path"  -o mds_namespace="$local_cephfs_name",name=admin,secret="$local_secret"

#mon_host

是mon節點的ip

#local_mount_path是想掛載的目錄,需要提前建立好

#local_cephfs_name

是cephfs的名稱

#local_secret

的內容是cat /etc/ceph/ceph.client.admin.keyring裡面key的值

cephfs建立及掛載

cephfs建立及掛載 ceph 檔案系統 ceph fs 是個 posix 相容的檔案系統,它使用 ceph 儲存集群來儲存資料。ceph 檔案系統要求 ceph 儲存集群內至少有乙個 ceph 元資料伺服器。1 新增mds,接上篇,這裡把ceph01節點作為元資料伺服器mds。ceph depl...

Cephfs建立及掛載

ceph 檔案系統 ceph fs 是個 posix 相容的檔案系統,它使用 ceph 儲存集群來儲存資料。ceph 檔案系統要求 ceph 儲存集群內至少有乙個 ceph 元資料伺服器。1 新增mds,接上篇,這裡把ceph01節點作為元資料伺服器mds。ceph deploy mds creat...

ceph資源池建立命令

下面總結了一下ceph 資源池建立相關的命令 1 建立group ceph osd crush add bucket root 2 建立host ceph osd crush add bucket host 3 將host移入group ceph osd crush move root 4 給hos...