Setting Up A Highly Available NFS Server - Page 3
6 Configure DRBDNow we load the DRBD kernel module on both server1 and server2. We need to do this only now because afterwards it will be loaded by the DRBD init script. server1/server2: modprobe drbd Let's configure DRBD: server1/server2: drbdadm up all The last command should show something like this (on both server1 and server2):
You see that both NFS servers say that they are secondary and that the data is inconsistant. This is because no initial sync has been made yet. I want to make server1 the primary NFS server and server2 the "hot-standby", If server1 fails, server2 takes over, and if server1 comes back then all data that has changed in the meantime is mirrored back from server2 to server1 so that data is always consistent. This next step has to be done only on server1! server1: drbdadm -- --do-what-I-say primary all Now we start the initial sync between server1 and server2 so that the data on both servers becomes consistent. On server1, we do this: server1: drbdadm -- connect all The initial sync is going to take a few hours (depending on the size of /dev/sda8 (/dev/hda8...)) so please be patient. You can see the progress of the initial sync like this on server1 or server2: server1/server2: cat /proc/drbd The output should look like this:
When the initial sync is finished, the output should look like this:
7 Some Further NFS ConfigurationNFS stores some important information (e.g. information about file locks, etc.) in /var/lib/nfs. Now what happens if server1 goes down? server2 takes over, but its information in /var/lib/nfs will be different from the information in server1's /var/lib/nfs directory. Therefore we do some tweaking so that these details will be stored on our /data partition (/dev/sda8 or /dev/hda8...) which is mirrored by DRBD between server1 and server2. So if server1 goes down server2 can use the NFS details of server1. server1/server2: mkdir /data server1: mount -t ext3 /dev/drbd0 /data server2: rm -fr /var/lib/nfs/
|




print: 
Recent comments
15 hours 28 min ago
16 hours 13 min ago
1 day 3 hours ago
1 day 6 hours ago
1 day 9 hours ago
1 day 13 hours ago
1 day 14 hours ago
1 day 15 hours ago
1 day 15 hours ago
1 day 21 hours ago