2

I have a simple 2 brick replication using two nodes. I am trying to make the mount point for the volume mount automatically at boot. I have tried various solutions such as here and here, but most of these are outdated solutions. I am using systemd and gluster 3.8.12.

Here is the relevant fstab line:

127.0.0.1:/gv-ftp-data /data glusterfs defaults,_netdev,noexec,nosuid,nodev,acl,context=system_u:object_r:user_home_t:s0 0 2

Note that the 127.0.0.1 is because I'm using both nodes in server/client configuration.

Now, I've setup iptables rules on the node to allow gluster communication to other nodes. Manually mounting the /data point as root has no issues, and it resolves file changes from the other node just fine.

However, I just cannot get it to automatically do this at boot. I tried using systemd automounts, and I couldn't get that working, and I tried adding x-systemd.automount to the fstab options without success.

Looking back through the journal, I found this line:

May 24 10:16:12 ftp-2.novalocal mount[2019]: /usr/bin/fusermount-glusterfs: mount failed: Permission denied

I'm thinking that's the culprit, how would I resolve this? Note that /data is owned by root with 711 permissions (and it needs to stay that way, if possible)

Patrick
  • 589
  • 3
  • 20
  • It looks like it might be an SELinux issue, diving further into it. I created a custom policy to allow it and I'm going to see if that's the problem. – Patrick May 24 '17 at 15:55
  • I strongly believe this is related to SELinux. Setting it to permissive allowed the volume to automatically mount. – Patrick May 24 '17 at 16:07

1 Answers1

3

I figured this out, for others who are having the same issue. I had to create an SELinux module using these commands (thanks to setroubleshoot):

ausearch -c 'fusermount-glus' --raw | audit2allow -M my-fusermountglus

semodule -i my-fusermountglus.pp

Doing this allowed me to switch back to enforcing mode with no issues, now the directory is mounted on boot.

Patrick
  • 589
  • 3
  • 20