Setting Up A Highly Available NFS Server - Page 5

10 Configure The NFS Client

Now we install NFS on our client (192.168.0.100):

apt-get install nfs-common

Next we create the /data directory and mount our NFS share into it:

mkdir /data
mount 192.168.0.174:/data/export /data

192.168.0.174 is the virtual IP address we configured before. You must make sure that the forward and the reverse DNS record for client.example.com match each other, otherwise you get a "Permission denied" error on the client, and on the server you'll find this in /var/log/syslog:

#Mar  2 04:19:09 localhost rpc.mountd: Fake hostname localhost for 192.168.0.100 - forward lookup doesn't match reverse

If you do not have proper DNS records (or do not have a DNS server for your local network) you must change this now, otherwise you cannot mount the NFS share!

If it works you can now create further test files in /data on the client and then simulate failures of server1 and server2 (but not both at a time!) and check if the test files are replicated. On the client you shouldn't notice at all if server1 or server2 fails - the data in the /data directory should always be available (unless server1 and server2 fail at the same time...).

To unmount the /data directory, run

umount /data

If you want to automatically mount the NFS share at boot time, put the following line into /etc/fstab:

192.168.0.174:/data/export  /data    nfs          rw            0    0


Links

Share this page:

4 Comment(s)

Add comment

Comments

From: Anonymous at: 2006-03-07 16:30:56

If I want the data to be available to the NFS machines themselves, do you recommend mounting the virtual IP on them?

From: at: 2011-01-19 12:58:53

I think that is the only way,

why we are trying to use nfs then?

In drdb just one node is active, you cant do changes on the pasive one.

 

From: Anonymous at: 2006-03-09 18:46:27

Thanks for your info, pretty interesting.

Just two questions:

- Why ext3 is your choice instead of reiserfs?

- Why are you using ip-alias instead of iproute2?

Thanks in advance.

From: Anonymous at: 2006-03-13 10:48:37

I've thought about doing this before, but using iSCSI and the built in /dev/md aka software RAID to link the devices together as a mirrored device. Since iSCSI is supposedly a more open standard and can be used with multiple operating systems it'll be easier to implement on non-Linux systems as well.