ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Oracle 10g RAC 的部署2

Oracle 10g RAC 的部署2

原创 Linux操作系统 作者:flightpat 时间:2008-07-04 17:16:53 0 删除 编辑

在一个节点上,为共享文件创建目录:

(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 是一组集群服务,负责管理节点与集群文件系统之间的通信。下面是对各个服务的说明:

  • NM:用于跟踪 cluster.conf 中的所有节点的节点管理器
  • HB:当节点加入或离开集群时向上/向下发出通知的心跳服务
  • TCP:处理节点之间的通信
  • DLM:用于跟踪所有锁、这些锁的所有者以及状态的分布式锁管理器
  • CONFIGFS:在 /config 中挂载的用户空间驱动的配置文件系统
  • DLMFS:用户空间与内核空间 DLM 的接口

在所有节点上执行下面的过程,将 O2CB 配置为在引导时启动。

当系统提示您指定心跳死亡阈值时,您必须指定一个大于 7 的值,以防止节点由于较慢的 IDE 磁盘驱动器而崩溃。心跳死亡阈值是一个用于计算隔离时间的变量。

Fence time (seconds) = (heartbeat dead threshold -1) * 2

在我们的环境中,120 秒的隔离时间很合适。两个节点上的心跳死亡阈值应该完全相同。

以 root 用户身份执行

# /etc/init.d/o2cb unload
Stopping O2CB cluster ocfs2: OK
Unmounting ocfs2_dlmfs filesystem: OK
Unloading module "ocfs2_dlmfs": OK
Unmounting configfs filesystem: OK
Unloading module "configfs": OK
 
# /etc/init.d/o2cb configure
Configuring the O2CB driver.
 
This will configure the on-boot properties of the O2CB driver.
The following questions will determine whether the driver is loaded on
boot.  The current values will be shown in brackets ('[]').  Hitting
 without typing an answer will keep that current value.  Ctrl-C
will abort.
 
Load O2CB driver on boot (y/n) [y]: y
Cluster to start on boot (Enter "none" to clear) [ocfs2]:
Specify heartbeat dead threshold (>=7) [7]: 61
Writing O2CB configuration: OK
Loading module "configfs": OK
Mounting configfs filesystem at /config: OK
Loading module "ocfs2_nodemanager": OK
Loading module "ocfs2_dlm": OK
Loading module "ocfs2_dlmfs": OK
Mounting ocfs2_dlmfs filesystem at /dlm: OK
Starting O2CB cluster ocfs2: OK

 

 

[Oracle 自动存储管理器 (ASM)]

 

在 Linux 平台上,ASM 可以使用原始设备或通过 ASMLib 接口管理的设备。出于易于使用和性能方面的原因,Oracle 建议使用通过 ASMLib 接口管理的设备而非原始设备。

 

ASMLib 以一套共三个 Linux 程序包的形式提供:
oracleasmlib — ASM
库
oracleasm-support —
管理 ASMLib 所需的实用程序
oracleasm —
用于 ASM 库的内核模块

 

获得ASM程序

  1. 将您的 Web 浏览器指向 http://otn.oracle.com/tech/linux/asmlib/index.html。
  2. 选择适用于您 Linux 版本的链接。
  3. 下载适用于您 Linux 版本的 oracleasmlib 和 oracleasm-support 程序包。
  4. 下载与您的内核相对应的 oracleasm 程序包。

安装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.rpm
Preparing...                ########################################### [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 []:oracle
Default group to own the driver interface []:dba
Start Oracle ASM library driver on boot (y/n) [n]:y
Fix permissions of Oracle ASM disks on boot (y/n) [y]:y
Writing 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 enable
Writing 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 listdisks
VOL1
VOL2

 

其他节点识别配置的磁盘 (所有其他节点)

在所有其他集群主机上,以 root 用户身份运行以下命令,扫描所配置的 ASMLib 磁盘:

#/etc/init.d/oracleasm scandisks

# /etc/init.d/oracleasm listdisks
VOL1
VOL2

 

 

[原始分区 ]

 

在集群文件系统和 ASM 可用之前,原始分区是为 Oracle RAC 配置共享磁盘存储的唯一选择。

原始分区有很多缺点。 主要是它们必须接受每个磁盘可使用 15 个分区的限制、Linux 强制的 255 个原始设备的限制以及额外的管理任务和所需计划。 对于单实例环境而言,逻辑卷管理器 (LVM) 可以减少管理工作并在存储布局方面提供更多灵活性。 不幸的是,LVM 不能识别集群,因此在 RAC 环境中不支持它的使用。

在使用原始分区时,通常最好选择一组标准的分区大小,即某个基本大小的倍数。 这就在存储布局方面提供了更大的灵活性,并且在需要重新调整 I/O 时便于将分区重新配给其他磁盘。

 

划分原始分区(在其中一个节点上)

 

# fdisk /dev/sdb
The 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):p
Disk /dev/sdb:36.4 GB, 36420075008 bytes
255 heads, 63 sectors/track, 4427 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot    Start       End    Blocks   Id  System
Command (m for help):n
Command action
e   extended
p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-4427, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-4427, default 4427):+50m
Command (m for help):n
Command action
e   extended
p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (8-4427, default 8):
Using default value 8
Last cylinder or +size or +sizeM or +sizeK (8-4427, default 4427):+50m
Command (m for help):n
Command action
e   extended
p   primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (15-4427, default 15):
Using default value 15
Last cylinder or +size or +sizeM or +sizeK (15-4427, default 4427):+200m
Command (m for help):n
Command action
e   extended
p   primary partition (1-4)
e
Selected partition 4
First cylinder (40-4427, default 40):
Using default value 40
Last cylinder or +size or +sizeM or +sizeK (40-4427, default 4427):
Using default value 4427
Command (m for help):n
First cylinder (40-4427, default 40):
Using default value 40
Last cylinder or +size or +sizeM or +sizeK (40-4427, default 4427):+200m
 
.
..
 
Command (m for help):p
Disk /dev/sdb:36.4 GB, 36420075008 bytes
255 heads, 63 sectors/track, 4427 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device 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/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2008-07-04

  • 博文量
    5
  • 访问量
    3664