The software described in this documentation is either no longer supported or is in extended support.
Oracle recommends that you upgrade to a current supported release.
This section discusses creating a pool using replicated volumes.
The replica
count sets the number of copies
of files across bricks in the volume. Generally, two or three
copies are used. To protect against server and disk failures,
the bricks of the volume should be on different nodes.
Split-brain is a situation where two or more replicated copies of a file become divergent, and there is not enough information to select a copy as being pristine and to self-heal any bad copies. Split-brain situations occur mostly due to network issues with clients connecting to the files in the volume.
If you set replica
to be an even number (say,
2), you may encounter split-brain as both bricks think they have
the latest and correct version. You can use an odd number for
the replica
count (say, 3), to prevent
split-brain.
Using an arbiter brick also enables you to avoid split-brain,
yet doesn't require the extra storage required of a
replica 3
volume, which needs to store three
copies of the files. An arbiter brick contains metadata about
the files (but not the files) on other bricks in the volume, so
can be much smaller in size. The last brick in each replica
subvolume is used as the arbiter brick, for example, if you use
replica 3 arbiter 1
, every third brick is
used as an arbiter brick.
Volumes using an arbiter brick can only be created using the
replica 3 arbiter 1
option.
Example 3.2 Creating a replicated volume
This example creates a replicated volume with one brick on three nodes.
#gluster volume create myvolume replica 3 \ node{1,2,3}:/data/glusterfs/myvolume/mybrick/brick
volume create: myvolume: success: please start the volume to access data #gluster volume start myvolume
volume start: myvolume: success #gluster volume info
Volume Name: myvolume Type: Replicate Volume ID: ... Status: Started Snapshot Count: 0 Number of Bricks: 1 x 3 = 3 Transport-type: tcp Bricks: Brick1: node1:/data/glusterfs/myvolume/mybrick/brick Brick2: node2:/data/glusterfs/myvolume/mybrick/brick Brick3: node3:/data/glusterfs/myvolume/mybrick/brick Options Reconfigured: transport.address-family: inet nfs.disable: on performance.client-io-threads: off
Example 3.3 Creating a replicated volume with an arbiter
This example creates a replicated volume with one brick on three nodes, and sets one arbiter brick.
#gluster volume create myvolume replica 3 arbiter 1 \ node{1,2,3}:/data/glusterfs/myvolume/mybrick/brick
volume create: myvolume: success: please start the volume to access data #gluster volume start myvolume
volume start: myvolume: success #gluster volume info
Volume Name: myvolume Type: Replicate Volume ID: ... Status: Started Snapshot Count: 0 Number of Bricks: 1 x (2 + 1) = 3 Transport-type: tcp Bricks: Brick1: node1:/data/glusterfs/myvolume/mybrick/brick Brick2: node2:/data/glusterfs/myvolume/mybrick/brick Brick3: node3:/data/glusterfs/myvolume/mybrick/brick (arbiter) Options Reconfigured: transport.address-family: inet nfs.disable: on performance.client-io-threads: off