ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 在 Oracle Enterprise Linux 和 iSCSI 上构建您自己的 Oracle RAC 集群(6)

在 Oracle Enterprise Linux 和 iSCSI 上构建您自己的 Oracle RAC 集群(6)

原创 Linux操作系统 作者:jinqibingl 时间:2012-10-04 22:59:38 0 删除 编辑

在 Oracle Enterprise Linux 和 iSCSI 上构建您自己的 Oracle RAC 集群(6)  

在 Oracle Enterprise Linux 和 iSCSI 上构建您自己的 Oracle RAC 集群(6)
(2007-10-16 16:55:35)
在 Oracle Enterprise Linux 和 iSCSI 上构建您自己的 Oracle RAC 集群(6) - 轩辕剑 - 摸索着前进总比原地踏步好转载
var $tag=''; var $tag_code='e9f5dd6899a95a18afda53bd83da4c27'; var $r_quote_bligid='4cbd76e501000b37'; var $worldcup='0'; var $worldcupball='0'; 分类: oracle_rac


 # iscsi-ls
*******************************************************************************
SFNet iSCSI Driver Version ...4:0.1.11-4(15-Jan-2007)
*******************************************************************************
TARGET NAME             :iqn.2006-01.com.openfiler:rac1.asm4
TARGET ALIAS            :
HOST ID                 : 0
BUS ID                  : 0
TARGET ID               : 0
TARGET ADDRESS          : 192.168.2.195:3260,1
SESSION STATUS          :ESTABLISHED AT Mon Jun 25 12:56:10 EDT 2007
SESSION ID              :ISID 00023d000001 TSIH 200
*******************************************************************************
TARGET NAME             :iqn.2006-01.com.openfiler:rac1.asm3
TARGET ALIAS            :
HOST ID                 : 1
BUS ID                  : 0
TARGET ID               : 0
TARGET ADDRESS          : 192.168.2.195:3260,1
SESSION STATUS          :ESTABLISHED AT Mon Jun 25 12:56:10 EDT 2007
SESSION ID              :ISID 00023d000001 TSIH 100
*******************************************************************************
TARGET NAME             :iqn.2006-01.com.openfiler:rac1.asm2
TARGET ALIAS            :
HOST ID                 : 2
BUS ID                  : 0
TARGET ID               : 0
TARGET ADDRESS          : 192.168.2.195:3260,1
SESSION STATUS          :ESTABLISHED AT Mon Jun 25 12:56:10 EDT 2007
SESSION ID              :ISID 00023d000001 TSIH 300
*******************************************************************************
TARGET NAME             :iqn.2006-01.com.openfiler:rac1.asm1
TARGET ALIAS            :
HOST ID                 : 3
BUS ID                  : 0
TARGET ID               : 0
TARGET ADDRESS          : 192.168.2.195:3260,1
SESSION STATUS          :ESTABLISHED AT Mon Jun 25 12:56:10 EDT 2007
SESSION ID              :ISID 00023d000001 TSIH 400
*******************************************************************************
TARGET NAME             :iqn.2006-01.com.openfiler:rac1.crs
TARGET ALIAS            :
HOST ID                 : 4
BUS ID                  : 0
TARGET ID               : 0
TARGET ADDRESS          : 192.168.2.195:3260,1
SESSION STATUS          :ESTABLISHED AT Mon Jun 25 12:56:10 EDT 2007
SESSION ID              :ISID 00023d000001 TSIH 500
*******************************************************************************

使用从本地 SCSI ID 到 iSCSI 目标的主机 ID / LUN 以及 iSCSI 目标名称到 SCSI ID 的映射信息,我们可以为主机 linux1 生成从 SCSI 目标名称到本地 SCSI 设备名称的完整映射:

iSCSI 目标名称到本地 SCSI 设备名称
iSCSI 目标名称 主机 / SCSI ID SCSI 设备名称
iqn.2006-01.com.openfiler:rac1.asm4 0 /dev/sda
iqn.2006-01.com.openfiler:rac1.asm3 1 /dev/sde
iqn.2006-01.com.openfiler:rac1.asm2 2 /dev/sdc
iqn.2006-01.com.openfiler:rac1.asm1 3 /dev/sdd
iqn.2006-01.com.openfiler:rac1.crs 4 /dev/sdb

在 iSCSI 卷上创建分区

接下来的步骤是在每个 iSCSI 卷上创建一个跨整个卷大小的主分区。正如本文前面提到的那样,我将使用 Oracle 的集群文件系统第 2 版 (OCFS2) 存储供 Oracle 集群件软件共享的两个文件。然后,我们将使用自动存储管理 (ASM) 创建四个 ASM 卷;其中,两个用于所有物理数据库文件(数据/索引文件、联机重做日志文件和控制文件),另两个用于闪回恢复区(RMAN 备份和归档重做日志文件)。

下表列出了五个 iSCSI 卷及其支持的文件系统:

