Skip to content

Zentyal and GlusterFs

We can use GlusterFs to improve the availability of the storage for Zentyal.

final scenario

Setup storage nodes and import data

Move Zentyal data to external disk

Attach another disk to your Zentyal machine, in this case is /dev/vdb

attached disk
  • create an ext4 file system and mount the disk in a temporary mountpoint
  • copy all data (or move it) from /home directory to the mount point
  • fix /etc/fstab and remount /home
mkdir -p /mnt/disk
mkfs.ext4 /dev/vdb 
mount /dev/vdb /mnt/disk
rsync -av /home /mnt/disk
echo "/dev/vdb                /home           ext4    errors=remount-ro,usrquota,grpquota,acl 0       1" > /etc/fstab
umount /mnt/disk
mount -a

Setting two node with Ubuntu 18.04

node1

  • hostname: home1
  • ip address: 192.168.1.26

node2

  • hostname: home2
  • ip address: 192.168.1.27

In all nodes, fix the hosts file

fix the hosts file in Zentyal vm

Detach the second disk from Zentyal machine and attach it to the first node.

Mount the disk to /mnt/datastore1

on each node install the requirements package:

sudo apt install software-properties-common -y
sudo apt install glusterfs-server -y

start service

sudo systemctl start glusterd
sudo systemctl enable glusterd

create a pool from node1 add node2

gluster peer probe home2

check the status on each node

create a mountpoint with same name and path on each node. On the first node, mount the imported Zentyal datastore. On the second node, mount another disk with same size.

gluster volume create share_folder replica 2 transport tcp home1:/mnt/datastore1/share_folder home2:/mnt/datastore1/share_folder force

gluster volume start share_folder
gluster volume info share_folder

Now we need a node with data and another node without data.

To force the alignment of the brick we can use a magic tool

Inside the node with the data we can mount to itself the glusterfs export and exec a stat to all files

mkdir /mnt/trick
mount -t glusterfs 127.0.0.1:/share_folder /mnt/trick
cd /mnt/trick
find . -exec stat '/mnt/{}' \;

Now we can recheck the /mnt/datastore1/share_folder on both node and the data will be align

Mount GlusterFS storage in Zentyal

Install glusterfs-client on Zentyal with

apt install glusterfs-client

add this line to /etc/fstab

home1:/share_folder /home glusterfs defaults,_netdev 0 0

apply and test with reboot