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),程序内部会根据可执行程序名称加以区别。
static uint8_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);
return ret;
}
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的存储路径
参考资料:
http://www.gluster.org/community/documentation/index.php/GlusterFS_Concepts