headermask image

header image

OCFS2 Installation

OCFS2 (Oracle Cluster File System 2)是由Oracle开发的通用集群文件系统,是一个以GPLv2许可发布的开放源代码项目。由于OCFS2是Cluster-aware的,所以很自然的可以作为RAC的存储的选择之一(其他的选择还有裸设备和ASM)。但是必须指出的是,Oracle home和datafile(还有redo log,archive log,control file,以及Clusterware的OCR和Voting Disks)不能放在同一个OCFS2 volume上。
最近尝试了一下将Oracle Clusterware 11gR1的OCR和VD放在OCFS2上,这里记录一下OCFS2的安装过程。
首先是确定所使用的Linux的发行版本(distribution),内核版本(version)和风格(flavor),处理器架构:
# cat /etc/redhat-release
Enterprise Linux Enterprise Linux AS release 4 (October Update 5)
# uname -r
2.6.9-67.0.4.0.2.ELsmp
# uname -p
i686
可以看到这里我使用的是Oracle Enterprise Linux 4u5(可以认为是等同于Red Hat Enterprise Linux 4u5),内核版本是2.6.9-67.0.4.0.2,内核风格是smp,处理器架构是i686(也就是x86)。
接下来按照上面的信息去下载相应的OCFS2和OCFS2 Tools(包括ocfs2-tools和ocfs2console)的RPM包。
# wget -c http://oss.oracle.com/projects/ocfs2/dist/files/RedHat/RHEL4/i386/1.2.9-1/2.6.9-67.0.4.EL/ocfs2-2.6.9-67.0.4.ELsmp-1.2.9-1.el4.i686.rpm
# wget -c http://oss.oracle.com/projects/ocfs2-tools/dist/files/RedHat/RHEL4/i386/1.2.7-1/ocfs2-tools-1.2.7-1.el4.i386.rpm
# wget -c http://oss.oracle.com/projects/ocfs2-tools/dist/files/RedHat/RHEL4/i386/1.2.7-1/ocfs2console-1.2.7-1.el4.i386.rpm
删除掉现有的老版本的OCFS2相关RPM包:
# rpm -qa | grep ocfs | xargs rpm -e
依次安装刚刚下载的3个RPM:
# [...]

Linux raw device

使用
raw -qa
命令来查询当前已经存在的绑定。
Use  the /etc/sysconfig/rawdevices file to define the set of raw device mappings automatically created during the system startup sequence.
在/etc/sysconfig/rawdevices中,注意裸设备对应的块设备如果是SATA或者iSCSI,则应该使用/dev/disk/by-id中的链接来进行指定。
如何确定裸设备对应的块设备?以裸设备/dev/raw/raw57为例:
# ls -l /dev/raw/raw57
crw-rw—-  1 root disk 162, 57 Jul 31 02:02 /dev/raw/raw57
# raw -qa | grep raw57
/dev/raw/raw57: bound to major 65, minor 233
# ls -l /dev | grep 65 | grep 233
brwxrwxrwx  1 root    disk    [...]

VERITAS Volume Manager Fundamentals

When you place a physical disk under Volume Manager control, a Volume Manager disk (or VM disk) is assigned to the physical disk.
A VM disk typically includes a public region (allocated storage) and a private region where Volume Manager internal configuration information is stored.
A disk group is a collection of VM disks that share a [...]

Mysterious storage

Veritas Storage Foundation for Oracle RAC
OCFS2
Open-iSCSI
A discussion on OCFS, OCFS2, ASM, RAW