[Gluster-users] reading from local replica?

Brian Ericson bericson at ptc.com
Mon Jun 8 21:55:49 UTC 2015

Am I misunderstanding cluster.read-subvolume/cluster.read-subvolume-index?

I have two regions, "A" and "B" with servers "a" and "b" in, 
respectfully, each region.  I have clients in both regions. Intra-region 
communication is fast, but the pipe between the regions is terrible.  
I'd like to minimize inter-region communication to as close to glusterfs 
write operations only and have reads go to the server in the region the 
client is running in.

I have created a replica volume as:
gluster volume create gv0 replica 2 a:/data/brick1/gv0 
b:/data/brick1/gv0 force

As a baseline, if I use scp to copy from the brick directly, I get -- 
for a 100M file -- times of about 6s if the client scps from the server 
in the same region and anywhere from 3 to 5 minutes if I the client scps 
the server in the other region.

I was under the impression (from something I read but can't now find) 
that glusterfs automatically picks the fastest replica, but that has not 
been my experience; glusterfs seems to generally prefer the server in 
the other region over the "local" one, with times usually in excess of 4 

I've also tried having clients mount the volume using the "xlator" 
options cluster.read-subvolume and cluster.read-subvolume-index, but 
neither seem to have any impact.  Here are sample mount commands to show 
what I'm attempting:

mount -t glusterfs -o xlator-option=cluster.read-subvolume=gv0-client-<0 
or 1> a:/gv0 /mnt/glusterfs
mount -t glusterfs -o xlator-option=cluster.read-subvolume-index=<0 or 
1> a:/gv0 /mnt/glusterfs

Am I misunderstanding how glusterfs works, particularly when trying to 
"read locally"?  Is it possible to configure glusterfs to use a local 
replica (or the "fastest replica") for reads?

More information about the Gluster-users mailing list