At time T2 a new file File2 was created. This will trigger the xtime marking (where xtime is the current timestamp) from File2 upto to the root, i.e, the xtime of File2, Dir3, Dir1 and finally Dir0 all will be updated.
时间 T2 创建了一个新的文件 File2。这将触发 xtime 标记 (其中 xtime 是当前时间戳) 从 File2 到根, i. e, xtime File2, Dir3, Dir1 和最后 Dir0 都将更新。
Geo-replication daemon crawls the file system based on the condition that xtime(master) > xtime(slave). Hence in our example it would crawl only the left part of the directory structure since the right part of the directory structure still has equal timestamp. Although the crawling algorithm is fast we still need to crawl a good part of the directory structure.
地理复制守护进程基于 xtime (主) > xtime (从属) 的条件对文件系统进行爬网。因此, 在我们的示例中, 它只抓取目录结构的左部分, 因为目录结构的右部分仍然具有相等的时间戳。虽然爬行算法是快速的, 我们仍然需要抓取一个很好的部分的目录结构。
2.Replication - We use rsync for data replication. Rsync is an external utility which will calculate the diff of the two files and sends this difference from source to sync.
复制-我们使用 rsync 进行数据复制。rsync 是一个外部实用程序, 它将计算两个文件的差异, 并从源发送到同步。
2.4 Overall working of GlusterFS glusterfs 的整体工作
As soon as GlusterFS is installed in a server node, a gluster
management daemon(glusterd) binary will be created. This daemon should
石家庄众毅信息技术有限公司共47页第20页
be running in all participating nodes in the cluster. After starting glusterd, a trusted server pool(TSP) can be created consisting of all storage server nodes (TSP can contain even a single node). Now bricks which are the basic units of storage can be created as export directories in these servers. Any number of bricks from this TSP can be clubbed together to form a volume.
一旦 GlusterFS 安装在服务器节点中, 就会创建一个 Gluster 管理守护进程 (glusterd) 二进制文件。此守护进程应在群集中的所有参与节点中运行。启动 glusterd 后, 可以创建一个受信任的服务器池 (tsp), 由所有存储服务器节点组成 (tsp 甚至可以包含单个节点)。现在, 作为基本存储单元的砖块可以在这些服务器中创建为导出目录。任何数量的砖块从这个 tsp 可以杵在一起, 形成一个volume。
Once a volume is created, a glusterfsd process starts running in each of the participating brick. Along with this, configuration files known as vol files will be generated inside /var/lib/glusterd/vols/. There will be configuration files corresponding to each brick in the volume. This will contain all the details about that particular brick. Configuration file required by a client process will also be created. Now our filesystem is ready to use. We can mount this volume on a client machine very easily as follows and use it like we use a local storage:
一旦创建了卷, glusterfsd 进程就开始在每个参与的砖块中运行。同时, 配置文件称为卷文件将在 /var/lib/glusterd/vols/生成。将有对应于卷中每个砖块的配置文件。这将包含有关该特定砖块的所有细节。还将创建客户端进程所需的配置文件。现在, 我们的文件系统已经准备好使用了。我们可以很容易地在客户机上安装此卷, 就像使用本地存储一样:
mount.glusterfs `
ip 或主机名可以是在其中创建所需卷的受信任服务器池中的任何节点的。
When we mount the volume in the client, the client glusterfs process communicates with the servers’ glusterd process. Server glusterd process sends a configuration file (vol file) containing the list of client translators and another containing the information of each brick in the volume with the help of which the client glusterfs process can now directly communicate with each brick’s glusterfsd process. The setup is now complete and the volume is now ready for client's service.
当我们在客户端中装入卷时, 客户端 glusterfs 进程与服务器的 glusterd 进程进行通信。服务器 glusterd 进程发送一个配置文件 (卷文件), 其中包含客户端转换器的列表, 另一个包含卷中每个砖块的信息, 客户端 glusterfs 进程现在可以直接与每个砖块的 glusterfsd 过程进行通信。现在, 安装程序已完成, 卷已准备就绪, 可供客户端使用。
石家庄众毅信息技术有限公司共47页第21页
When a system call (File operation or Fop) is issued by client in the mounted filesystem, the VFS (identifying the type of filesystem to be glusterfs) will send the request to the FUSE kernel module. The FUSE kernel module will in turn send it to the GlusterFS in the userspace of the client node via /dev/fuse (this has been described in FUSE section). The
GlusterFS process on the client consists of a stack of translators called the client translators which are defined in the configuration file(vol file) sent by the storage server glusterd process. The first among these translators being the FUSE translator which consists of the FUSE library(libfuse). Each translator has got functions corresponding to each file operation or fop supported by glusterfs. The request will hit the corresponding function in each of the translators. Main client translators include:
当系统调用 (文件操作或 fop) 由客户端在装入的文件系统中发出时, vfs (识别要 glusterfs 的文件系统类型) 将向 FUSE内核模块发送请求。 FUSE内核模块将反过来发送到 GlusterFS 在用户的客户端通过/开发/保险丝 (这已被描述在 FUSE部分)。客户端上的 GlusterFS 进程由由存储服务器 glusterd 进程发送的配置文件 (卷文件) 中定义的一个称为客户端翻译器的堆栈组成。在这些译者中, 第一个是由 FUSE (libfuse) 组成的 FUSE转换器。每个翻译都有对应于每个文件操作或 fop 支持的 glusterfs。请求将在每个翻译器中命中相应的函数。主要客户翻译包括:
FUSE translator ? DHT translator- DHT translator maps the request to the correct brick that contains the file or directory required.
? AFR translator- It receives the request from the previous
translator and if the volume type is replicate, it duplicates the request and passes it on to the Protocol client translators of the replicas.
?
石家庄众毅信息技术有限公司共47页第22页
?
Protocol Client translator- Protocol Client translator is the last in the client translator stack. This translator is divided into multiple threads, one for each brick in the volume. This will directly communicate with the glusterfsd of each brick.
In the storage server node that contains the brick in need, the request again goes through a series of translators known as server translators, main ones being:
Protocol server translator ? POSIX translator
?
The request will finally reach VFS and then will communicate with the underlying native filesystem. The response will retrace the same path.
该请求最终将到达 vfs, 然后与底层本机文件系统进行通信。响应将折回相同的路径。
石家庄众毅信息技术有限公司共47页第23页
第3章 快速入门指导
3.1 准备至少两个节点
节点名:\两个节点通过局域网可以互相访问
每个节点至少两个磁盘,一个用于操作系统安装一个用于GlusterFS 存储。 备注:GlusterFS的配置文件保存在/var/lib/glusterd.你必须保证/var目录一直有足够的存储空间,否则会导致节点GlusterFS不可用。
3.2 格式化并挂载bricks
此处,将专用磁盘sdb1挂载在/data/brick1目录。 mkfs.xfs -i size=512 /dev/sdb1 mkdir -p /data/brick1
echo'/dev/sdb1 /data/brick1 xfs defaults 1 2'>> /etc/fstab mount -a && mount
3.3 安装 GlusterFS
方式一,使用yum源安装(如果你有的话)
yum install glusterfs-server service glusterd start service glusterd status
3.4 配置信任的存储节点
在server1上
gluster peer probe server2 在server2上
gluster peer probe server1
在任意一台服务器,验证
gluster peer status
3.5 配置GlusterFS卷
1、在所有的服务器上配置 mkdir -p /data/brick1/gv0
#划分一个单独的目录放置卷
石家庄众毅信息技术有限公司共47页第24页
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库GlusterFS学习笔记(翻译by 张文超)(5)在线全文阅读。
相关推荐: