1.CLVM实现:
1)确定cluster运行正常
#clustat
2) /etc/init.d/clvmd status查看clvmd服务状态
3)开启clvm功能:
#lvmconf --enable-cluster
#chkconfig clvmd on;service clvmd start
4)分配共享存储空间用于clvm
#pvcreate /dev/mapper/mpathap6
#vgcreate cluvg /dev/mapper/mpathap6
#lvcreate -l 60%VG -n clulv cluvg
5)查看其他节点是否能看到同一个LVM
2.GFS2实现:
1)将CLVM LV格式化为GFS2文件系统:
#yum -y install gfs2-utils
#mkfs.gfs2 -p lock_dlm -t cluster1:demogfs -j 2 -J 64 /dev/cluvg/clulv
2)挂载gfs2文件系统
#mkdir /mnt/gfs2
#mount -t gfs2 /dev/cluvg/clulv /mnt/gfs2
3)自动挂载:gfs2文件系统一定不能fsck
#vim /etc/fstab
/dev/cluvg/clulv /mnt/gfs2 gfs2 defaults 0 0
4)查看GFS2文件系统日志:
#gfs2_tool journals /mnt/gfs2
5)为现有GFS2文件系统添加日志:
#gfs2_jadd -j 3 -J 64 /mnt/gfs2
6)扩展GFS2的文件系统:
#lvextend -l +100%FREE /dev/cluvg/clulv
#gfs2_grow -T /mnt/gfs2
#gfs2_grow /mnt/gfs2
7)使GFS2文件系统能够支持acl和quota
#vim /etc/fstab
/dev/cluvg/clulv /mnt/gfs2 gfs2 defaults,acl,quota=on 0 0
8)生成quota配置文件
#quotacheck -cug /mnt/gfs2
#setquota -u redhat 102400 204800 0 0 /mnt/gfs2
#repquota –a
3. 验证:在节点1 节点2上同时读写GFS 卷。