GlusterFS 调整

GlusterFS 调整

目前我有两个 glusterfs 卷

Volume Name: gv0
Type: Replicate
Volume ID: id-here
Status: Started
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: s1.example.com:/data/brick1/gv0
Brick2: s2.example.com:/data/brick1/gv0
Options Reconfigured:
performance.readdir-ahead: on

/etc/fstab(服务器1):

/dev/vdb1 /data/brick1 xfs defaults 1 2
s1.example.com:/gv0 /mnt/glusterfs glusterfs defaults,_netdev,direct-io-mode=disable 0 0

glusterfs 卷已在本地安装,但读取/写入速度很慢/迟缓。我知道 server1 和 server2 之间的连接速度很慢,但理想情况下它应该写入本地卷,然后同步,对吗?我遇到了上传应用程序在将文件存储到本地安装的 glusterfs 卷时超时的问题。

我使用的是原生 FUSE 客户端。所有服务器都在 KVM VM 上。Qcow2,glusterfs 分区无缓存 XFS 文件系统。

基准

GlusterFS 卷:

[~]@s1:$ dd if=/dev/zero of=/mnt/glusterfs/zero1 bs=64k count=40  
40+0 records in
40+0 records out
2621440 bytes (2.6 MB) copied, 17.3101 s, 151 kB/s

正常音量

[~]@s1:~$ dd if=/dev/zero of=zero1 bs=64k count=40
40+0 records in
40+0 records out
2621440 bytes (2.6 MB) copied, 0.00406856 s, 644 MB/s

答案1

复制卷上的写入总是同步。

前段时间我专门问过GlusterFS 邮件列表简短的回复是,不可能在尽快离开本地主机的同时进行后台连续的同步过程。

一个可能的建议解决方法是故意中断复制,写入本地主机,然后恢复复制。自我修复守护进程将启动并在后台同步所有更改。

这种解决方法显然只在远程副本为只读时才有效;如果是读写,则会出现脑裂情况。无论如何,如果您只需要只读远程副本,则可以使用 GlusterFS 的地理复制功能,该功能基于 rsync,并且与本地主机写入完全分离。

相关内容