Read more

Manage Gluster Mount on boot

Deleted user #5298
April 27, 2018Software engineer

There are two ways within systemd to manage the fact that you need the gluster service active before mounting the mountpoint. Thus in the past the mount triggered before the gluster service was running and didn't mount again.

/etc/fstab

Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

You can use the x-systemd.autmount feature which mounts the mountpoint as soon as it's accessed

localhost:/shared /gluster/shared glusterfs defaults,_netdev,noauto,x-systemd.automount 0 0

Unit file

This unit file takes care of the mountpoint and makes sure gluster is running before:

[Unit]
Description=GlusterFS Mount
After=glusterfs-server.service
Requires=glusterfs-server.service

[Mount]
What=localhost:/shared
Where=/gluster/shared
Type=glusterfs
Options=defaults,_netdev

[Install]
WantedBy=multi-user.target

You should put it in /etc/systemd/system/gluster-shared.mount and then enable it:

systemctl enable gluster-shared.mount
Posted to makandra Operations (2018-04-27 14:39)