大网数据广告活动
服务器运维问答

How to specify two different subnets in NFS exportfs cluster resource on RHEL 7

· 52CE 我爱测

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 …

问题原文

原帖链接 · Riccardo M. · CC BY-SA 3.0

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.

已采纳解答

原帖链接 · Jacqueline Loriault · CC BY-SA 3.0

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

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-11-21)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。