| var $tag=''; var $tag_code='e9f5dd6899a95a18afda53bd83da4c27'; var $r_quote_bligid='4cbd76e501000b37'; var $worldcup='0'; var $worldcupball='0'; | 分类: oracle_rac |
使用从本地 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 设备创建一个主分区:
请注意,要在每个 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/ ,如需转载,请注明出处,否则将追究法律责任。