Here’s how you can install GlusterFS with a replicated high availability storage volume on Ubuntu 16.04 LTS:
- Install GlusterFS:
sudo apt-get update
sudo apt-get install glusterfs-server
- Start and enable the GlusterFS service:
sudo systemctl start glusterd
sudo systemctl enable glusterd
- Create two new directories on two different servers, which will be used as the bricks for the replicated volume:
sudo mkdir -p /data/brick1
sudo mkdir -p /data/brick2
- On one of the servers, run the following command to create the volume:
sudo gluster volume create gv0 replica 2 transport tcp <server1_hostname>:<brick1> <server2_hostname>:<brick2>
Replace <server1_hostname>
, <brick1>
, <server2_hostname>
, and <brick2>
with the hostname and brick directory of each server.
- Start the volume:
sudo gluster volume start gv0
- Mount the volume on the client:
sudo mount -t glusterfs <server1_hostname>:/gv0 <mount_point>
Replace <server1_hostname>
and <mount_point>
with the hostname of the GlusterFS server and the directory where you want to mount the volume.
After these steps, you should have a replicated GlusterFS volume that is highly available. If one of the servers fails, the other server will continue to serve the data, ensuring data availability even in the event of a failure.