1. 程式人生 > >glusterfs的一些基本知識

glusterfs的一些基本知識

1. 基本概念

(1) brick:The brick is the storage filesystem that has been assigned to a volume.

(2) subvolume:A brick after being processed by at least one translator.

(3) volume:The final share after it passes through all the translators.

(4) translator:A translator connects to one or more subvolumes, does something with them, and offers a subvolume connection.

(理解不夠深刻,翻譯不夠準確,直接上原文,哈哈)

2. 不同的volume

distributed volumes: 分散式卷,檔案在不同的brick上儲存

replicated volumes: 複製卷,檔案冗餘儲存在所有brick上(複製個數與brick個數相等)


striped volumes: 條帶卷,同一個檔案分塊儲存在不同的brick上

distributed replicated volumes: 分散式複製卷,volume中的brick組成不同的"區域",每個"區域"內有多個brick(由replica指定),檔案儲存在不同的"區域"中,但是在"區域"中各brick上冗餘儲存。因此這種volume中,brick的個數必須是複製份數的倍數個(brickNum = n * replicaCount),此外還要注意,brick的順序決定了哪幾個會組成一個"區域"。

distributed striped volumes: 分散式條帶卷,與分散式複製卷類似,區別是同一檔案分塊儲存在一個"區域"內的不同brick上。

3. 可執行程式

glusterfs安裝後,會有gluster,glusterd,glusterfs,glusterfsd這麼幾個可執行程式,其作用分別為:

gluster:Glusterfs控制檯管理程式(Gluster Console Manager),可以以命令形式或者互動式形式對glusterfs中的volume,brick,叢集節點等資訊進行檢視及操作(增,刪,改)。

glusterd:軟連結指向glusterfsd,Glusterfs的管理程序,負責處理來自gluster的命令。

glusterfs:軟連結指向glusterfsd,Glusterfs自帶的客戶端

glusterfsd:Glusterfs服務端程式

注:glusterd,glusterfs,glusterfsd為最終是運行同一個程式(glusterfsd),程式內部會根據可執行程式名稱加以區別。

?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 staticuint8_t gf_get_process_mode (char*exec_name) { char*dup_execname = NULL, *base = NULL; uint8_t ret = 0; dup_execname = gf_strdup (exec_name); base = basename (dup_execname); if(!strncmp (base, "glusterfsd", 10)) { ret = GF_SERVER_PROCESS; }else if (!strncmp(base, "glusterd", 8)) { ret = GF_GLUSTERD_PROCESS; }else { ret = GF_CLIENT_PROCESS; } GF_FREE (dup_execname); returnret; }

4. 其他

(1) {path} or a prefix of it is already part of volume

有時候在增加volume時(3.3.1版本),出現這個列印,導致無法新增volume(原因未知,據說是BUG)

解決的辦法是:

setfattr -x trusted.glusterfs.volume-id $brick_path

setfattr -x trusted.gfid $brick_path

rm -rf $brick_path/.glusterfs

注:$brick_path為brick的儲存路徑

參考資料: