在一个节点上,为共享文件创建目录:
(1)CRS 文件(存放Oracle Cluster Registry 和 CRS voting disk)
#mkdir /u02/oracrs
#chown oracle:oinstall /u02/oracrs
#chmod 775 /u02/oracrs
(2)数据库文件
#mkdir /u02/oradata
#chown oracle:oinstall /u02/oradata
#chmod 775 /u02/oradata
至此OCFS系统准备完毕。
提示 1 :
配置 O2CB 驱动程序 O2CB 是一组集群服务,负责管理节点与集群文件系统之间的通信。下面是对各个服务的说明:
在所有节点上执行下面的过程,将 O2CB 配置为在引导时启动。
当系统提示您指定心跳死亡阈值时,您必须指定一个大于 7 的值,以防止节点由于较慢的 IDE 磁盘驱动器而崩溃。心跳死亡阈值是一个用于计算隔离时间的变量。
Fence time (seconds) = (heartbeat dead threshold -1) * 2
在我们的环境中,120 秒的隔离时间很合适。两个节点上的心跳死亡阈值应该完全相同。
以 root 用户身份执行
# /etc/init.d/o2cb unloadStopping O2CB cluster ocfs2: OKUnmounting ocfs2_dlmfs filesystem: OKUnloading module "ocfs2_dlmfs": OKUnmounting configfs filesystem: OKUnloading module "configfs": OK # /etc/init.d/o2cb configureConfiguring the O2CB driver. This will configure the on-boot properties of the O2CB driver.The following questions will determine whether the driver is loaded onboot. The current values will be shown in brackets ('[]'). Hitting without typing an answer will keep that current value. Ctrl-Cwill abort. Load O2CB driver on boot (y/n) [y]: yCluster to start on boot (Enter "none" to clear) [ocfs2]:Specify heartbeat dead threshold (>=7) [7]: 61Writing O2CB configuration: OKLoading module "configfs": OKMounting configfs filesystem at /config: OKLoading module "ocfs2_nodemanager": OKLoading module "ocfs2_dlm": OKLoading module "ocfs2_dlmfs": OKMounting ocfs2_dlmfs filesystem at /dlm: OKStarting O2CB cluster ocfs2: OK
[Oracle 自动存储管理器 (ASM)]
在 Linux 平台上,ASM 可以使用原始设备或通过 ASMLib 接口管理的设备。出于易于使用和性能方面的原因,Oracle 建议使用通过 ASMLib 接口管理的设备而非原始设备。
ASMLib 以一套共三个 Linux 程序包的形式提供:
oracleasmlib — ASM 库
oracleasm-support — 管理 ASMLib 所需的实用程序
oracleasm — 用于 ASM 库的内核模块
获得ASM程序
安装ASM (在每个节点上,以root身份)
# rpm -Uvh \> oracleasm-2.4.9-e-smp-1.0.0-1.i686.rpm \> oracleasmlib-1.0.0-1.i386.rpm \> oracleasm-support-1.0.0-1.i386.rpmPreparing... ########################################### [100%]1:oracleasm-support ########################################### [ 33%]2:oracleasm-2.4.9-e-smp ########################################### [ 66%]Linking module oracleasm.o into the module path [ OK ]3:oracleasmlib ########################################### [100%]
配置ASMLib (所有节点上)
以 root 用户身份在每个集群主机上运行以下命令并回应提示.
# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver
Default user to own the driver interface []:oracleDefault group to own the driver interface []:dbaStart Oracle ASM library driver on boot (y/n) [n]:yFix permissions of Oracle ASM disks on boot (y/n) [y]:yWriting Oracle ASM library driver configuration [ OK ]Creating /dev/oracleasm mount point [ OK ]Loading module "oracleasm" [ OK ]Mounting ASMlib driver filesystem [ OK ]Scanning system for ASM disks [ OK ]
启用 ASMLib 驱动程序
以 root 用户身份在每个集群主机上运行以下命令
# /etc/init.d/oracleasm enableWriting Oracle ASM library driver configuration [ OK ]Scanning system for ASM disks [ OK ]
配置ASM磁盘 (在其中的一个节点上)
这些磁盘是不包含任何内容(甚至不包含分区)的空磁盘。 也可以将磁盘分区用于 ASM,但不建议这样做。
以 root 用户身份运行以下命令
# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb //sdb à VOL1
Marking disk "/dev/sdb" as an ASM disk [ OK ]
# /etc/init.d/oracleasm createdisk VOL2 /dev/sdc //sdc à VOL2
Marking disk "/dev/sdc" as an ASM disk [ OK ]
提示: 以大写字母输入 DISK_NAME。当前版本中有一个错误,即如果使用小写字母,ASM 实例将无法识别磁盘。
# /etc/init.d/oracleasm listdisksVOL1VOL2
其他节点识别配置的磁盘 (所有其他节点)
在所有其他集群主机上,以 root 用户身份运行以下命令,扫描所配置的 ASMLib 磁盘:
#/etc/init.d/oracleasm scandisks
# /etc/init.d/oracleasm listdisksVOL1VOL2
[原始分区 ]
在集群文件系统和 ASM 可用之前,原始分区是为 Oracle RAC 配置共享磁盘存储的唯一选择。
原始分区有很多缺点。 主要是它们必须接受每个磁盘可使用 15 个分区的限制、Linux 强制的 255 个原始设备的限制以及额外的管理任务和所需计划。 对于单实例环境而言,逻辑卷管理器 (LVM) 可以减少管理工作并在存储布局方面提供更多灵活性。 不幸的是,LVM 不能识别集群,因此在 RAC 环境中不支持它的使用。
在使用原始分区时,通常最好选择一组标准的分区大小,即某个基本大小的倍数。 这就在存储布局方面提供了更大的灵活性,并且在需要重新调整 I/O 时便于将分区重新配给其他磁盘。
划分原始分区(在其中一个节点上)
# fdisk /dev/sdbThe number of cylinders for this disk is set to 4427.There is nothing wrong with that, but this is larger than 1024,and could in certain setups cause problems with:1) software that runs at boot time (e.g., old versions of LILO)2) booting and partitioning software from other OSs(e.g., DOS FDISK, OS/2 FDISK)Command (m for help):pDisk /dev/sdb:36.4 GB, 36420075008 bytes255 heads, 63 sectors/track, 4427 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id SystemCommand (m for help):nCommand actione extendedp primary partition (1-4)pPartition number (1-4): 1First cylinder (1-4427, default 1):Using default value 1Last cylinder or +size or +sizeM or +sizeK (1-4427, default 4427):+50mCommand (m for help):nCommand actione extendedp primary partition (1-4)pPartition number (1-4): 2First cylinder (8-4427, default 8):Using default value 8Last cylinder or +size or +sizeM or +sizeK (8-4427, default 4427):+50mCommand (m for help):nCommand actione extendedp primary partition (1-4)pPartition number (1-4): 3First cylinder (15-4427, default 15):Using default value 15Last cylinder or +size or +sizeM or +sizeK (15-4427, default 4427):+200mCommand (m for help):nCommand actione extendedp primary partition (1-4)eSelected partition 4First cylinder (40-4427, default 40):Using default value 40Last cylinder or +size or +sizeM or +sizeK (40-4427, default 4427):Using default value 4427Command (m for help):nFirst cylinder (40-4427, default 40):Using default value 40Last cylinder or +size or +sizeM or +sizeK (40-4427, default 4427):+200m ... Command (m for help):pDisk /dev/sdb:36.4 GB, 36420075008 bytes255 heads, 63 sectors/track, 4427 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System/dev/sdb1 1 7 56196 83 Linux/dev/sdb2 8 14 56227+ 83 Linux/dev/sdb3 15 39 200812+ 83 Linux/dev/sdb4 40 4427 35246610 5 Extended/dev/sdb5 40 64 200781 83 Linux/dev/sdb6 65 89 200781 83 Linux/dev/sdb7 90 114 200781 83 Linux/dev/sdb8 115 139 200781 83 Linux
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/551823/viewspace-371950/ ,如需转载,请注明出处,否则将追究法律责任。