本方案中采用DRBD来即时同步两台NODE服务器中的存储设备的数据,然后用OCFS2来设置分布式共享文件系统,从而为后继部署双机热备和负载均衡建立底层数据的实现基础。
────────────────────────────────────────────────────────────────────────────────
Check your Linux if support ocfs2 or not
────────────────────────────────────────────────────────────────────────────────
# lsmod | grep ocfs
--------------------------------------------------------------------------------
ocfs2_dlmfs 18526 1
ocfs2_stack_o2cb 3564 0
ocfs2_dlm 212552 1 ocfs2_stack_o2cb
ocfs2_nodemanager 159579 11 ocfs2_dlmfs,ocfs2_stack_o2cb,ocfs2_dlm
ocfs2_stackglue 9821 2 ocfs2_dlmfs,ocfs2_stack_o2cb
configfs 23522 2 ocfs2_nodemanager
--------------------------------------------------------------------------------
注:如果无任何输出,说明您的内核还未支持OCFS2文件系统,您必须先安装相关支持,可参考下一步骤
Install UEK kernel (support ocfs2 directly).
────────────────────────────────────────────────────────────────────────────────
Install UEK kernel (support ocfs2 directly)
────────────────────────────────────────────────────────────────────────────────
Download UEK kernel:
Oracle.com/repo/OracleLinux/OL6/UEK/
# wget
# wget
# wget
# yum install dracut-kernel;
# rpm -ivh kernel-uek-firmware-2.6.39-200.29.2.el6uek.noarch.rpm;
# rpm -ivh kernel-uek-2.6.39-200.29.2.el6uek.i686.rpm;
# vi /boot/grub/grub.conf;
--------------------------------------------------------------------------------
default=0
--------------------------------------------------------------------------------
# reboot
# lsmod | grep ocfs
--------------------------------------------------------------------------------
ocfs2_dlmfs 18526 1
ocfs2_stack_o2cb 3564 0
ocfs2_dlm 212552 1 ocfs2_stack_o2cb
ocfs2_nodemanager 159579 11 ocfs2_dlmfs,ocfs2_stack_o2cb,ocfs2_dlm
ocfs2_stackglue 9821 2 ocfs2_dlmfs,ocfs2_stack_o2cb
configfs 23522 2 ocfs2_nodemanager
--------------------------------------------------------------------------------
────────────────────────────────────────────────────────────────────────────────
DRBD
────────────────────────────────────────────────────────────────────────────────
Starting with Linux 2.6.33,
DRBD is officially integrated into the vanilla Linux kernel source.
Linux releases with DRBD:
--------------------------------------------------------------------------------
Kernel-release DRBD-release
2.6.33 8.3.7
2.6.34 8.3.7
2.6.35 8.3.8
2.6.36 8.3.8.1
2.6.37 8.3.9
2.6.38 8.3.9
2.6.39 8.3.10(In this case, we need to find this version)
3.0 8.3.11
3.1 8.3.11
--------------------------------------------------------------------------------
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
Again, RHEL not longer support DRBD, need to manully setup:
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
────────────────────────────────────────────────────────────────────────────────
Install DRBD kernel module and utils package from ELRepo:
────────────────────────────────────────────────────────────────────────────────
# uname -a
--------------------------------------------------------------------------------
Linux CentOS6-ocfs2-1 2.6.39-200.29.2.el6uek.i686
#1 SMP Sat Jul 14 10:50:31 EDT 2012 i686 i686 i386 GNU/Linux
--------------------------------------------------------------------------------
Note: as before setup step, I am using the UEK kernel(this also come from RHEL) .
Download packages:
(CentOS6 not longer provide the extras package now !)