Gluster geo-replication can be used for both a secondary backup solution or as an async mirroring solution. Setting it up isn’t hard, but it can be tricky, as I’ve ran into some troubles myself.
The first to do is create two Gluster volumes (master and slave) and make sure both machines run the exact same GlusterFS version.
Then make sure that you have passwordless ssh authentication between the servers.
We will use the following namings:
- g1 – the master server
- g2 – the slave server
- master-gluster – the master volume
- slave-gluster – the slave volume
Now we’ll create the geo-replication session between the master and the slave:
gluster volume geo-replication master-gluster g2::slave-gluster create push-pem
If you don’t need verification, you can replace
no-verify. You can also use the
force argument if needed.
If everything went well, then you can proceed to start the session with the following command:
gluster volume get-replication master-gluster g2::slave-gluster start
I have encountered a problem where the status was always faulty and I’ve managed to fix it by changing one bit of configuration, using the following command:
gluster volume get-replication master-gluster g2::slave-gluster config remote_gsyncd /usr/lib/x86_64-linux-gnu/glusterfs/gsyncd
Tip: If creating a session doesn’t work from the master server, you can try it from the slave one, as long as they are peered.