Networking
cancel
Showing results for 
Search instead for 
Did you mean: 

Single host NFS mount from two different IPs on server?

Chris Taylor_7
Occasional Contributor

Single host NFS mount from two different IPs on server?

Someone asked me something that at first seems flatly impossible, but I'm wondering if it can be done.

Say I have a multi-homed NFS server that's exporting a share on two different interfaces. On my client, if it has two NICs, obvously I could do something like:

mount 192.168.1.1:/my_share /my_share_mnt1
mount 192.168.1.2:/my_share /my_share_mnt2

Big deal, I have the same data in two places. What someone asked me is, what if I wanted to mount the two shares (from two different IPs) at ONE mountpoint on my client? Like, with round-robin DNS, or something...I don't know.

Obviously APA can't do that because you put physical NICs in a aggregate, not different IPs. With round-robin DNS, I could balance requests across the servers' interfaces but if one of those interfaces went down, the connection from my client would hang until the interface was back up.

Is there some other way I could do this, something obvious I'm forgetting? Thanks for any thoughts.
4 REPLIES
Matti_Kurkela
Honored Contributor

Re: Single host NFS mount from two different IPs on server?

If the interfaces of your multi-homed NFS server are in the same IP network segment, an APA set-up would be the recommended solution: first you aggregate the NICs, then add the second IP as an IP alias to the aggregate.

In other words, your lan0 and lan1 would become an aggregate lan900, and you would assign the first IP address to lan900 as usual. The second IP would then be assigned to lan900:1. This would always be a "cleaner" solution than trying to use two IPs in the same network segment with two separate NICs on the same host.

If the NFS server's interfaces are in different IP network segments, then I think the closest you can get is to use DNS round-robin and an automounter at the client side. A DNS round-robin won't really balance individual NFS requests, only mount requests: once a NFS mount has been made, it will stick with one particular server IP until unmounted.

The combination of DNS round-robin and automounter will give you load-balancing only if you have a large number of clients. If you have a single client, it won't balance the load.

It will give you one small measure of fault tolerance: if one of the server's IPs becomes inaccessible while a client is *not* accessing the filesystem (= the automounter has the NFS filesystem unmounted), then the next NFS access from that client has about a 50% chance to have a bit of a delay (because the round-robin suggested the non-functional IP first). Eventually the automount attempt should succeed and the filesystem should be free of delays as long as it's in use (i.e. until the automounter unmounts it because of idleness).

Whether the combination if round-robin DNS and automounter is useful to you or not, depends on your NFS usage pattern. If you have many clients, each using the NFS filesystem only occasionally, it might work well enough.

But if you have only a small number of clients and each one holds files open on the NFS filesystem on a long-term basis, or accesses the NFS so often the automounter wouldn't have a chance to unmount it, then the DNS round-robin + automounter combo won't help you. It will only increase the complexity of your setup and thus make it harder to troubleshoot.

MK
MK
Dave Olker
HPE Pro

Re: Single host NFS mount from two different IPs on server?

What OS is the NFS client running? There may be a way to do this depending on the OS of the client.

Dave
Chris Taylor_7
Occasional Contributor

Re: Single host NFS mount from two different IPs on server?

Thanks for the good feedback- the automounter was something I thought about too, but as was mentioned it might take to long for it to be relied upon to recover from a downed server interface. Not really what it was intended for!

My clients would theoretically be Linux, Solaris and HP-UX- so, if a neat solution was conceived for APA, it would have to work for the equivalent multipathing software on Sun and Linux.

It's sounding like since my client needs to mount a share and keep it in use for a long time, some fancy footwork with APA and the automounter just won't really work well for me.
Tim Nelson
Honored Contributor

Re: Single host NFS mount from two different IPs on server?

>>>My clients would theoretically be Linux, Solaris and HP-UX- so, if a neat solution was conceived for APA, it would have to work for the equivalent multipathing software on Sun and Linux.

APA and multipathing have nothing to do with each other. APA is NIC teaming, providing network fault tolerance and increased bandwidth.

>>>It's sounding like since my client needs to mount a share and keep it in use for a long time, some fancy footwork with APA and the automounter just won't really work well for me.

The automount option was automatically remounting NFS on demand in case of a failure.

Dave O. is the master of NFS.. answer his Q and lets see what he comes back with.


The