Re: Run 4 separate NFSv4.0/.1/.2 servers on 4 separate TCP ports on one Linux machine?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/25/25 11:34 AM, Takeshi Nishimura wrote:
> On Tue, Feb 25, 2025 at 5:17 PM Chuck Lever <chuck.lever@xxxxxxxxxx> wrote:
>>
>> On 2/25/25 11:04 AM, Takeshi Nishimura wrote:
>>> how can I run 4 separate NFSv4.0/4.1/4.2 servers on 4 separate TCP
>>> ports, say 2049, 12049, 22049, 32049, on the same Linux kernel, and
>>> have a separate exports file for each of them?
>>
>> This question has been asked in the past. We've explored implementing it
>> with a single NFSD instance, but it looks difficult to impossible
>> without massive code changes.
>>
>> The solution we recommend is to run separate NFSD instances in guests
>> (containers or qemu). The host system might provide a NAT routing
>> service that makes the guests appear on the same IP address but
>> different ports.
> 
> Running in QEmu is not acceptable for performance, and it adds at
> least a 1GB RAM usage for nothing.

Cloud providers use qemu virtualization without suffering critical
impacts. IME if qemu isn't providing the performance you expect, you
have some tuning to do.

If you have performance data that shows a problem we can address, then
please post it here or file a bug against Filesystem/NFSD on kernel.org.


> A container is also not a really
> preferred option, because the OS files in the container must be
> maintained and CVEs handled.

My understanding is that in simple container deployments, the container
gets exactly the same kernel and set of OS binaries as the host. There's
no reason to get fancy if all that is running in the container is an
NFS service.


> Why is it so hard to run more than one instance of a nfsd server?

Let me put this differently. The administrative abstraction on Linux
that handles this is a container. This gives you a virtualized network
device, virtualized storage, a security realm, and a high administrative
wall between the individual NFS services. The containers all use the
same pool of resources on the host, but appear to be individual NFS
servers.

Making it look like one NFSD instance with multiple administrative
domains serving on multiple network interfaces is unnecessary, and
would require a significant development effort.

If you want a solution you can deploy on Linux today, then qemu or
containers does exactly what you want (with the addition of a NAT to
conserve public IP addresses).


> Is there a cookbook or howto which documents how to set up a MINIMUM
> container for this?

Not that I'm aware of, but that doesn't mean it does not exist
somewhere (and possibly in several pieces). These days, distributors
provide a significant amount of documentation; none of that would
originate from the upstream Linux community.


-- 
Chuck Lever




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux