Add SAN functions to Highly Available NFS/NAS
This based on my last post where I documented building a Highly Available NFS/NAS server.
There is not a huge amount that needs to be done in order to add iSCSI functionality as well.
Add a file called /etc/drbd/iscsi.res containing:
resource iscsi {
on nfs1 {
device /dev/drbd1;
disk /dev/vdc;
meta-disk internal;
address 10.0.0.1:7789;
}
on nfs2 {
device /dev/drbd1;
disk /dev/vdc;
meta-disk internal;
address 10.0.0.2:7789;
}
}
This differs from the previous resource in 2 ways. Obviously it using a different physical disk. Also the port number of the address is incremented; each resource has to have its own port to communicate on.
Highly Available NFS/NAS
Take 2 Centos Servers (nfs1 and nfs2 will do nicely) and install ELrepo and EPEL on them both:
yum install \
https://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm \
https://elrepo.org/elrepo-release-6-4.el6.elrepo.noarch.rpm --nogpgcheck
Each of them should ideally have 2 NICS, with the secondary ones just used for DRBD sync purposes. We’ll give these the address 10.0.0.1/32 and 10.0.0.2/32.
I am also assuming that you have disabled the firewall and SELinux – I do not recommend that for production, but for testing it is fine.