2

I'm configuring a NFS export resource on a RHEL 7 cluster, and I need to let a shared directory be mountable from clients belonging to different subnetworks.

For example, the following command obviously works fine (with only one network defined):

pcs resource create TEST-EXPORTFS ocf:heartbeat:exportfs clientspec=192.168.1.0/24 options=rw,sync,no_root_squash directory=/test fsid=1

but how can I add a second network in the "clientspec" parameter (for example: 192.168.100.0/24) so clients from both subnets can mount the shared directory?

I haven't been able to find any help in the official documentation (neither from RedHat nor from Linux-HA).

Thanks in advance for any precious help.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
Riccardo M.
  • 150
  • 1
  • 9
  • what about **clientspec="192.168.1.0/24 192.168.100.0/24"*** – kofemann Nov 22 '16 at 08:19
  • This is the first thing I tried... syntax error is all we get... :( `> stderr: INFO: Directory /test is not exported to 192.168.1.0/24 192.168.100.0/24 (stopped). > stderr: INFO: Exporting file system ... > stderr: ERROR: exportfs: Invalid export syntax: 192.168.1.0/24 exporting 192.168.100.0/24:/temp` – Riccardo M. Nov 22 '16 at 15:24

1 Answers1

5

I know its an older question but its in the top 10 on a google search so I thought I'd answer with what worked for me in case anyone else hits this looking for the same thing

I had a similar issue where I have a lot of servers so I have them split up by subnets based on what they do and needed to export some dirs only to 1 subnet or the other and some to all the subnets and I discovered a neat little trick thats un documented. you simply add 2 seperate resources each with the subnet you need and same fsid then you will see that it exports it once with both subnets

example:

[root@nas1 ~]# pcs resource create nfs-log1 exportfs clientspec=192.168.0.0/255.255.255.0 options=rw,sync,no_root_squash directory=/mnt/nfsshare/logdata fsid=2 --group nfsgroup
[root@nas1 ~]# pcs resource create nfs-log2 exportfs clientspec=172.16.0.0/255.255.255.0 options=rw,sync,no_root_squash directory=/mnt/nfsshare/logdata fsid=2 --group nfsgroup

then a showmount will return like this:

/mnt/nfsshare/logdata 192.168.0.0/255.255.255.0,172.16.0.0/255.255.255.0