Building a highy 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
SELINUX=disabled
- 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 australian slots is probably a good time.
Here are the files you will need to modify:
- Hostname / Gateway
/etc/sysconfig/network
-ETH0 interface
/etc/sysconfig/network-scripts/ifcfg-eth0
-DNS Servers
/etc/resolv.conf
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.
You really should not be using haresources any more, it's beyond deprecated. Please look into Corosync and Pacemaker as that is what RHEL is moving toward. Or if you still want to use Heartbeat, you can use it with Pacemaker as well.
Comments
In that case you need to replace the command
drbdsetup /dev/drbd0 primary –o
with
drbdsetup /dev/drbd0 primary --o
And
chmod 777 /drbd/main
for public write access on the NFS share
RSS feed for comments to this post.