public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Failover in NFS
@ 2002-11-18 15:04 Rashmi Agrawal
  2002-11-18 15:44 ` Ragnar Kjørstad
  2002-11-18 22:33 ` Jan Niehusmann
  0 siblings, 2 replies; 15+ messages in thread
From: Rashmi Agrawal @ 2002-11-18 15:04 UTC (permalink / raw)
  To: linux-kernel

Hi All,

I might be very wrong but I am trying to do following

1. I have a 4 node cluster and nfsv3 in all the nodes of cluster with
server running in one
of the 2 nodesconnected to shared storage and 2 other nodes are acting
as clients.
2. If nfs server node crashes, I need to failover to another node
wherein I need to have access
to the lock state of the previous server and I need to tell the clients
that the IP address of the
nfs server node has changed. IS IT POSSIBLE or what can be done to
implement it?

Another scenario is..
1. When one of the client crashes, it has to failover to another client,
in that case if client
crashed with some locks held how the newly come up client going to grab
the lock again
when it is not released? Again the server might already be taking care
of it but I am not
sure about it.

I hope I can use NFS for this kind of set up and if not what will it
take to have this kind of set
up usinf NFS?

Regards
Rashmi



^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: Failover in NFS
@ 2002-11-19 18:24 Juan Gomez
  0 siblings, 0 replies; 15+ messages in thread
From: Juan Gomez @ 2002-11-19 18:24 UTC (permalink / raw)
  To: Michael Clark
  Cc: kernel, linux-kernel, linux-kernel-owner, pollard, rashmi.agrawal

                                                                                                               
                                                                                                               
                                                                                                               


I do not think we need changes to lockd. Earlier this year I sent a patch
to Alan Cox that would enable you to control server's lockd grace period
from user land which helps you do the takeover from server to server. Also
I have sent in patches included in tha latest version of NFS utils that
would let you do takeover along with the lockd patch of the kernel and
using shared /var/lib/nfs/sm directory.  This is a good time to check if
Alan has had some time to include that patch.

Juan



|---------+---------------------------------->
|         |           Michael Clark          |
|         |           <michael@metaparadigm.c|
|         |           om>                    |
|         |           Sent by:               |
|         |           linux-kernel-owner@vger|
|         |           .kernel.org            |
|         |                                  |
|         |                                  |
|         |           11/18/02 11:40 PM      |
|         |                                  |
|---------+---------------------------------->
  >-------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                         |
  |       To:       rashmi.agrawal@wipro.com                                                                                |
  |       cc:       Ragnar Kjørstad <kernel@ragnark.vestdata.no>, Jesse Pollard <pollard@admin.navo.hpc.mil>,               |
  |        linux-kernel@vger.kernel.org                                                                                     |
  |       Subject:  Re: Failover in NFS                                                                                     |
  |                                                                                                                         |
  |                                                                                                                         |
  >-------------------------------------------------------------------------------------------------------------------------|



On 11/19/02 13:07, Rashmi Agrawal wrote:
> Michael Clark wrote:
>
>
>>On 11/19/02 06:22, Ragnar Kjørstad wrote:
>>
>>
>>>But it would not work as described above. There are some important
>>>limitations here:
>>>
>>>- I assumed that /var/lib/nfs is shared. If you want two servers to
>>>  be active at once you need a different way to share lock-data.
>>
>>I'm looking at this problem right now. Basically to support multiple
>>virtual NFS servers with failover support, lockd could be modified to
>>communicate with the local statd using the dest IP used in the locking
>>operation - then statd can modified to look at the peer address
>>(which is normally 127.0.0.1) to find out which NFS virtual server
>>the monitor request is for. This would also allow you to run a statd
>>per virtual NFS server (bound to the specific address instead of
>>IPADDR_ANY).
>
>
> What is the plan for this implementation? Is it going to be part of main
line
> kernel.
> If yes then when will it be available and if no, when will it be
available in
> the form of
> patches.

I still don't know how hard the lockd changes would be.
More just thinking how it could be done now.

> Should we expect NFs failover support in linux kernel soon??

Simple failover with a single NFS service is already supported.

As ppl have said - you just failover the /var/lib/nfs directory
along with the exported partition and modify the rpc.statd script
to use the virtual node name, and add a notify call to the cluster
service start script plus a few other little things.

One little trick is blocking the NFS port for the NFS ip alias
during failover. Assuming you are using exportfs and exportfs -u
in your cluster service script to raise and lower the export
(to allow for unmounting of the failover partition, etc).
Doing this is req'd to stop the takeover node from returning
stale nfs handle errors when the IP alias has been raised (and
gratutiously arped for) but before the newly mounted fs has been exported.

ie. in your boot scripts, disable access to NFS and create
a chain to add accept rules later.

iptables -N nfs_allow
iptables -A INPUT -p udp -m udp --dport 2049 -j nfs_allow
iptables -A INPUT -p udp -m udp --dport 2049 -j DROP

and in the cluster service scripts I then do:

case "$1" in
'start')
     exportfs -o rw,sync someclient.somedomain:/foo/bar
     iptables -A nfs_allow --dest $nfs_ip_alias -j ACCEPT
     rstatd -N -n $nfs_virtual_hostname
     ;;
'stop')
     iptables -D nfs_allow --dest $nfs_ip_alias -j ACCEPT
     exportfs -u someclient.somedomain:/foo/bar
     ;;

Multiple virtual NFS servers failover support is what doesn't
currently work right due to the way statd works. This is what i'm
looking at the moment - no timeline - no promises of patches -
just ideas.

I do have one patch to make the kernel RPC code reply using
the ipalias address instead of the base host IP (although it
is a bit of a hack as it directly changes the address of the
nfsd server socket before replies - maybe introducing problems
during concurrency). I'm looking at a better solution for this.

This is needed for UDP NFS clients like MacOS X that do a connect
and thusly refuse to see the packets coming from the linux NFS server
originating from a different address. It also solves problem with
accessing an ip alias NFS server through NAT or a firewall.

~mc

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/




^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2002-11-22 18:07 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-18 15:04 Failover in NFS Rashmi Agrawal
2002-11-18 15:44 ` Ragnar Kjørstad
2002-11-18 22:11   ` Jesse Pollard
2002-11-18 22:22     ` Ragnar Kjørstad
2002-11-18 22:41       ` Jesse Pollard
2002-11-18 22:51         ` Ragnar Kjørstad
2002-11-19  1:36       ` Michael Clark
2002-11-19  5:07         ` Rashmi Agrawal
2002-11-19  7:40           ` Michael Clark
2002-11-22  7:07       ` Rashmi Agrawal
2002-11-21 20:58     ` Bill Davidsen
2002-11-21 22:52       ` Jesse Pollard
2002-11-22 19:19         ` Gunther Mayer
2002-11-18 22:33 ` Jan Niehusmann
  -- strict thread matches above, loose matches on Subject: below --
2002-11-19 18:24 Juan Gomez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox