6.4 Configuring the Geo-replication Session

On the master cluster, you must create the ssh key and ensure that it is added to the authorized_keys on each node on the slave cluster.

For this to work smoothly an initial ssh key should be created without a passphrase on a node in the master cluster. This key should be copied to one node on the slave cluster. On a node in the master cluster, run the following command:

$ sudo ssh-keygen

When prompted for a passphrase, leave this field empty and press Enter.

Once the key is created, copy it to a node in your slave cluster for the georep user. For example:

$ sudo ssh-copy-id georep@slave-node1.example.com

On the same master cluster node where you created the ssh key, run the following command:

$ sudo gluster-georep-sshkey generate

This step creates a separate key that is copied to all of the master nodes and that will be used for subsequent communications with any slave nodes during geo-replication.

To finally configure a geo-replication session, run the following command on the same node on the master cluster:

$ sudo gluster volume geo-replication myvolume georep@slave-node1.example.com::slavevol \
   create push-pem

Substitute myvolume with the name of the volume on the master cluster that you wish to replicate. Substitute georep with the username that you have configured for SSH access on the slave cluster. Substitute slave-node1.example.com with the hostname, domain name or IP address of the node on the slave cluster where you copied an SSH key. Substitute slavevol with the name of the volume on the slave cluster that you intend to use for replication.

When the command runs, it copies the public keys for the master cluster nodes to the node of the slave cluster. On the slave node, you must run the following command to configure the environment to use these keys for the user that you have created there:

sudo /usr/libexec/glusterfs/set_geo_rep_pem_keys.sh georep myvolume slavevol