LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Problems in load-balancing NFS using LVS

To: <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Problems in load-balancing NFS using LVS
From: "Sookwan Lee" <sklee@xxxxxxxxxxxxxxxx>
Date: Wed, 14 Jul 2004 16:11:21 +0900
I'm trying to use LVS to load-balance NFS service, and have difficulties
what is the correct way to configure LVS.
My LVS is using Linux kernel 2.6.6 and DR is used.
I'm using two realservers.

I found that NFS service consists of multiple daemons.

portmapper : port 111
nfsd       : port 2049
mountd     : port is not fixed. Every time service is started,
      random port number is assigned.

So every time nfs service is started, I should configure lvs using ipvsadm
manually. In addition to this annoyance, there were some problems.


< Problem 1 >

In one test, ports were asigned like this.

ports of realserver1 (portmapper, nfsd, mountd) = (111, 2049, 718)
ports of realserver2 (portmapper, nfsd, mountd) = (111, 2049, 748)

After knowing this information using "rpcinfo -p", I manually configured
LVS.

In this situation, portmap request was scheduled to realserver1 first,
and next mount request also went to realserver1 because port 718 was only
used in realserver1.
However, next actual NFS traffics (port 2049) are scheduled to realserver1
or
realserver2, which led to trouble.

So I used fixed ports specifying -p option to rpc.nfsd and rpc.mountd
in the script /etc/init.d/nfs-kernel-server.
This is the configuration.

ports of realserver1 (portmapper, nfsd, mountd) = (111, 62001, 63001)
ports of realserver2 (portmapper, nfsd, mountd) = (111, 62002, 63002)

In this case, mounting and using NFS seems to work, but another
problem occurred.


< Problem 2 >

The problem is the fact that, before umount request, another port query is
made to portmapper.

For example, after portmap request, mount request, and NFS traffic are all
redirected to realserver1, before umount request, another portmap request
is made. So in this case, request to portmap (111) is redirected to
realserver2, and umount request goes to realserver2.

So this time I used 'persistence' option specifying the timeout of 2 hours
(7200 seconds). Using the persistence option, I can see that umount request

is redirected to the realserver1.

But, I can not sure that these (using fixed ports, relatively long
persistent timeout) are the correct way to configure. And if persistence
option should be used, what is the correct value?

I saw the LVS mini-HOWTO and HOWTO, but I can only see that NFS can be
load-balanced using LVS but can not see the right way to configure.

I want to know the correct way to configure.
Some pointers will also be appreciated.

Thanks in advance.

--
Sookwan Lee


<Prev in Thread] Current Thread [Next in Thread>