11.3.4. Configuring Geo-replication

To configure Geo-replication
  • Use the following command at the glusterFS command line:
    # gluster volume geo-replication MASTER SLAVE config [options]
    For more information about the options, see Chapter 20, Command Reference .
    For example:
    To view list of all option/value pair, use the following command:
    # gluster volume geo-replication Volume1 example.com:/data/remote_dir config
    To delete a setting for a geo-replication config option, prefix the option with ! (exclamation) mark. For example, to reset the log-level to default value:
    # gluster volume geo-replication Volume1 example.com:/data/remote_dir config '!log-level'

11.3.4.1. Checkpointing

Due to the asychronous nature of geo-replication, if changes are on-going on master side, synchronization of data to slave is always in progress. Therefore, completion of synchronization of data is not possible but you can view the status of replication with respect to a particular time.
Red Hat Storage 2.0 introduces Geo-replication Checkpointing, a introspection feature. Using Checkpointing, you can get information on the progress of replication. By setting a checkpoint, the actual time is recorded as a reference timepoint, and from then on, enhanced synchronization information is available on whether the data on master as of the reference timepoint has been replicated on slave.
To configure and display geo-replication checkpoint information
  • Set checkpoint to a geo-replication session
    # gluster volume geo-replication MASTER SLAVE config checkpoint [LABEL | now]
    For example, to set checkpoint between Volume1 and example.com:/data/remote_dir
    # gluster volume geo-replication Volume1 example.com:/data/remote_dir config checkpoint now
    geo-replication config updated successfully
  • Display the status of checkpoint for a geo-replication session
    # gluster volume geo-replication MASTER SLAVE status
    For example, to display the status of set checkpoint between Volume1 and example.com:/data/remote_dir
    # gluster volume geo-replication Volume1 example.com:/data/remote_dir status
    MASTER    SLAVE                            STATUS
    ______    ______________________________   ____________
    Volume1 ssh://example.com:/data/remote_dir OK | checkpoint as of 2012-06-22 11:47:01 not reached yet
    If the set checkpoint is complete, the following status is displayed:
    # gluster volume geo-replication Volume1 example.com:/data/remote_dir status
    MASTER    SLAVE                            STATUS
    ______    ______________________________   ____________
    Volume1 ssh://example.com:/data/remote_dir OK | checkpoint as of 2012-06-21 11:47:01 completed at 2012-06-21 12:23:16
    If you set checkpoints on a regular base, you can specify custom labels for them. For example, to set checkpoint between Volume1 and example.com:/data/remote_dir with label NEW_ACCOUNTS_CREATED as view its status
    # gluster volume geo-replication Volume1 example.com:/data/remote_dir config checkpoint NEW_ACCOUNTS_CREATED
    geo-replication config updated successfully.
    
    # gluster volume geo-replication Volume1 example.com:/data/remote_dir status
    MASTER    SLAVE                            STATUS
    ______    ______________________________   ____________
    Volume1 ssh://example.com:/data/remote_dir OK | checkpoint NEW_ACCOUNTS_CREATED completed at 2012-06-22 11:32:23
  • Delete a set checkpoint for a geo-replication session
    # gluster volume geo-replication MASTER SLAVE config '!checkpoint'
    For example, to delete the checkpoint set between Volume1 and example.com:/data/remote_dir
    # gluster volume geo-replication Volume1 example.com:/data/remote_dir config '!checkpoint' 
    geo-replication config updated successfully
  • View the history of checkpoints for a geo-replication session
    # gluster volume geo-replication MASTER SLAVE config log-file | xargs grep checkpoint
    For example, to display the checkpoint history including set, delete, and completion events between Volume1 and example.com:/data/remote_dir
    # gluster volume geo-replication Volume1 example.com:/data/remote_dir config  log-file | xargs grep checkpoint
    [2012-06-04 12:40:03.436563] I [gsyncd(conf):359:main_i] <top>: checkpoint as of 2012-06-04 12:40:02 set
    [2012-06-04 12:41:03.617508] I master:448:checkpt_service] _GMaster: checkpoint as of 2012-06-04 12:40:02 completed
    [2012-06-22 03:01:17.488917] I [gsyncd(conf):359:main_i] <top>: checkpoint as of 2012-06-22 03:01:12 set 
    [2012-06-22 03:02:29.10240] I master:448:checkpt_service] _GMaster: checkpoint as of 2012-06-22 03:01:12 completed