Oracle 共享驱动器配置
文件系统类型 iSCSI 目标(短)名称 规模 挂载点 ASM 磁盘组名称 文件类型
OCFS2 crs 2 GB /u02/oradata/orcl   Oracle 集群注册表 (OCR) 文件 — (~100MB)
表决磁盘 — (~20MB)
ASM asm1 118 GB ORCL:VOL1 +ORCL_DATA1 Oracle 数据库文件
ASM asm2 118 GB ORCL:VOL2 +ORCL_DATA1 Oracle 数据库文件
ASM asm3 118 GB ORCL:VOL3 +FLASH_RECOVERY_AREA Oracle 闪回恢复区
ASM asm4 118 GB ORCL:VOL4 +FLASH_RECOVERY_AREA Oracle 闪回恢复区
合计   474 GB      

如上表所示,我们需要在每个 iSCSI 卷上创建一个 Linux 主分区。fdisk 命令在 Linux 中用于创建(和删除)分区。对于每个 iSCSI 卷,您都可以在创建主分区时使用默认值,因为默认操作是使用整个磁盘。您可以安全地忽略指出设备未包含有效 DOS 分区(或 Sun、SGI 或 OSF 磁盘标签)的任何警告。

就本示例而言,我将从 linux1 运行 fdisk 命令,以便为上一部分中标识的每个本地 SCSI 设备创建一个主分区:


/dev/sda
/dev/sdb
/dev/sdc
/dev/sdd
/dev/sde

请注意,要在每个 iSCSI 卷上创建分区,只能从 Oracle RAC 集群中的一个节点上运行!

# --------------------------------------- # fdisk /dev/sda Command (m for help):n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-15134, default 1): 1 Last cylinder or +size or +sizeM or +sizeK (1-15134, default 15134): 15134 Command (m for help):p Disk /dev/sda:124.4 GB, 124486942720 bytes 255 heads, 63 sectors/track, 15134 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 1 15134 121563823+ 83 Linux Command (m for help):w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. # --------------------------------------- # fdisk /dev/sdb Command (m for help):n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-1009, default 1): 1 Last cylinder or +size or +sizeM or +sizeK (1-1009, default 1009): 1009 Command (m for help):p Disk /dev/sdb:2147 MB, 2147483648 bytes 67 heads, 62 sectors/track, 1009 cylinders Units = cylinders of 4154 * 512 = 2126848 bytes Device Boot Start End Blocks Id System /dev/sdb1 1 1009 2095662 83 Linux Command (m for help):w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. # --------------------------------------- # fdisk /dev/sdc Command (m for help):n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-15134, default 1): 1 Last cylinder or +size or +sizeM or +sizeK (1-15134, default 15134): 15134 Command (m for help):p Disk /dev/sdc:124.4 GB, 124486942720 bytes 255 heads, 63 sectors/track, 15134 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdc1 1 15134 121563823+ 83 Linux Command (m for help):w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. # --------------------------------------- # fdisk /dev/sdd Command (m for help):n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-15134, default 1): 1 Last cylinder or +size or +sizeM or +sizeK (1-15134, default 15134): 15134 Command (m for help):p Disk /dev/sdd:124.4 GB, 124486942720 bytes 255 heads, 63 sectors/track, 15134 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdd1 1 15134 121563823+ 83 Linux Command (m for help):w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. # --------------------------------------- # fdisk /dev/sde Command (m for help):n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-15134, default 1): 1 Last cylinder or +size or +sizeM or +sizeK (1-15134, default 15134): 15134 Command (m for help):p Disk /dev/sde:124.4 GB, 124486942720 bytes 255 heads, 63 sectors/track, 15134 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sde1 1 15134 121563823+ 83 Linux Command (m for help):w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. # ---------------------------------------

在创建所有必要分区之后,现在应以“root”用户帐户从集群的两个 Oracle RAC 节点使用以下命令将分区的更改情况通知给内核:请注意,在这两个 Oracle RAC 节点上,从 Openfiler 发现的 iSCSI 目标名映射和本地 SCSI 设备名将有所不同。由于卷按名称而不是它们的本地 SCSI 设备名称进行安装,因而不会导致任何问题。

# partprobe # fdisk -l Disk /dev/hda:40.0 GB, 40000000000 bytes 255 heads, 63 sectors/track, 4863 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 * 1 13 104391 83 Linux /dev/hda2 14 4863 38957625 8e Linux LVM Disk /dev/sda:124.4 GB, 124486942720 bytes 255 heads, 63 sectors/track, 15134 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 1 15134 297171 83 Linux Disk /dev/sdb:2147 MB, 2147483648 bytes 67 heads, 62 sectors/track, 1009 cylinders Units = cylinders of 4154 * 512 = 2126848 bytes Device Boot Start End Blocks Id System /dev/sdb1 1 1009 2095662 83 Linux Disk /dev/sdc:124.4 GB, 124486942720 bytes 255 heads, 63 sectors/track, 15134 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdc1 1 15134 121563823+ 83 Linux Disk /dev/sdd:124.4 GB, 124486942720 bytes 255 heads, 63 sectors/track, 15134 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdd1 1 15134 121563823+ 83 Linux Disk /dev/sde:124.4 GB, 124486942720 bytes 255 heads, 63 sectors/track, 15134 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sde1 1 15134 121563823+ 83 Linux

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9606200/viewspace-745641/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-08-19

  • 博文量
    154
  • 访问量
    325252