[Gluster-users] Question on replicated volumes with bricks on the same server

Antonio Messina antonio.s.messina at gmail.com
Wed Feb 12 17:40:34 UTC 2014


On Wed, Feb 12, 2014 at 11:21 AM, Vijay Bellur <vbellur at redhat.com> wrote:
> On 02/11/2014 03:21 PM, Antonio Messina wrote:
>> So, my guess is that if I create a "replica N" replicated+distributed
>> volumes using the bricks:
>>
>>    gluster-1:/srv/gluster
>>    ...
>>    gluster-[N*M]:/srv/gluster
>>
>> gluster internally creates a distributed volumes made of the following
>> replicated "volumes":
>>
>>    replicated volume 1: gluster-[1..N]:/srv/gluster
>>    replicated volume 2: gluster-[N+1..2N]:/srv/gluster
>>    ...
>>    replicated volume M: gluster-[N*(M-1)+1..N*M]:/srv/gluster
>>
>> Is that correct or there is a more complex algorithm involved?
>>
>
> The interpretation is correct. The way replica sets are chosen is related to
> the order in which bricks are defined at the time of volume creation.

Thank you for your clarification.

However, I am also trying to play with the vol files. It's not clear to me yet
*when* and *how* these files are read, so I don't know if I am doing
something very stupid... however, here is my question:

I create a distributed+replicated volume with 4 bricks with:

    gluster volume create default replica 2
gluster-data00{1,2,3,4}:/srv/gluster/brick force

mount the filesystem, created multiple files on it and I have verified
that the replicas are stored as we discussed before.

The `default-fuse.vol` file looks like:

    [...]
    volume default-replicate-0
        type cluster/replicate
        subvolumes default-client-0 default-client-1
    end-volume

    volume default-replicate-1
        type cluster/replicate
        subvolumes default-client-2 default-client-3
    end-volume

    volume default-dht
        type cluster/distribute
        subvolumes default-replicate-0 default-replicate-1
    end-volume
    [...]

Then I have stopped the volume and modified the vol file, in order to
swap two servers (default-client-3 and default-client-1):

    [...]
    volume default-replicate-0
        type cluster/replicate
        subvolumes default-client-0 default-client-3
    end-volume

    volume default-replicate-1
        type cluster/replicate
        subvolumes default-client-2 default-client-1
    end-volume

    volume default-dht
        type cluster/distribute
        subvolumes default-replicate-0 default-replicate-1
    end-volume
    [...]

re-started and re-mounted the volume.

I would expect that new files are replicated now on client-0 and
client-3 (called gluster-data00{1,4} in my cluster), but if I create a
file they are again replicated on client-0 and client-1 instead.

Am I missing some basic step?

.a.

-- 
antonio.s.messina at gmail.com
antonio.messina at uzh.ch                     +41 (0)44 635 42 22
GC3: Grid Computing Competence Center      http://www.gc3.uzh.ch/
University of Zurich
Winterthurerstrasse 190
CH-8057 Zurich Switzerland



More information about the Gluster-users mailing list