Translators/cluster/replicate
From GlusterDocumentation
Translator cluster/replicate
Replicate provides RAID-1 like functionality. Replicate keeps files and directories on all subvolumes in sync. Hence if Replicate has four subvolumes, there will be four copies of all files and directories. In case one of the subvolumes goes down (i.e server crash, network disconnection) Replicate will still service the requests from the redundant copies.
Replicate also provides self-healing functionality. In case the crashed servers comes up, the outdated files and directories will be updated with the latest versions. Replicate uses the extended attributes of the backend file system to track the pending activities over the files and directories to provide the self-heal feature.
volume afr-example type cluster/replicate subvolumes brick1 brick2 brick3 end-volume
The above example volfile will replicate all directories and files on brick1, brick2 and brick3. The subvolumes can be another translator
NOTE: Replicate needs extended attribute support in the underlying FS, and also 'posix-locks' translator over the posix translator.
- read-subvolume
The subvolume name on which read operations should be performed on. By default read operations are balanced across subvolumes.
- favorite-child
In the event of a split brain, consider the data or file from favorite-child subvolume to be the master copy while self-healing.
- data-self-heal, metadata-self-heal and entry-self-heal
Enable or disable self healing of file contents, metadata of the files and directory entries respectively. The default is 'on' for all the three.
- data-change-log', metadata-change-log and entry-change-log
Keep track of transaction log in the extended attributes of the files to decide reliably the master copy at the time of self-heal. Disabling the change-log will make Replicate pick a subvolume arbitrarily as the master copy. Refer Understanding AFR Translator for more details.
- data-lock-server-count, metadata-lock-server-count and entry-lock-server-count
The number of servers to hold a lock on for each type of operation. The default is 1 for all the three.
Refer to Understanding AFR Translator to see more volume files, and understand the design.


