新聞中心
這篇文章給大家分享的是有關(guān)分布式存儲(chǔ)ceph如何實(shí)現(xiàn)對(duì)象存儲(chǔ)配置zone同步的內(nèi)容。小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,一起跟隨小編過來看看吧。
一、架構(gòu):
Ceph天生帶兩地三中心概念,我們要去的雙活就是兩個(gè)數(shù)據(jù)中心,Ceph兩數(shù)據(jù)中心可以在一個(gè)集群也可以在不同的集群中。
二,概念:
zone:包含多個(gè)RGW實(shí)例的一個(gè)邏輯概念。zone不能跨集群。同一個(gè)zone的數(shù)據(jù)保存在同一組pool中。
zonegroup:一個(gè)zonegroup如果包含1個(gè)或多個(gè)zone。如果一個(gè)zonegroup包含多個(gè)zone,必須指定 一個(gè)zone作為master zone,用來處理bucket和用戶的創(chuàng)建。一個(gè)集群可以創(chuàng)建多個(gè)zonegroup,一個(gè)zonegroup也可以跨多個(gè)集群。
realm:一個(gè)realm包含1個(gè)或多個(gè)zonegroup。如果realm包含多個(gè)zonegroup,必須指定一個(gè)zonegroup為master zonegroup, 用來處理系統(tǒng)操作。一個(gè)系統(tǒng)中可以包含多個(gè)realm,多個(gè)realm之間資源完全隔離。
RGW多活方式是在同一zonegroup的多個(gè)zone之間進(jìn)行,即同一zonegroup中多個(gè)zone之間的數(shù)據(jù)是完全一致的,用戶可以通過任意zone讀寫同一份數(shù)據(jù)。 但是,對(duì)元數(shù)據(jù)的操作,比如創(chuàng)建桶、創(chuàng)建用戶,仍然只能在master zone進(jìn)行。對(duì)數(shù)據(jù)的操作,比如創(chuàng)建桶中的對(duì)象,訪問對(duì)象等,可以在任意zone中 處理。
三、在Cluster1集群上配置master zone
創(chuàng)建realm
radosgw-admin realm create --rgw-realm=earth --default創(chuàng)建master zonegroup
先刪除默認(rèn)的zonegroup
radosgw-admin zonegroup delete --rgw-zonegroup=default
創(chuàng)建一個(gè)為china的zonegroup
radosgw-admin zonegroup create --rgw-zonegroup=china --endpoints=ceph-1:7480 --master --default創(chuàng)建master zone
先刪除默認(rèn)的zone
adosgw-admin zone delete --rgw-zone=default創(chuàng)建一個(gè)為huabei的zone
radosgw-admin zone create --rgw-zonegroup=china --rgw-zone=huabei --endpoints=ceph-1:7480 --default --master創(chuàng)建一個(gè)system賬戶用于和huadong zone同步
radosgw-admin user create --uid="sync-user" --display-name="sync user" --system
用創(chuàng)建system賬戶產(chǎn)生的access 和secret更新zone配置
radosgw-admin zone modify --rgw-zone=huabei --access-key={access-key} --secret={secret}更新period
radosgw-admin period update --commit
配置ceph.conf
[client.rgw.ceph-1]
host = ceph-1
rgw frontends = "civetweb port=7480"
rgw_zone=huabei
四、在Cluster2集群上配置slave zone
從master zone拉取realm
radosgw-admin realm pull --url=ceph-2:7480 --access-key={access-key} --secret={secret}
注意:這里的access key 和secret是master zone上system 賬戶的access key和secret
拉取period
radosgw-admin period pull --url=ceph-2:7480 --access-key={access-key} --secret={secret}
注意:這里的access key 和secret是master zone上system 賬戶的access key和secret
創(chuàng)建slave zone
radosgw-admin zone create --rgw-zonegroup=china --rgw-zone=huadong \
--access-key={system-key} --secret={secret} \
--endpoints=ceph-2:7480
注意:這里的access key 和secret是master zone上system 賬戶的access key和secret
更新period
radosgw-admin period update --commit
注意:如果出現(xiàn)認(rèn)證錯(cuò)誤,重啟master zone的實(shí)例服務(wù)
配置ceph.conf
[client.rgw.ceph-2]
host = ceph-2
rgw frontends = "civetweb port=7480"
rgw_zone=huadong
五、驗(yàn)證zone之間數(shù)據(jù)同步
在secondary zone節(jié)點(diǎn)執(zhí)行
radosgw-admin sync status在master zone節(jié)點(diǎn)上創(chuàng)建用戶
radosgw-admin user create --uid="testuser" --display-name="First User"用s3客戶端 創(chuàng)建桶,并put 對(duì)象
注意: 在slave zone節(jié)點(diǎn)上也要?jiǎng)?chuàng)建相同的用戶才會(huì)看到創(chuàng)建的桶,和上傳的對(duì)象。
感謝各位的閱讀!關(guān)于“分布式存儲(chǔ)ceph如何實(shí)現(xiàn)對(duì)象存儲(chǔ)配置zone同步”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,讓大家可以學(xué)到更多知識(shí),如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到吧!
網(wǎng)站標(biāo)題:分布式存儲(chǔ)ceph如何實(shí)現(xiàn)對(duì)象存儲(chǔ)配置zone同步-創(chuàng)新互聯(lián)
網(wǎng)頁網(wǎng)址:http://www.dlmjj.cn/article/djdjde.html