Gluster filesystem mount issue in LXC container
I was setting up a Gluster cluster file system in 2 LXC containers where I ran into an error.
1. Install gluster-server,
in both containers:
$ sudo apt-get install glusterfs-server
2. Peer the gluster nodes,
in container01:
$ sudo gluster peer probe container02
peer probe: success
$ sudo gluster peer probe container01
peer probe: success
3. Create the glusterfs manager folder,
in both containers:
$ sudo mkdir /gluster_data
4. Create vol1 volume,
in containers01:
$ sudo gluster volume create vol1 replica 2 transport tcp container01:/gluster_data container02:/gluster_data force
volume create: vol1: success: please start the volume to access data
5. Start the volume,
in container01:
$ sudo gluster volume start vol1
volume start: vol1: success
6. Mount the newly created shared storage vol1:
$ sudo mkdir /pool1
Implementation process
in both containers:
$ sudo apt-get install glusterfs-server
2. Peer the gluster nodes,
in container01:
$ sudo gluster peer probe container02
peer probe: success
in container02:
$ sudo gluster peer probe container01
peer probe: success
3. Create the glusterfs manager folder,
in both containers:
$ sudo mkdir /gluster_data
4. Create vol1 volume,
in containers01:
$ sudo gluster volume create vol1 replica 2 transport tcp container01:/gluster_data container02:/gluster_data force
volume create: vol1: success: please start the volume to access data
5. Start the volume,
in container01:
$ sudo gluster volume start vol1
volume start: vol1: success
6. Mount the newly created shared storage vol1:
$ sudo mkdir /pool1
$ sudo mount /pool1
And here, when I tried to mount the vol1, i got following error:
[2015-12-12 21:19:37.277176] I [glusterfsd.c:1910:main] 0-/usr/sbin/glusterfs: Started running /usr/sbin/glusterfs version 3.4.2 (/usr/sbin/glusterfs --volfile-id=/vol1 --volfile-server=container01 /pool1)
[2015-12-12 21:19:37.277756] E [mount.c:267:gf_fuse_mount] 0-glusterfs-fuse: cannot open /dev/fuse (No such file or directory)
[2015-12-12 21:19:37.277768] E [xlator.c:390:xlator_init] 0-fuse: Initialization of volume 'fuse' failed, review your volfile again
As per error it seems gluster looking for fuse device /dev/fuse which apparently isn't exist.
$ sudo ls /dev/fuse
ls: cannot access /dev/fuse: No such file or directory
Solution
To create the fuse device manually,
in both containers:
$ sudo mknod /dev/fuse c 10 229
Now try to mount again:
$ sudo mount /pool1
$ df -h /pool1
Filesystem Size Used Avail Use% Mounted on
container01:/vol1 30G 26G 2.5G 92% /pool1
And if you want to make the mount boot persistent, add the following line in the /etc/fstab for each container respectively:
$ cat /etc/fstab
# UNCONFIGURED FSTAB FOR BASE SYSTEM
container01:/vol1 /pool1 glusterfs defaults,_netdev 0 0
Thanks a lots! This really helpful!
ReplyDeleteThe process is not difficult, and, as far as I can see, we can always ask your assistance. Hope to get proper answers.
ReplyDelete