Building a highly available file server with NFS v4, DRBD 8.3, and Heartbeat on Centos 6.
For the purpose of this Tutorial we will be using a minimal installation of CentOS 6 / RHEL 6 on both of the servers. I like to use the minimal installation because I think we have more control of what is installed on the system and this way we keeping the system as clean and light as possible. Redhat/ CentOS 6 delivers by default NFSv4, Kernel 2.6.32 and ext4 file system, which will boost the performance of your file server.
Preparing the servers
After we have the OS installed we will disable selinux, and iptables and get CentOS /Redhat up to date. We can activate IPTABLES and selinux back again but for now we disabled it to make things easier to troubleshoot in case we need.
– Disabling selinux
# vi /etc/selinux/config
– Turn Off iptable from system start up
# chkconfig iptables off
– Update the system
# yum –y update
Now we will install some packages that will be necessary for DRBD installation and configuration.
# yum install wget ntp
We need to make sure that ntpd is always running to keep both servers time synchronized.
# chkconfig ntpd on
I also always like to have gcc and make available in case we need to compile any code that is not available in rpm packages.
# yum install gcc make
My preferred text editor is VIM in which I use through out this tutorial (vi), you can use any other you like.
# yum install vim-enhanced
# echo “alias vi=’vim'” >> ~/.bashrc
I will assume here that we have setup the network and hostname during the OS installation. If you haven’t done that yet it is probably a good time.
Here are the files you will need to modify:
– Hostname / Gateway
– ETH0 interface
– DNS Servers
Okay now to take affect some of the configurations that we have done we will reboot the servers. This is only necessary because we disabled selinux and updated the kernel, all the other services could have been restarted without a server reboot.