找回密码
 注册
查看: 2205|回复: 3

oracle rac使用iscsi设备

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2021-7-9 17:25:34 | 显示全部楼层 |阅读模式
12.在 Oracle RAC 节点上配置 iSCSI 卷

8 r3 N5 `8 X* E+ C: h
在集群中的两个 Oracle RAC 节点上配置 iSCSI 启动器。但是,应当仅在 RAC 集群中的节点之一上执行创建分区的操作。
iSCSI 客户端可以是任何提供 iSCSI 支持(驱动程序)的系统(Linux、Unix、MS Windows、Apple Mac 等)。在本例中,客户端是两个 Linux 服务器,即 racnode1 和 racnode2,运行 Oracle Enterprise Linux 5.4。
在本节中,我们将在两个 Oracle RAC 节点上配置 iSCSI 软件启动器。Oracle Enterprise Linux 5.4 包含 Open-iSCSI iSCSI 软件启动器,可从 iscsi-initiator-utils RPM 中获取该软件启动器。这与之前版本的 Oracle Enterprise Linux (4.x) 有所不同,该版本包含作为 Linux-iSCSI 项目中的一部分而开发的 Linux iscsi-sfnet 软件驱动程序。所有 iSCSI 管理任务(如发现和登录)都将使用 Open-iSCSI 中包含的命令行界面 iscsiadm。
iSCSI 软件启动器将被配置为自动登录至网络存储服务器 (openfiler1) 并发现上一节中创建的 iSCSI 卷。随后,我们将使用 udev 为所发现的每一个 iSCSI 目标名称创建持久本地 SCSI 设备名称(即 /dev/iscsi/crs1)。拥有一致的本地 SCSI 设备名称和所映射到的 iSCSI 目标,有助于在配置 ASM 时区分三个不同的卷。但是,在此之前,我们需要先安装 iSCSI 启动器软件。
注意: 本指南使用 ASMLib 2.0,它是 Oracle 数据库的自动存储管理 (ASM) 特性的支持库。ASMLib 将用于标记本指南中使用的所有 iSCSI 卷。默认情况下,ASMLib 已经为与 ASM 一起使用的存储设备提供了持久路径和权限。此功能消除了使用存储设备路径和权限更新 udev 或 devlabel 文件的需要。在本文和实践中,我仍然选择为使用 udev 发现的每一个 iSCSI 目标名称创建持久本地 SCSI 设备名称。这提供了一种自我归档方法,有助于快速识别每一个卷的名称和位置。
安装 iSCSI(启动器)服务
对于 Oracle Enterprise Linux 5.4,默认情况下不会安装 Open-iSCSI iSCSI 软件启动器。该软件包含在 iscsi-initiator-utils 软件包中,可从 CD #1 中找到该软件包。要确定是否安装了此软件包(大多数情况下未安装),请在两个 Oracle RAC 节点上执行以下操作:
[size=1.78]复制; J  s" H, r( X/ V5 q$ R
Copied to Clipboard
& d0 _& C2 T- R; L) EError: Could not Copy
- }# \, S) W& _: z
* G( O! t$ K! D0 K( _+ L
[root@racnode1 ~]#  rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"| grep iscsi-initiator-utils

9 e8 A; y; t3 O9 b2 v5 P
如果未安装 iscsi-initiator-utils 软件包,则将 CD #1 加载到每一个 Oracle RAC 节点中,然后执行以下操作:
[size=1.78]复制6 C1 \0 ~$ S; L3 ]5 E; S0 B
Copied to Clipboard
! v5 Z6 y6 s/ T( }9 Y) fError: Could not Copy4 G! ^% I5 H  q

3 ~9 W: F0 _9 I  c9 v1 ~2 o; a2 F[root@racnode1 ~]#  mount -r /dev/cdrom /media/cdrom [root@racnode1 ~]#  cd /media/cdrom/Server [root@racnode1 ~]#  rpm -Uvh iscsi-initiator-utils-* [root@racnode1 ~]#  cd / [root@racnode1 ~]#  eject

* a+ ~8 R: Q! ]! C) l/ k8 X
验证现已安装 iscsi-initiator-utils 软件包:
[size=1.78]复制
+ v% M9 E: g" WCopied to Clipboard
' `+ [7 g) X9 Y: ?( b. GError: Could not Copy
1 V3 L  V* O  a1 B# d$ s1 y
) c" C" U0 T; P' W/ Q
[root@racnode1 ~]#  rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"| grep iscsi-initiator-utils iscsi-initiator-utils-6.2.0.871-0.10.el5 (x86_64)

1 Y# S( ^- l% }' _  ^# u" Q* m
配置 iSCSI(启动器)服务
验证两个 Oracle RAC 节点上均安装了 iscsi-initiator-utils 软件包之后,启动 iscsid 服务并设置其在系统启动时自动启动。我们还将配置 iSCSI 服务自动启动,以便于在系统启动时登录到所需 iSCSI 目标。
[size=1.78]复制
5 c3 B  k: y: P# a4 M! XCopied to Clipboard" V- d2 [: V4 W" u8 }
Error: Could not Copy
; M% N2 f4 `% v8 D5 r' ?
0 {  L5 B7 y$ n- k- K8 I- e3 y
[root@racnode1 ~]#  service iscsid start Turning off network shutdown. Starting iSCSI daemon:   OK ]   OK ]  [root@racnode1 ~]#  chkconfig iscsid on [root@racnode1 ~]#  chkconfig iscsi on
6 y; Q/ i7 ~3 B" H: ^& Y; U
现在 iSCSI 服务已启动,请使用 iscsiadm 命令行界面来发现网络存储服务器上的所有可用目标。这应当在两个 Oracle RAC 节点上执行,以验证配置是否正常运行:
[size=1.78]复制5 p. ~" I1 T: ^. o) W
Copied to Clipboard
/ m7 \7 f) r4 }6 ~3 j9 \& |- L9 ?Error: Could not Copy
. \; `2 `9 O1 o& C
" V- e- |4 x! H5 N: C
[root@racnode1 ~]#  iscsiadm -m discovery -t sendtargets -p openfiler1-priv 192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.crs1 192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.fra1 192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.data1
# @2 @3 I: V+ Z3 h' A4 L
手动登录至 iSCSI 目标
至此,iSCSI 启动器服务已启动,每一个 Oracle RAC 节点都可以从网络存储服务器中发现可用目标。下一步是手动登录至每一个可用目标,可以使用 iscsiadm 命令行界面来执行此操作。两个 Oracle RAC 节点上都需要运行此任务。请注意,我需要指定 IP 地址,而不是网络存储服务器的主机名 (openfiler1-priv) - 我认为这是必需的,因为(上述)发现显示了使用 IP 地址的目标。
[size=1.78]复制
6 @# i. f- Y5 _- f5 b) k1 fCopied to Clipboard# X# S1 ^6 Y* y" q* K2 X9 [- N. J+ y
Error: Could not Copy3 d$ y4 z* |$ @& I% E  Q

# V6 i, g; _1 |! G6 t1 C6 }3 l7 |[root@racnode1 ~]#  iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.crs1 -p 192.168.2.195 -l [root@racnode1 ~]#  iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.data1 -p 192.168.2.195 -l [root@racnode1 ~]#  iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.fra1 -p 192.168.2.195 -l

& ]" ~+ n6 b  u3 C7 Y1 S& W. L
配置自动登录
下一步是确保客户端将在机器启动时(或 iSCSI 启动器服务启动/重新启动时)自动登录到上述每一个目标。与上述手动登录过程一样,在两个 Oracle RAC 节点上执行以下操作:
[size=1.78]复制
" L$ t0 q- j9 I% w, U* }: r+ vCopied to Clipboard6 n0 p" e6 F2 g/ _- |, y3 O
Error: Could not Copy2 |; |+ D8 o: ^5 B3 P6 T0 @9 e2 \
( {% u( d1 ]9 T; C
[root@racnode1 ~]#  iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.crs1 -p 192.168.2.195 --op update -n node.startup -v automatic [root@racnode1 ~]#  iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.data1 -p 192.168.2.195 --op update -n node.startup -v automatic [root@racnode1 ~]#  iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.fra1 -p 192.168.2.195 --op update -n node.startup -v automatic

0 t; j4 V- ~0 ]6 a" [4 h2 ]
创建持久本地 SCSI 设备名称
在本节中,我们将为每一个 iSCSI 目标名称创建持久本地 SCSI 设备名称。这将使用 udev 来完成。拥有一致的本地 SCSI 设备名称和所映射到的 iSCSI 目标,有助于在配置 ASM 时区分三个不同的卷。这并不是一项严格的需求,因为我们将为所有卷使用 ASMLib 2.0,而这提供了一种自我归档方法来快速识别每一个 iSCSI 卷的名称和位置。
当任何一个 Oracle RAC 节点启动以及 iSCSI 启动器服务启动时,它将自动登录到以随机方式配置的每一个目标,并将其映射至下一个可用的本地 SCSI 设备名称。例如,目标 iqn.2006-01.com.openfiler:racdb.crs1 可能会映射到 /dev/sdb。我实际上可以通过查看 /dev/disk/by-path 目录来确定所有目标的当前映射:
[size=1.78]复制9 ~+ X! i+ |. g# I) B
Copied to Clipboard( A: k" o! A9 Q- F- K8 G0 K
Error: Could not Copy- S& J0 F$ v2 j8 |- g2 l

7 p( x* p8 [" d8 a0 ~0 E, ^[root@racnode1 ~]#  (cd /dev/disk/by-path; ls -l *openfiler* | awk '{FS=" "; print $9 " " $10 " " $11}') ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0 -> ../../sdb ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0 -> ../../sdd ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0 -> ../../sdc

( n3 X4 [# d8 S# Y' A7 R+ }, u
我们可以使用上述输出建立以下当前映射:
当前 iSCSI 目标名称到本地 SCSI 设备名称映射
/ M# T6 _/ U9 |4 q) |! B$ v- q
iSCSI 目标名称
SCSI 设备名称

# [9 u+ [, r7 q/ }5 o
iqn.2006-01.com.openfiler:racdb.crs1
/dev/sdb
$ L, r/ ]  l- [1 Q" c/ u
iqn.2006-01.com.openfiler:racdb.data1
/dev/sdd
; r  U4 K/ ~# o$ O  o
iqn.2006-01.com.openfiler:racdb.fra1
/dev/sdc

& r2 T' O  b; @3 B, {

8 O" c' C% ~% W  c2 W! l9 p
但是,每次重新启动 Oracle RAC 节点时,此映射可能会发生更改。例如,在重新启动后,可能会确定 iSCSI 目标 iqn.2006-01.com.openfiler:racdb.crs1 映射到本地 SCSI 设备 /dev/sdc。因此,依赖于使用本地 SCSI 设备名称是不切实际的,因为在重新启动后无法预测 iSCSI 目标映射。
我们需要的是一个可供引用的一致设备名称(即 /dev/iscsi/crs1),它在重启后始终指向适当的 iSCSI 目标。这就是名为 udev 的动态设备管理工具的用武之地。udev 使用符号链接提供动态设备目录,这些链接使用一系列可配置规则指向实际设备。当 udev 接收到设备事件(例如,客户端登录到 iSCSI 目标)时,它会将其配置的规则与 sysfs 中提供的可用设备属性进行匹配以识别设备。匹配规则可能会提供额外的设备信息或指定设备节点名称和多个符号链接名称,并指示 udev 运行其他程序(例如 SHELL 脚本)作为设备事件处理过程的一部分。
下一步是创建一个新的规则文件。该文件将被命名为 /etc/udev/rules.d/55-openiscsi.rules 且仅包含一行 name=value 对,用于接收我们感兴趣的事件。它还将定义一个调用 SHELL 脚本 (/etc/udev/scripts/iscsidev.sh) 来处理事件。
在两个 Oracle RAC 节点上创建以下规则文件 /etc/udev/rules.d/55-openiscsi.rules:
[size=1.78]复制/ W+ ^5 E" l  h9 z
Copied to Clipboard
1 u9 s. |1 p9 c) t+ ]Error: Could not Copy7 T! Y& C9 F7 H: d0 O. H+ ]& N
5 Z% J5 Y# q7 O9 W5 J* |" I
.............................................. # /etc/udev/rules.d/55-openiscsi.rules KERNEL=="sd*", BUS=="scsi", PROGRAM="/etc/udev/scripts/iscsidev.sh %b",SYMLINK+="iscsi/%c/part%n" ..............................................

5 `$ X& ?  [/ ?# A( u* |3 {% c2 @$ l
我们现在需要创建 UNIX SHELL 脚本。当收到此事件时将调用该脚本。让我们首先在两个 Oracle RAC 节点上创建一个单独的目录来存储 udev 脚本:
[size=1.78]复制
6 \, c# R6 Q3 s0 q; e2 bCopied to Clipboard
6 p$ v- `% b: [5 T# ?7 NError: Could not Copy4 C5 s! K5 g/ U
  X1 W" F8 |, t2 c2 G$ b5 G
[root@racnode1 ~]#  mkdir -p /etc/udev/scripts

/ ^2 d$ ~* F) ~0 I( l
接下来,在两个 Oracle RAC 节点上创建 UNIX shell 脚本 /etc/udev/scripts/iscsidev.sh:
[size=1.78]复制
% B$ p" z7 U; B. E# i' g4 Z( vCopied to Clipboard' w0 s$ O3 u9 v9 @" H
Error: Could not Copy1 ^! e1 S2 [9 O4 E. ^

) j# _5 b6 Y' |) N/ @4 v; ].............................................. #!/bin/sh  # FILE: /etc/udev/scripts/iscsidev.sh  BUS=${1} HOST=${BUS%%:*}  -e /sys/class/iscsi_host ] || exit 1  file="/sys/class/iscsi_host/host${HOST}/device/session*/iscsi_session*/targetname"  target_name=$(cat ${file})  # This is not an open-scsi drive if -z "${target_name}" ]; then exit 1 fi  # Check if QNAP drive check_qnap_target_name=${target_name%%:*} if $check_qnap_target_name = "iqn.2004-04.com.qnap" ]; then target_name=`echo "${target_name%.*}"` fi  echo "${target_name##*.}" ..............................................
1 ]9 u1 i: O# d. R
在创建 UNIX SHELL 脚本之后,将其更改为可执行文件:
[size=1.78]复制6 T2 W4 g0 S: W9 s
Copied to Clipboard
% B: E1 R0 \7 D# ?Error: Could not Copy
/ F' O; E3 [/ P! o- h3 V: d0 @5 {
& ]2 k: q8 {/ ^4 T0 S( X/ W
[root@racnode1 ~]#  chmod 755 /etc/udev/scripts/iscsidev.sh
7 ^$ L5 {/ k) X  \$ C* t- m
现在已经配置了 udev,接下来在两个 Oracle RAC 节点上重新启动 iSCSI 服务:
[size=1.78]复制0 e# c$ c: A/ B
Copied to Clipboard
% o& ^& g8 N4 m7 z1 wError: Could not Copy
7 }$ f) i7 H( _8 Y

+ J; R+ L; Q0 B3 L) q3 H[root@racnode1 ~]#  service iscsi stop Logging out of session [sid: 6, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260] Logging out of session [sid: 7, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260] Logging out of session [sid: 8, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260] Logout of [sid: 6, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]: successful Logout of [sid: 7, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]: successful Logout of [sid: 8, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]: successful Stopping iSCSI daemon:   OK ]  [root@racnode1 ~]#  service iscsi start iscsid dead but pid file exists Turning off network shutdown. Starting iSCSI daemon:   OK ]   OK ] Setting up iSCSI targets: Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260] Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260] Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260] Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]: successful Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]: successful Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]: successful   OK ]
9 r3 N  e8 J' `5 N% B* N; s, t
我们来看看最终的结果:
[size=1.78]复制
' V4 m* D+ J3 W4 j# YCopied to Clipboard6 c' S& k# r) v  f
Error: Could not Copy
$ S+ R2 S8 x+ x+ C1 c- G) W
) T# d/ N- X# n5 Z0 G+ J6 z5 ?2 Q
[root@racnode1 ~]#  ls -l /dev/iscsi/* /dev/iscsi/crs1: total 0 lrwxrwxrwx 1 root root 9 Nov 3 18:13 part -> ../../sdc  /dev/iscsi/data1: total 0 lrwxrwxrwx 1 root root 9 Nov 3 18:13 part -> ../../sde  /dev/iscsi/fra1: total 0 lrwxrwxrwx 1 root root 9 Nov 3 18:13 part -> ../../sdd

) J) ?5 \2 A* ?3 p6 M2 M
以上清单显示 udev 完成了其应当完成的工作!我们现在拥有了一组一致的本地设备名称,可用于引用 iSCSI 目标。例如,我们可以安全地假定设备名称 /dev/iscsi/crs1/part 将始终引用 iSCSI 目标 iqn.2006-01.com.openfiler:racdb.crs1。我们现在通过一致的 iSCSI 目标名称与本地设备名称相映射,如下表所述:
iSCSI 目标名称到本地设备名称映射

4 s: l1 L; P2 E
iSCSI 目标名称
本地设备名称
# `# Y4 W$ d& a5 ]2 S
iqn.2006-01.com.openfiler:racdb.crs1
/dev/iscsi/crs1/part
+ o% E1 Y) j& h: P0 d5 x: a
iqn.2006-01.com.openfiler:racdb.data1
/dev/iscsi/data1/part

8 v3 j: V& \1 F/ A6 w" h1 P
iqn.2006-01.com.openfiler:racdb.fra1
/dev/iscsi/fra1/part

- D: |7 i$ _' Q: o$ y) p( ~, {+ L
4 L8 ^# p; M1 L8 A: Z
在 iSCSI 卷上创建分区
我们现在需要在跨整个卷大小的各个 iSCSI 卷上创建一个主分区。如前所述,我将使用自动存储管理 (ASM) 来存储 Oracle Clusterware 所需的共享文件、物理数据库文件(数据/索引文件、联机重做日志文件和控制文件)以及集群数据库的快速恢复区 (FRA)。
Oracle Clusterware 共享文件(OCR 和表决磁盘)将存储在名为 +CRS 的 ASM 磁盘组中,该磁盘组将配置为外部冗余。集群数据库的物理数据库文件将存储在名为 +RACDB_DATA 的 ASM 磁盘组中,该磁盘组也将配置为外部冗余。最后,快速恢复区(RMAN 备份和归档重做日志文件)将存储在名为 +FRA 的第三个 ASM 磁盘组中,该磁盘组也将配置为外部冗余。
下表列出了将创建的三个 ASM 磁盘组以及它们将包含哪些 iSCSI 卷:
Oracle 共享驱动器配置
1 T0 E6 _2 O$ [9 l# \: r
文件类型
ASM 磁盘组名称
iSCSI 目标(短)名称
ASM 冗余
大小
ASMLib 卷名

+ C( O" S) X, b: U: Q5 P- Q6 c
OCR 和表决磁盘
+CRScrs1外部2GB
ORCL:CRSVOL1
1 J2 |) x( t. p1 {4 A
Oracle 数据库文件
+RACDB_DATAdata1外部32 GB
ORCL:DATAVOL1

- k/ d! Y" t7 m: R1 y$ p$ c" y7 g
Oracle 快速恢复区
+FRAfra1外部32 GB
ORCL:FRAVOL1
2 t3 `7 T9 a7 M5 y, w' H
9 w/ D2 {" O; o6 `( s8 W
如上表所示,我们需要在每一个 iSCSI 卷上都创建一个 Linux 主分区。fdisk 命令在 Linux 中用于创建(和删除)分区。对于每一个 iSCSI 卷,您都可以在创建主分区时使用默认值,因为默认操作是使用整个磁盘。您可以安全地忽略任何可能表明设备不包含有效 DOS 分区(或 Sun、SGI 或 OSF 磁盘标签)的警告。
在本例中,我将从 racnode1 中运行 fdisk 命令,并使用 udev 在上一节中创建的本地设备名称在每一个 iSCSI 目标上创建单一主分区:
  • /dev/iscsi/crs1/part
  • /dev/iscsi/data1/part
  • /dev/iscsi/fra1/part
    ! y' Z' q& X) H7 n" d. d; z# }5 F
注意:在每一个 iSCSI 卷上创建单一分区时,只能从 Oracle RAC 集群中的一个节点运行!(即 racnode1)
[size=1.78]复制
, p4 P6 P* F" e; ACopied to Clipboard
$ g# P  k" ^; J  z4 u9 aError: Could not Copy) t% A3 g, r' b5 y4 L! {( B

1 K; o" s; y3 x# ---------------------------------------  [root@racnode1 ~]#  fdisk /dev/iscsi/crs1/part Command (m for help):  n Command action e extended p primary partition (1-4) p Partition number (1-4):  1 First cylinder (1-1012, default 1):  1 Last cylinder or +size or +sizeM or +sizeK (1-1012, default 1012):  1012  Command (m for help):  p  Disk /dev/iscsi/crs1/part: 2315 MB, 2315255808 bytes 72 heads, 62 sectors/track, 1012 cylinders Units = cylinders of 4464 * 512 = 2285568 bytes  Device Boot Start End Blocks Id System /dev/iscsi/crs1/part1 1 1012 2258753 83 Linux  Command (m for help):  w The partition table has been altered!  Calling ioctl() to re-read partition table. Syncing disks.  # ---------------------------------------  [root@racnode1 ~]#  fdisk /dev/iscsi/data1/part Command (m for help):  n Command action e extended p primary partition (1-4) p Partition number (1-4):  1 First cylinder (1-33888, default 1):  1 Last cylinder or +size or +sizeM or +sizeK (1-33888, default 33888):  33888  Command (m for help):  p  Disk /dev/iscsi/data1/part: 35.5 GB, 35534143488 bytes 64 heads, 32 sectors/track, 33888 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes  Device Boot Start End Blocks Id System /dev/iscsi/data1/part1 1 33888 34701296 83 Linux  Command (m for help):  w The partition table has been altered!  Calling ioctl() to re-read partition table. Syncing disks.   # ---------------------------------------  [root@racnode1 ~]#  fdisk /dev/iscsi/fra1/part Command (m for help):  n Command action e extended p primary partition (1-4) p Partition number (1-4):  1 First cylinder (1-33888, default 1):  1 Last cylinder or +size or +sizeM or +sizeK (1-33888, default 33888):  33888  Command (m for help):  p  Disk /dev/iscsi/fra1/part: 35.5 GB, 35534143488 bytes 64 heads, 32 sectors/track, 33888 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes  Device Boot Start End Blocks Id System /dev/iscsi/fra1/part1 1 33888 34701296 83 Linux  Command (m for help):  w The partition table has been altered!  Calling ioctl() to re-read partition table. Syncing disks.

7 }) m4 H$ Q" f/ N* a: n
验证新分区
从 racnode1 创建所有必需的分区后,您现在应当使用以下命令作为 Oracle RAC 集群 (racnode2) 中所有其余节点的“root”用户帐户,以便于向内核通知分区更改。请注意,从 Openfiler 发现的 iSCSI 目标名称与本地 SCSI 设备名称的映射在两个 Oracle RAC 节点上将有所不同。这不是问题,也不会造成任何问题,因为我们不会使用本地 SCSI 设备名称,而是使用 udev 在上一节中创建的本地设备名称。
从 racnode2 中,运行以下命令:
[size=1.78]复制/ v+ y$ G1 Z2 ?( H! L2 Y, d7 ]
Copied to Clipboard
6 C4 G  y& v" s/ V0 W, VError: Could not Copy3 g" @6 @  t6 w# X
1 g! Y- I0 d) E. C+ ~; e4 P4 w
[root@racnode2 ~]#  partprobe  [root@racnode2 ~]#  fdisk -l  Disk /dev/sda: 160.0 GB, 160000000000 bytes 255 heads, 63 sectors/track, 19452 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes  Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 19452 156143767+ 8e Linux LVM  Disk /dev/sdb: 35.5 GB, 35534143488 bytes 64 heads, 32 sectors/track, 33888 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes  Device Boot Start End Blocks Id System /dev/sdb1 1 33888 34701296 83 Linux  Disk /dev/sdc: 35.5 GB, 35534143488 bytes 64 heads, 32 sectors/track, 33888 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes  Device Boot Start End Blocks Id System /dev/sdc1 1 33888 34701296 83 Linux  Disk /dev/sdd: 2315 MB, 2315255808 bytes 72 heads, 62 sectors/track, 1012 cylinders Units = cylinders of 4464 * 512 = 2285568 bytes  Device Boot Start End Blocks Id System /dev/sdd1 1 1012 2258753 83 Linux
- X7 r# _1 Q. |( a
最后一步,您应当在两个 Oracle RAC 节点上运行以下命令以验证 udev 是否为每个新分区创建了新的符号链接:
[size=1.78]复制
- [, L3 ]0 w. k: o0 M( W. XCopied to Clipboard
: i& |$ b* E* D2 ^3 yError: Could not Copy/ N4 b. U: ?0 {1 L8 v7 w' M. q$ _

) M7 }: T$ w# i6 T  [+ R6 v6 M[root@racnode2 ~]#  (cd /dev/disk/by-path; ls -l *openfiler* | awk '{FS=" "; print $9 " " $10 " " $11}') ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0 -> ../../sdd ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0-part1 -> ../../sdd1 ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0 -> ../../sdc ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0-part1 -> ../../sdc1 ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0 -> ../../sdb ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0-part1 -> ../../sdb1

! ?/ U: U6 Y% |1 Q3 A$ r
以上清单显示 udev 确实为每一个新分区创建了新的设备名称。在本指南稍后为 ASMlib 配置卷时,我们将使用这些新设备名称:

, G6 ~' C. _: W  Z0 e0 ]; Z$ y
  • /dev/iscsi/crs1/part1
  • /dev/iscsi/data1/part1
  • /dev/iscsi/fra1/part1
    2 L1 K9 I$ q. B2 d1 \& g

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-7-9 17:25:52 | 显示全部楼层
12.在 Oracle RAC 节点上配置 iSCSI 卷5 h  I; x- }) h& z% x
在集群中的两个 Oracle RAC 节点上配置 iSCSI 启动器。但是,应当仅在 RAC 集群中的节点之一上执行创建分区的操作。
6 e8 k) ~) d0 v3 r) e" u9 x7 S, yiSCSI 客户端可以是任何提供 iSCSI 支持(驱动程序)的系统(Linux、Unix、MS Windows、Apple Mac 等)。在本例中,客户端是两个 Linux 服务器,即 racnode1 和 racnode2,运行 Oracle Enterprise Linux 5.4。
# t* O6 {5 ]# s% G! e! M0 F  H' l在本节中,我们将在两个 Oracle RAC 节点上配置 iSCSI 软件启动器。Oracle Enterprise Linux 5.4 包含 Open-iSCSI iSCSI 软件启动器,可从 iscsi-initiator-utils RPM 中获取该软件启动器。这与之前版本的 Oracle Enterprise Linux (4.x) 有所不同,该版本包含作为 Linux-iSCSI 项目中的一部分而开发的 Linux iscsi-sfnet 软件驱动程序。所有 iSCSI 管理任务(如发现和登录)都将使用 Open-iSCSI 中包含的命令行界面 iscsiadm。8 j# l8 F% O% E. W4 l
iSCSI 软件启动器将被配置为自动登录至网络存储服务器 (openfiler1) 并发现上一节中创建的 iSCSI 卷。随后,我们将使用 udev 为所发现的每一个 iSCSI 目标名称创建持久本地 SCSI 设备名称(即 /dev/iscsi/crs1)。拥有一致的本地 SCSI 设备名称和所映射到的 iSCSI 目标,有助于在配置 ASM 时区分三个不同的卷。但是,在此之前,我们需要先安装 iSCSI 启动器软件。
8 M; Q) [& @1 \! W注意: 本指南使用 ASMLib 2.0,它是 Oracle 数据库的自动存储管理 (ASM) 特性的支持库。ASMLib 将用于标记本指南中使用的所有 iSCSI 卷。默认情况下,ASMLib 已经为与 ASM 一起使用的存储设备提供了持久路径和权限。此功能消除了使用存储设备路径和权限更新 udev 或 devlabel 文件的需要。在本文和实践中,我仍然选择为使用 udev 发现的每一个 iSCSI 目标名称创建持久本地 SCSI 设备名称。这提供了一种自我归档方法,有助于快速识别每一个卷的名称和位置。  b0 n$ f4 V& U* }$ {7 z6 d/ t
安装 iSCSI(启动器)服务: O" W, V9 h5 v2 t/ ~- _" T8 L/ o
对于 Oracle Enterprise Linux 5.4,默认情况下不会安装 Open-iSCSI iSCSI 软件启动器。该软件包含在 iscsi-initiator-utils 软件包中,可从 CD #1 中找到该软件包。要确定是否安装了此软件包(大多数情况下未安装),请在两个 Oracle RAC 节点上执行以下操作:
7 j& L- x% Y+ C复制! c( \3 j0 s. Z! p% A1 a" ?5 Y
Copied to ClipboardError: Could not Copy
' \; b0 U2 F7 G9 @/ C[root@racnode1 ~]#
2 U. h! w; _3 Q- R9 f( v rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"| grep iscsi-initiator-utils
: d4 H/ t5 K" r3 `6 c[root@racnode1 ~]# ' d  t& G6 E. V9 g3 v0 F/ [
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"| grep iscsi-initiator-utils
  Q2 U3 I. L9 e! C+ N7 S# |7 ^如果未安装 iscsi-initiator-utils 软件包,则将 CD #1 加载到每一个 Oracle RAC 节点中,然后执行以下操作:
7 G" [/ m0 Q) l% x  F复制4 {$ Q+ ^2 S; R% a
Copied to ClipboardError: Could not Copy
: e# I! W( `; c, g( @[root@racnode1 ~]# $ f2 L5 h8 D! L2 P6 p" f& R- c
mount -r /dev/cdrom /media/cdrom" j, ^/ {: x$ _' G: x3 O, @
[root@racnode1 ~]# / l# E  e+ {0 j- j7 A
cd /media/cdrom/Server3 h3 u$ u! M# Z6 _
[root@racnode1 ~]# ( F- B, O4 K+ w
rpm -Uvh iscsi-initiator-utils-*
! E. m# X; ^$ Q( U" C+ I; E) G [root@racnode1 ~]#
' w9 Z8 i) X$ @- K4 y; X cd /
+ e, R! a3 T7 F% U( j [root@racnode1 ~]#
( Q2 \, ?% V  c eject. ^+ K1 n9 ^  k6 a- w
[root@racnode1 ~]# 5 W% r' G0 A  O4 }8 i5 T" E* B
mount -r /dev/cdrom /media/cdrom
+ n# R2 c4 B0 c5 O [root@racnode1 ~]#
4 D( L* N2 l: @" r1 h% x cd /media/cdrom/Server6 {) f+ H) ^2 H- f; [0 j# Y* P: w
[root@racnode1 ~]#
2 I) |6 w& A# ]) L rpm -Uvh iscsi-initiator-utils-*
3 r& v7 a+ b& @ [root@racnode1 ~]# 5 D) r* ]: ?' u
cd // V" S3 m. w% M0 I( g% p1 ^. X9 g" F
[root@racnode1 ~]#   d5 c3 R0 y/ ?8 @
eject# X) Y9 v' B9 X0 e4 I/ K, g) A# w: N
验证现已安装 iscsi-initiator-utils 软件包:
* c! z8 s% y9 |" Y+ C5 U7 Q复制
* s' s" U8 b$ w5 ^2 L8 ~: V6 QCopied to ClipboardError: Could not Copy) L* F) ]9 `3 f5 V( K+ l7 k+ A' Z
[root@racnode1 ~]# . ^% w9 J* ]5 N* c
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"| grep iscsi-initiator-utils
# B$ ]" r4 q$ }  z" w/ \: m4 i7 f iscsi-initiator-utils-6.2.0.871-0.10.el5 (x86_64)
" @  o1 j/ @9 y1 S, I4 d[root@racnode1 ~]# & J5 ?1 x7 W8 C& e, P" m* G
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"| grep iscsi-initiator-utils+ ]- O4 m- G0 e, _" n! ?
iscsi-initiator-utils-6.2.0.871-0.10.el5 (x86_64)1 x) x! n$ W0 r. v. X
配置 iSCSI(启动器)服务, L' T$ g. g) P; A8 B, i4 Y) e: b
验证两个 Oracle RAC 节点上均安装了 iscsi-initiator-utils 软件包之后,启动 iscsid 服务并设置其在系统启动时自动启动。我们还将配置 iSCSI 服务自动启动,以便于在系统启动时登录到所需 iSCSI 目标。# s/ b" o$ F4 d' D! T
复制
1 @& U. ~5 s/ ^4 v9 BCopied to ClipboardError: Could not Copy
# S: m* n! u0 z8 e8 c3 t0 q7 d+ l[root@racnode1 ~]#
& u2 S, x# c3 v3 G; s" C/ }0 ]' x  h service iscsid start
: M5 h: H# T( Y, z Turning off network shutdown. Starting iSCSI daemon:   G" d! u% w4 C$ T

  `5 Z7 n- r4 t: t+ \4 @ OK ]; U1 F: K; `: B& B
( k, D6 y3 P7 m- ^9 w
% {" m, s9 A! \+ l
OK ]- ^/ q0 T# |. ]# O# E- Z$ y8 o
8 g* V" ]+ E7 Z) p
[root@racnode1 ~]# 2 j( @7 k& f6 S' O
chkconfig iscsid on! |( j; N9 H" r7 _7 G) N
[root@racnode1 ~]#
# u# p( K" G9 n/ N$ ?6 b  F chkconfig iscsi on
# {; k5 ~& [1 c9 ?0 q7 X: ^[root@racnode1 ~]# ; t9 ~% u+ |- v- T
service iscsid start9 l- O- d7 L  |9 X
Turning off network shutdown. Starting iSCSI daemon: ) d' D' [1 C7 C; Z8 x2 T+ f$ Q

* e% L7 z# i+ v$ V* y# e OK ]0 ~4 v3 |& w" A0 c& q9 n
0 D( v. `( ]7 k# q# }; b

% ^; v% K& _8 g' D( a( t OK ]
+ P' m, z2 `% F0 s
! X6 a: m' z2 E4 j0 ~ [root@racnode1 ~]#
- \9 a, j" _6 D5 N7 ]/ K: L' \ chkconfig iscsid on" S( R8 U8 O4 [, Q" \6 u
[root@racnode1 ~]# & ~3 W7 K9 y) P: i: [1 @
chkconfig iscsi on
" B  S$ E$ V% E1 ~/ k9 f) j现在 iSCSI 服务已启动,请使用 iscsiadm 命令行界面来发现网络存储服务器上的所有可用目标。这应当在两个 Oracle RAC 节点上执行,以验证配置是否正常运行:
, p2 T0 }) }4 h) |7 ^' Q: M复制
* r7 p; g" C2 }Copied to ClipboardError: Could not Copy( N& J0 A4 ]) F: y2 w
[root@racnode1 ~]# & v# Z( Y2 I1 |/ ^7 \9 T& ?
iscsiadm -m discovery -t sendtargets -p openfiler1-priv
. ~( L# b5 ~& J! {. J# P, x$ d 192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.crs1) z" Z; G+ N+ c% B- W1 H
192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.fra1
& @7 e7 g1 H! u2 ~" b 192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.data13 A. l1 `. x9 N0 a6 N/ m7 J* t: o
[root@racnode1 ~]# - |; s* k6 ~2 u7 k. `# h
iscsiadm -m discovery -t sendtargets -p openfiler1-priv
0 k  @; K' T( }4 H 192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.crs1% ^0 c: n( d: F( @6 ]1 `8 l$ B
192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.fra1
+ L, C# \2 L/ y. W; K/ i4 [" R 192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.data1  @7 L) Y8 X8 p' J
手动登录至 iSCSI 目标
3 \" z7 b7 C" T: }至此,iSCSI 启动器服务已启动,每一个 Oracle RAC 节点都可以从网络存储服务器中发现可用目标。下一步是手动登录至每一个可用目标,可以使用 iscsiadm 命令行界面来执行此操作。两个 Oracle RAC 节点上都需要运行此任务。请注意,我需要指定 IP 地址,而不是网络存储服务器的主机名 (openfiler1-priv) - 我认为这是必需的,因为(上述)发现显示了使用 IP 地址的目标。4 @0 z, H2 a$ A: r
复制/ @! y- x8 u- b# f
Copied to ClipboardError: Could not Copy; Z3 m, c* D2 W5 a0 N
[root@racnode1 ~]# ; Z, X3 I5 R3 a" [+ c
iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.crs1 -p 192.168.2.195 -l
# S' }0 [) c5 Q# N  P [root@racnode1 ~]# ) u" g7 J# [) F" }
iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.data1 -p 192.168.2.195 -l
2 T9 {: y  r+ Z1 ~  S [root@racnode1 ~]# 0 e7 Y! K  L. e- Z) W& ~. O
iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.fra1 -p 192.168.2.195 -l
1 R! z. H1 L4 z& `7 k$ F[root@racnode1 ~]# 8 ^, X+ H6 h. i
iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.crs1 -p 192.168.2.195 -l/ g# x  \$ H2 D. o8 S7 H
[root@racnode1 ~]#
8 K! `, `$ a2 W* A, C+ a iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.data1 -p 192.168.2.195 -l7 P7 E. Y. v0 f5 Y
[root@racnode1 ~]#
# Q# z) R& a4 |' A iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.fra1 -p 192.168.2.195 -l
; t1 c( R) Y# j5 ^/ C配置自动登录
8 T; H) x. ~' B0 t" d7 C3 P4 k下一步是确保客户端将在机器启动时(或 iSCSI 启动器服务启动/重新启动时)自动登录到上述每一个目标。与上述手动登录过程一样,在两个 Oracle RAC 节点上执行以下操作:8 r5 @5 Y7 C- Q- @1 z; W& E
复制  g9 `/ Q- n9 O3 L8 p
Copied to ClipboardError: Could not Copy
$ {: d- O! d' u7 {9 _[root@racnode1 ~]#
4 o) o2 p7 d. D iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.crs1 -p 192.168.2.195 --op update -n node.startup -v automatic' w4 }& J5 c9 _& |
[root@racnode1 ~]# 4 f' `; V* V3 E2 g- [8 e4 [
iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.data1 -p 192.168.2.195 --op update -n node.startup -v automatic5 I" o4 W9 z. A4 x: A  \( m
[root@racnode1 ~]# * R5 w4 w) X7 d+ F7 b) W6 @+ p
iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.fra1 -p 192.168.2.195 --op update -n node.startup -v automatic% ~; t2 v4 N8 p$ A+ o( G- D
[root@racnode1 ~]# . O6 Y: v( `( u! ?9 X+ V
iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.crs1 -p 192.168.2.195 --op update -n node.startup -v automatic: `& c* ]( I( k. w4 |
[root@racnode1 ~]# ! z4 E7 i$ F' o: l8 \9 G
iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.data1 -p 192.168.2.195 --op update -n node.startup -v automatic9 K- h0 e; ~) C: y0 X$ x" t% P2 y9 }
[root@racnode1 ~]# ! Y( h3 \! b0 _' |, T) C
iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.fra1 -p 192.168.2.195 --op update -n node.startup -v automatic# ~% ?% l* i7 m- r* c9 S+ Y5 p$ U
创建持久本地 SCSI 设备名称
9 R  x2 a2 K2 X! X+ K  r0 K* e' Y% Q在本节中,我们将为每一个 iSCSI 目标名称创建持久本地 SCSI 设备名称。这将使用 udev 来完成。拥有一致的本地 SCSI 设备名称和所映射到的 iSCSI 目标,有助于在配置 ASM 时区分三个不同的卷。这并不是一项严格的需求,因为我们将为所有卷使用 ASMLib 2.0,而这提供了一种自我归档方法来快速识别每一个 iSCSI 卷的名称和位置。
7 q+ p$ p% d4 J! m当任何一个 Oracle RAC 节点启动以及 iSCSI 启动器服务启动时,它将自动登录到以随机方式配置的每一个目标,并将其映射至下一个可用的本地 SCSI 设备名称。例如,目标 iqn.2006-01.com.openfiler:racdb.crs1 可能会映射到 /dev/sdb。我实际上可以通过查看 /dev/disk/by-path 目录来确定所有目标的当前映射:9 h( m8 J  W/ L  E: R9 S/ f
复制
% u* y1 g3 u/ dCopied to ClipboardError: Could not Copy
; {9 w2 \% e. h# u3 ^0 g[root@racnode1 ~]# 6 W( v! _& t( L+ `2 v
(cd /dev/disk/by-path; ls -l *openfiler* | awk '{FS=" "; print $9 " " $10 " " $11}')
" m& k# U  y& X ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0 -> ../../sdb7 G5 p1 V; U0 K9 r% p5 v
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0 -> ../../sdd
) h7 e/ F6 t3 j- j ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0 -> ../../sdc2 ^' a+ V% p; F' ^7 S  ~
[root@racnode1 ~]#
0 |8 U# m4 ^! ]* d6 C" C1 V9 [  T (cd /dev/disk/by-path; ls -l *openfiler* | awk '{FS=" "; print $9 " " $10 " " $11}')
- n  C, f) c& R" u/ c- A ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0 -> ../../sdb7 K2 w1 [2 Z+ N' U3 ~' A7 u
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0 -> ../../sdd, ?) b; L2 R1 k1 `
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0 -> ../../sdc
, a& J; d: e2 M: S6 D  Z我们可以使用上述输出建立以下当前映射:
  |" l- E! X% A1 Y2 [" j% P. T% V! i当前 iSCSI 目标名称到本地 SCSI 设备名称映射
9 ^4 z1 H9 k+ x, r$ UiSCSI 目标名称 SCSI 设备名称* I$ x. T% A1 Y( w* ?! \; k8 Y
iqn.2006-01.com.openfiler:racdb.crs1 /dev/sdb8 u6 l0 i/ `7 @# K0 B1 s
iqn.2006-01.com.openfiler:racdb.data1 /dev/sdd+ t# P  i; T0 N! Q
iqn.2006-01.com.openfiler:racdb.fra1 /dev/sdc9 {% j$ Z* Z9 A# [
但是,每次重新启动 Oracle RAC 节点时,此映射可能会发生更改。例如,在重新启动后,可能会确定 iSCSI 目标 iqn.2006-01.com.openfiler:racdb.crs1 映射到本地 SCSI 设备 /dev/sdc。因此,依赖于使用本地 SCSI 设备名称是不切实际的,因为在重新启动后无法预测 iSCSI 目标映射。7 \& ]" ?, f2 h1 v4 U
我们需要的是一个可供引用的一致设备名称(即 /dev/iscsi/crs1),它在重启后始终指向适当的 iSCSI 目标。这就是名为 udev 的动态设备管理工具的用武之地。udev 使用符号链接提供动态设备目录,这些链接使用一系列可配置规则指向实际设备。当 udev 接收到设备事件(例如,客户端登录到 iSCSI 目标)时,它会将其配置的规则与 sysfs 中提供的可用设备属性进行匹配以识别设备。匹配规则可能会提供额外的设备信息或指定设备节点名称和多个符号链接名称,并指示 udev 运行其他程序(例如 SHELL 脚本)作为设备事件处理过程的一部分。1 J. h1 w5 ^5 z& w
下一步是创建一个新的规则文件。该文件将被命名为 /etc/udev/rules.d/55-openiscsi.rules 且仅包含一行 name=value 对,用于接收我们感兴趣的事件。它还将定义一个调用 SHELL 脚本 (/etc/udev/scripts/iscsidev.sh) 来处理事件。* ~! X) h: C6 |& |: }: r- h5 x. X" o
在两个 Oracle RAC 节点上创建以下规则文件 /etc/udev/rules.d/55-openiscsi.rules:2 W, m/ k$ R5 @
复制% d. n" z0 n5 b* j1 u3 V3 e
Copied to ClipboardError: Could not Copy% `8 n* @% l+ Y
..............................................  t9 a# U1 n% G. H0 u7 R7 K
# /etc/udev/rules.d/55-openiscsi.rules
3 i# d6 e2 B9 l* ~8 d KERNEL=="sd*", BUS=="scsi", PROGRAM="/etc/udev/scripts/iscsidev.sh %b",SYMLINK+="iscsi/%c/part%n"! T$ L( g* E. j0 G% L( B/ G
..............................................0 \; g/ J% ~  k/ I/ q
..............................................
# T$ ^  e$ X2 M7 c. U5 C( J3 n # /etc/udev/rules.d/55-openiscsi.rules
3 N7 ?* x$ e0 y. @2 S' v# Y KERNEL=="sd*", BUS=="scsi", PROGRAM="/etc/udev/scripts/iscsidev.sh %b",SYMLINK+="iscsi/%c/part%n"
, f9 B* P7 r! J! G* o ............................................../ D7 [1 k1 `, M- V8 m  Y
我们现在需要创建 UNIX SHELL 脚本。当收到此事件时将调用该脚本。让我们首先在两个 Oracle RAC 节点上创建一个单独的目录来存储 udev 脚本:
- z4 j9 h  ^2 Q) T9 \8 T复制4 l( q5 m! I& B+ K  e  L3 W' d& J
Copied to ClipboardError: Could not Copy2 }/ c4 b' N+ E2 _# k& ?
[root@racnode1 ~]# / p4 i4 G/ Y6 \5 T
mkdir -p /etc/udev/scripts
- Y* x2 O1 o9 s6 V3 ~1 k[root@racnode1 ~]#
+ B! j& W! d1 O( ~& Q" i mkdir -p /etc/udev/scripts
* ~  Q1 Y" P' A$ d) U- E/ Y接下来,在两个 Oracle RAC 节点上创建 UNIX shell 脚本 /etc/udev/scripts/iscsidev.sh:3 c' W# J) X8 E; G* K  R
复制
. g/ i3 D$ h2 v$ A6 wCopied to ClipboardError: Could not Copy
3 ^, I) d, O( O9 E6 |/ X/ R/ D1 \9 P2 t1 y..............................................
% V8 I" K& A! q* m #!/bin/sh
1 d, @1 D: N, l& s0 j& d4 Q/ w # z6 f; L8 t5 v& W) _4 ^: d; @
# FILE: /etc/udev/scripts/iscsidev.sh
; H; {9 z; ~% W+ E- U
5 E- A: ~$ y5 R  R4 a BUS=${1}* z! k6 F4 p- j
HOST=${BUS%%:*}
; k' L% O6 e  Y) `+ g1 q3 L7 k2 } 7 q# Y6 y# `$ s/ [
-e /sys/class/iscsi_host ] || exit 1
+ V& ]4 p( j; R8 M( D' Y( P4 v: K7 z * ^/ g4 M: d& x! o# b/ Q4 [% S
file="/sys/class/iscsi_host/host${HOST}/device/session*/iscsi_session*/targetname"
% U. }3 {* K1 U$ n' `- F; w
9 Z! m/ H, z1 _. z0 }( ]3 C, R  ? target_name=$(cat ${file})
3 i1 A7 @9 U9 W% a5 C; t2 r' Z
9 u/ X4 d/ @9 S2 Y! \ # This is not an open-scsi drive0 |8 H! T! D! }' C- C
if -z "${target_name}" ]; then
/ H! K4 ~9 U% ~0 O" Y exit 1; M# B# c" v& q4 l- S
fi  R  G# V: G0 Z: G+ z' n
8 P& ~0 X7 T0 j
# Check if QNAP drive9 _1 p+ g1 f; _3 Y1 @
check_qnap_target_name=${target_name%%:*}$ V; z; m3 U; g6 T& k
if $check_qnap_target_name = "iqn.2004-04.com.qnap" ]; then' f; i3 f0 m  C# Z/ o: ?
target_name=`echo "${target_name%.*}"`* l7 o; f7 y! B  w
fi
0 N& v/ k5 q& z 9 I; M/ B: V. ?2 x& c3 z3 z
echo "${target_name##*.}"+ v/ y) g, y* O) k
..............................................7 X/ e$ d8 Z; Z# }2 d+ ]8 R; m
..............................................
5 ^0 j+ Q- B+ ~$ t4 [$ ] #!/bin/sh) V; `' c  i$ p0 c0 J

( v- p; r  z4 S3 Z) e4 s( ^7 W # FILE: /etc/udev/scripts/iscsidev.sh; }  O1 F% H" {5 `8 z3 t  Q

% i7 O7 Z1 I1 A BUS=${1}! W# g6 I) h4 E  z8 F# p
HOST=${BUS%%:*}1 c( n# c( ^! B% o  x- r
% r0 x, d- T7 P9 x6 t2 e3 ]: M1 M* A
-e /sys/class/iscsi_host ] || exit 1
" E7 Q/ k. D3 @8 C" D; N& ^
8 T% W7 D: E4 N% t9 k7 n0 B5 l- e file="/sys/class/iscsi_host/host${HOST}/device/session*/iscsi_session*/targetname"
+ ^3 R. C% q$ I  t. c1 l . A' Z3 q* |0 H! M% r3 k
target_name=$(cat ${file})5 A: R4 q' F! @* {2 b6 X1 ?

* R; B+ T! w3 V9 h1 T' c # This is not an open-scsi drive
' \+ T7 L7 ~0 [9 H& D* W! L5 O if -z "${target_name}" ]; then& h, M4 Y$ s" H' |
exit 1
- @# W! a9 N. \7 a2 U fi
" |& ^; J4 M- D: D % U( D, H3 n. i7 C
# Check if QNAP drive. I. Z  b( }# K8 T5 g. x
check_qnap_target_name=${target_name%%:*}
& G: d* e; P" v% \ if $check_qnap_target_name = "iqn.2004-04.com.qnap" ]; then5 ?( n7 K2 g, a  X. Q! Y6 n
target_name=`echo "${target_name%.*}"`
; K" w. B: V* l; {% x. T2 K& ` fi. u" ^) C1 n  J' C* m* l' _% M
# f; V' [% D) a$ r
echo "${target_name##*.}"3 p: q5 C/ h1 O) g+ {0 ?
.............................................." u/ M( o2 _) u9 ]8 g
在创建 UNIX SHELL 脚本之后,将其更改为可执行文件:  x! i: o6 f8 [/ ~5 v
复制
5 `, t# W3 I( g( j" hCopied to ClipboardError: Could not Copy# L; h% b; u9 S* P# I0 H( Z
[root@racnode1 ~]#
( w& b' V' w7 z) P  | chmod 755 /etc/udev/scripts/iscsidev.sh
' X6 \+ ^6 ]+ h* h  g5 M[root@racnode1 ~]# 1 m+ N6 w$ K9 Y6 D  \6 l; P
chmod 755 /etc/udev/scripts/iscsidev.sh, S" i2 [/ @: }: c) B; C
现在已经配置了 udev,接下来在两个 Oracle RAC 节点上重新启动 iSCSI 服务:
4 d5 b4 a  G( a- {6 a- }5 w( T复制; R6 ~+ i0 Q( M6 g1 D# P
Copied to ClipboardError: Could not Copy
! S7 r2 z7 [5 [8 w* P[root@racnode1 ~]#
) C3 x6 y" V: F2 L service iscsi stop
' t" W% z/ Y- k Logging out of session [sid: 6, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]" }# }0 N) h! @
Logging out of session [sid: 7, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]/ [, ^' B* `) q1 V$ b' C* R
Logging out of session [sid: 8, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]2 R5 X, g. X8 I4 ?- i
Logout of [sid: 6, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]: successful
5 S! ~6 c4 `, T- M Logout of [sid: 7, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]: successful5 |! c+ j- l& y6 e, g+ S$ X5 S6 m
Logout of [sid: 8, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]: successful; x% |# {3 R  |1 P' |
Stopping iSCSI daemon:
: O& G! e% j" U5 z0 w# f + m5 ?/ d' x& ]; W8 W8 {4 h
OK ]
. B  V9 g5 d" m4 K
4 Q; w4 x9 p/ Z! J3 d7 a& Y+ m [root@racnode1 ~]#
# ]8 Z3 ^. A* |- X5 w1 T0 G7 j service iscsi start; Y9 V( {) l# ]0 ]% ~/ x' O
iscsid dead but pid file exists
/ s+ z- w; H# m! y: K* U$ g5 A Turning off network shutdown. Starting iSCSI daemon:
) F9 o, h5 _" y' I
, a* {9 n5 [  B. W OK ]. s; _- l' y3 h+ V

4 U" S! l* n3 o4 `5 b# s, L
# S0 Y1 `0 {/ q; W/ ?% K. d OK ]
  b" s3 K3 a3 P5 Z4 j# G1 Z Setting up iSCSI targets: Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]. E3 X2 J& I; ?1 G
Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]8 d( m7 k5 V% b# }1 o
Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]/ i& L* ?8 L9 v6 d7 @1 T, i8 }" t
Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]: successful2 Z  J' o7 p# e* V7 n" ^+ H- X
Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]: successful
7 s: N/ G: m- p8 M" P6 D( E4 Q Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]: successful
0 {$ W9 O* O) W- t 4 y$ W/ @+ q% d7 f" A* v) v3 j

8 Y# K+ ~$ ^9 v: Y OK ]
; r  i5 z0 O0 ?, G, Q4 t[root@racnode1 ~]# % t% H) }+ G- _5 {' j
service iscsi stop; I  Z' k5 D6 |( o0 X# z7 Q: v
Logging out of session [sid: 6, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]
" r2 n) m6 G- N" Z/ G Logging out of session [sid: 7, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]0 n% B* q: x  _8 c
Logging out of session [sid: 8, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]5 s# w  m$ M1 X9 ^* I
Logout of [sid: 6, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]: successful) A2 f" [" y7 ]  y+ n2 ~, R
Logout of [sid: 7, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]: successful) X1 ^1 Q6 C* H) z1 V
Logout of [sid: 8, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]: successful# x# N1 a7 p8 p; ^
Stopping iSCSI daemon: ' d$ u& w! }2 V- n- X4 b# n& Y
+ o2 K. n3 ~& h) b
OK ]$ ~" W3 x* q5 A; V" r2 b

8 P. Q1 W, G4 E3 |9 | [root@racnode1 ~]# ( E% |3 h9 S* l  u
service iscsi start; ~5 t  ^" d# z& a1 m% g9 ?
iscsid dead but pid file exists8 q" D5 q* A/ e) w# Z7 M
Turning off network shutdown. Starting iSCSI daemon: , r1 U+ j' n9 s
( |- p+ p. ~, |% ^0 s
OK ]6 n* ?0 }1 _6 B9 O8 Q& o0 }3 S) j0 C
6 z) Y) l- }. e
* F7 c! l9 A9 M/ K: R0 Q
OK ]
  o! f8 I" T# K4 N1 d Setting up iSCSI targets: Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]$ g& Y" n5 j& w% I8 u( O/ K* {
Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]; G9 j8 ?# r0 g1 t
Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]4 g9 v' c! J$ J# {, O4 h: v
Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]: successful% }( h. r# e9 ]
Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]: successful! a/ F$ T- U3 w5 z1 C
Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]: successful+ N, J- u4 f. \

- A' U) o. o! ~. Y4 r / A5 w" e& Y6 f, H. O1 H4 S2 i: m
OK ]: [! v+ j. `3 H  F# r" c
我们来看看最终的结果:
% N( f! G$ H) F% L复制
$ M3 R9 B, q/ m- K  n2 N% l5 {Copied to ClipboardError: Could not Copy
8 l2 ^& x4 s& Y[root@racnode1 ~]#
, y3 ~7 }; d$ N& H ls -l /dev/iscsi/*0 C6 X: [! \: A$ {7 q3 r. E  r
/dev/iscsi/crs1:+ r: g5 O$ n' Z
total 0
/ ^$ H4 M6 ~4 l) h3 r( j lrwxrwxrwx 1 root root 9 Nov 3 18:13 part -> ../../sdc5 L8 L" z% |1 \% d
! }4 P7 \6 W; H& ?' V# P0 m& u
/dev/iscsi/data1:
0 A1 r. v+ f2 a9 r+ m/ v total 0
9 r, w2 l/ `% J9 U lrwxrwxrwx 1 root root 9 Nov 3 18:13 part -> ../../sde4 E7 T: c7 d6 [: q1 ~% `. {
5 n- M' Y; H  W
/dev/iscsi/fra1:
2 T( G- u& U( o: Y total 0
) ~5 X4 g7 h+ Z5 h) a7 _. [3 ] lrwxrwxrwx 1 root root 9 Nov 3 18:13 part -> ../../sdd+ P3 ~9 `* k5 \
[root@racnode1 ~]#
8 }/ W1 [0 z  P9 p ls -l /dev/iscsi/*, Y+ j& f& n; X6 A. D& g
/dev/iscsi/crs1:
- {# b: e8 {+ H0 Z% } total 0
* A- C) t0 F1 Y/ A+ |; S% u  J5 P lrwxrwxrwx 1 root root 9 Nov 3 18:13 part -> ../../sdc9 J" K) ~5 M/ w- r! A/ Q: H1 _
( |; H1 r5 ]; w7 B- O% ]) H  E6 q+ c
/dev/iscsi/data1:
3 U9 p* M  r% G1 V+ S* V total 03 K2 c6 S* |1 v' j, [
lrwxrwxrwx 1 root root 9 Nov 3 18:13 part -> ../../sde
. G; ~4 n3 K$ \, T: C- C
+ a; f* J9 p7 F/ t/ L /dev/iscsi/fra1:: C) `6 l1 B8 P( l
total 0/ W: `: W/ u: l9 c0 i* T
lrwxrwxrwx 1 root root 9 Nov 3 18:13 part -> ../../sdd
2 k& R/ q) \# A: {: t  T, M以上清单显示 udev 完成了其应当完成的工作!我们现在拥有了一组一致的本地设备名称,可用于引用 iSCSI 目标。例如,我们可以安全地假定设备名称 /dev/iscsi/crs1/part 将始终引用 iSCSI 目标 iqn.2006-01.com.openfiler:racdb.crs1。我们现在通过一致的 iSCSI 目标名称与本地设备名称相映射,如下表所述:
% U+ [8 @) \6 b$ wiSCSI 目标名称到本地设备名称映射0 n: f6 S% ?+ L: |0 m
iSCSI 目标名称 本地设备名称
  L9 r  n& P: |7 J  ^. o) niqn.2006-01.com.openfiler:racdb.crs1 /dev/iscsi/crs1/part
. F  C' z* [; |3 Piqn.2006-01.com.openfiler:racdb.data1 /dev/iscsi/data1/part" _% v: i* a7 {% {) F! x
iqn.2006-01.com.openfiler:racdb.fra1 /dev/iscsi/fra1/part
- B7 b0 Q' e, Y* o5 c* C在 iSCSI 卷上创建分区- k; c6 C' C1 d- `
我们现在需要在跨整个卷大小的各个 iSCSI 卷上创建一个主分区。如前所述,我将使用自动存储管理 (ASM) 来存储 Oracle Clusterware 所需的共享文件、物理数据库文件(数据/索引文件、联机重做日志文件和控制文件)以及集群数据库的快速恢复区 (FRA)。4 k. K7 J# T$ }
Oracle Clusterware 共享文件(OCR 和表决磁盘)将存储在名为 +CRS 的 ASM 磁盘组中,该磁盘组将配置为外部冗余。集群数据库的物理数据库文件将存储在名为 +RACDB_DATA 的 ASM 磁盘组中,该磁盘组也将配置为外部冗余。最后,快速恢复区(RMAN 备份和归档重做日志文件)将存储在名为 +FRA 的第三个 ASM 磁盘组中,该磁盘组也将配置为外部冗余。
- A; v! K- [" x0 X7 e下表列出了将创建的三个 ASM 磁盘组以及它们将包含哪些 iSCSI 卷:
. B- B* @! g! COracle 共享驱动器配置3 @( V* ]+ A+ Q, V2 ]9 v
文件类型 ASM 磁盘组名称 iSCSI 目标(短)名称 ASM 冗余 大小 ASMLib 卷名$ S7 A, ~- ?# j- }
OCR 和表决磁盘 +CRS crs1 外部 2GB ORCL:CRSVOL1
9 U, a5 `8 N) a& g5 a8 Q" {Oracle 数据库文件 +RACDB_DATA data1 外部 32 GB ORCL:DATAVOL1
2 O5 L: H& A( |Oracle 快速恢复区 +FRA fra1 外部 32 GB ORCL:FRAVOL1) B  n1 ^1 p2 c) H5 {! [" c3 s
如上表所示,我们需要在每一个 iSCSI 卷上都创建一个 Linux 主分区。fdisk 命令在 Linux 中用于创建(和删除)分区。对于每一个 iSCSI 卷,您都可以在创建主分区时使用默认值,因为默认操作是使用整个磁盘。您可以安全地忽略任何可能表明设备不包含有效 DOS 分区(或 Sun、SGI 或 OSF 磁盘标签)的警告。1 e: o, a  a3 c+ K8 @
在本例中,我将从 racnode1 中运行 fdisk 命令,并使用 udev 在上一节中创建的本地设备名称在每一个 iSCSI 目标上创建单一主分区:' V! S& u2 i6 s, C
/dev/iscsi/crs1/part1 o6 \4 n5 W% W% P; f9 q
/dev/iscsi/data1/part  Z: J+ j6 S0 c5 d4 a# f6 x
/dev/iscsi/fra1/part
- |! }  f, R* @  K/ c/ W8 I' `# r- W注意:在每一个 iSCSI 卷上创建单一分区时,只能从 Oracle RAC 集群中的一个节点运行!(即 racnode1)
2 V, W: X& _+ I8 v; Y; V2 Z复制
. o% r& H6 i  M* q% s* hCopied to ClipboardError: Could not Copy/ P1 w# M! k' \+ C! k3 @7 z
# ---------------------------------------
) j1 V; Q8 j2 z) j9 U% t 0 I/ M5 ~& f2 q( n2 i5 M
[root@racnode1 ~]#
# e9 _& R7 @4 `& U fdisk /dev/iscsi/crs1/part
/ H$ y0 w! U3 b* t$ |9 W Command (m for help):
9 B$ z& T6 {% f% w1 E4 M! }  J n
8 d# ]2 }9 [. h6 a1 O* Y4 }8 n" _ Command action
6 R. N8 [: c& {: W" w- @$ g e extended
6 E( {6 Y) {7 D- H p primary partition (1-4)
! p$ G6 x5 q0 |7 Z  I p- j, _- ?  z6 H0 M+ K* C- H
Partition number (1-4): 2 ]+ ?8 r  n4 @) c1 s( `' q/ [; B; R2 C
1
* u' F, d6 M. Q9 G% a) {; H) h, Q First cylinder (1-1012, default 1):
! r; U& ]. B0 l: n 1
/ g' r5 V  B7 I; ? Last cylinder or +size or +sizeM or +sizeK (1-1012, default 1012): $ U$ ?1 b; W7 s/ B+ Q, h- X. H
1012
3 z6 q1 R/ R) _6 f6 a 7 _; |, O# @7 D+ H4 |/ R4 i
Command (m for help): # c  e/ ^% o0 m! K' U
p4 C" Y* d7 ]# {! I+ E/ s+ s$ Y
1 c4 V+ y- z* I6 b
Disk /dev/iscsi/crs1/part: 2315 MB, 2315255808 bytes4 ?( C5 e/ [- Z. n* P9 q" k
72 heads, 62 sectors/track, 1012 cylinders
) x; y* I) ?2 g6 j2 n Units = cylinders of 4464 * 512 = 2285568 bytes
( Z0 f- K3 O# V+ h  \ 0 `1 Q' O7 Q, f0 Q' i) Z
Device Boot Start End Blocks Id System  W5 p2 R1 N, ~) H7 O* _
/dev/iscsi/crs1/part1 1 1012 2258753 83 Linux
0 O6 ]( r; j2 k& P . q6 U6 ]* V; N7 |
Command (m for help):
' M( |# @2 }- n3 C) l w) A1 R5 t: d9 L, _
The partition table has been altered!- L( b: l, T! K  c

, o/ V4 v9 U. L' k Calling ioctl() to re-read partition table.% N* f8 q1 z/ c
Syncing disks.- m& t" k5 U1 e/ R
( M1 ~" m# T8 X" `, ~
# ---------------------------------------! t7 C3 G) @  @& V, m/ A

: G0 b6 y  M8 P( s/ Y [root@racnode1 ~]# # J* o( S9 d% F- a8 T; z
fdisk /dev/iscsi/data1/part1 y: \( q- i! M& j& v
Command (m for help): ) z, s% ]) R' ]3 `# T/ A
n# Y" s1 w" \/ T% p; F
Command action
% x; _1 d  I( d9 y: a3 ~ e extended/ P! `8 M2 A  P& V
p primary partition (1-4)
- j* ]. s9 j- `4 A& |$ c/ u3 z# _# d p
5 s. J$ d3 W$ y Partition number (1-4):
. P) w5 a' L& x. n: p# Y 12 R4 @8 @  V; }% ^& n. C
First cylinder (1-33888, default 1): + v1 j7 o/ x& u6 n: Q
1
' z; ?' A2 y, q; x% Q2 s: d1 w" V Last cylinder or +size or +sizeM or +sizeK (1-33888, default 33888):
; u9 r9 V) \4 \8 W& u) }% J 33888
$ \$ G& z0 O! O% ~2 Z7 U   g/ c5 r/ U& F! v6 A$ j9 }8 b
Command (m for help): " d* O( Q' g: R8 c
p; u0 e4 H. L5 i: L: l( k+ J

5 e7 s8 I# ?: G6 Y% Q( c Disk /dev/iscsi/data1/part: 35.5 GB, 35534143488 bytes
% d3 \7 D7 ~& T0 x+ K' [9 n 64 heads, 32 sectors/track, 33888 cylinders: s/ e# G# v2 Q- g0 r
Units = cylinders of 2048 * 512 = 1048576 bytes
* P; B! V. i9 r$ a& d
2 Y' v' O1 a' P Device Boot Start End Blocks Id System
( _) T% J+ R- \+ e /dev/iscsi/data1/part1 1 33888 34701296 83 Linux7 g3 s/ m3 b0 W$ }9 D
, x( o( a- @2 ~0 a7 s" {7 g  D
Command (m for help):
; n/ t# _! H- Y- I% W w
: o9 O% s, Y+ n; y$ F) F) ] The partition table has been altered!5 |) r5 o; Z9 X* m: G+ A
9 _: o) S) o2 r6 Q; y& N+ O6 g0 f
Calling ioctl() to re-read partition table.) s* @: ]" S, @1 {% p# j$ m7 e
Syncing disks.
& b3 I1 g  |) j
+ h, ]' {) l" W8 F6 t3 M
6 S& T# @5 ]0 q # ---------------------------------------
+ {) x3 k/ M8 Z: M8 S2 k 2 ~  f; U* I# ^7 Y& L
[root@racnode1 ~]#   N0 N# o5 k9 ]  u: m
fdisk /dev/iscsi/fra1/part# `! ?+ N+ C) E2 C8 |
Command (m for help):
* ~9 e1 d* ~* i, l n
! ]' k  [  B: |! N Command action6 \- B9 ~, y7 D2 c7 k* |
e extended/ l' y# d2 i+ L. u# s' u8 [! b7 v
p primary partition (1-4)$ D) Y0 R% ?8 r
p9 c, ?6 x* G9 r) k7 S
Partition number (1-4):
- m! D$ n+ b) ^0 J% ~ 11 j6 U1 @& n7 y, B8 K0 C8 {" N
First cylinder (1-33888, default 1):
4 `" n. i# I/ T# ?( j1 H1 o! y# h 1
% d) x, B% Z' y0 n1 R Last cylinder or +size or +sizeM or +sizeK (1-33888, default 33888):
: ]' M) A9 f: p/ X; r8 a% p2 m 33888% `' d* u# i$ i0 q# G, h9 `5 L

9 k3 R0 O: s- s$ m Command (m for help):
" p+ ^" T! Z: T2 m9 r% o8 e p- K8 z* t% K4 q3 Y, }+ _; \& [

9 V/ v+ h% d* k  a Disk /dev/iscsi/fra1/part: 35.5 GB, 35534143488 bytes
& g) `. E( O- ]5 J) U3 X) i 64 heads, 32 sectors/track, 33888 cylinders7 Z, B1 \) ^8 ^) c
Units = cylinders of 2048 * 512 = 1048576 bytes& k7 B- V& m- m$ I% @  G2 ~8 ?
" z& L; n/ G2 F' K5 D" m8 I2 M* W
Device Boot Start End Blocks Id System
0 U$ Z/ I' i' D /dev/iscsi/fra1/part1 1 33888 34701296 83 Linux: ~! B. F0 A9 d4 g5 d$ L6 F2 @4 Z
! K- z! E, B8 J0 P! o+ ]$ V
Command (m for help): ( H8 w; P# E. ?
w
5 P: Y  u% `6 W The partition table has been altered!
3 Y- s6 s2 ], q3 m. i ) t# e/ e0 g$ L# y" U
Calling ioctl() to re-read partition table.
6 U. ]. i8 y( Z) m! D/ N Syncing disks.$ k) s+ N" t; ?5 E0 d/ ]
# ---------------------------------------
  D3 @) i& o3 r; a- ^ 0 l( \9 x5 K' W1 A
[root@racnode1 ~]# ) o* v& V1 ], O+ Z" c$ ?
fdisk /dev/iscsi/crs1/part
8 G. n" s% M; c Command (m for help): ! y) c) y1 `% @# j; v$ c
n
% a8 u0 k, e  P; B: R" u& { Command action& s* Q3 b2 r: p% q) P' f8 k
e extended: h) H% n. A9 o; k$ J8 i
p primary partition (1-4)2 v6 v( b$ Q5 W
p
1 j$ f# V6 j/ w; p% e Partition number (1-4):
& L2 Z% J! o6 T- {, P' J/ i% ^4 t 1
$ @5 c+ b$ @' B7 T  j! l6 [' h First cylinder (1-1012, default 1): 7 f7 B! W6 X& ?0 l4 u
1
0 H0 l9 e0 W5 H3 b Last cylinder or +size or +sizeM or +sizeK (1-1012, default 1012): & Y2 G5 p4 w. P  d/ ]$ `
10121 v+ N, d0 U2 \1 {/ w

( F1 ]4 G8 w4 F8 X Command (m for help): ! t' a+ n9 K& j3 w; M# C! U
p3 @; n+ u; a2 P3 }1 o( F) O
! V3 b% [; ?7 x/ ?. n& ]/ t
Disk /dev/iscsi/crs1/part: 2315 MB, 2315255808 bytes
* ~% W/ U# \2 q. Y; v: l 72 heads, 62 sectors/track, 1012 cylinders! m/ v( A6 h# C+ ^9 C7 T
Units = cylinders of 4464 * 512 = 2285568 bytes
3 X% y$ z& N. Y" d6 ^
9 O% R1 R( Y& Q Device Boot Start End Blocks Id System9 G" {  T# x  U, k& n4 D# Y! O
/dev/iscsi/crs1/part1 1 1012 2258753 83 Linux
* x4 s8 S% \7 J1 K# t
. ?6 m$ C( T% S Command (m for help):
7 y# Y5 w3 d7 x" N0 i5 Z& K: L w1 N4 ?4 A+ }" ~' Z. x: q% o
The partition table has been altered!
5 ^# @; d& l1 [. u : f1 X2 |# K1 k8 R; c# D% F2 j" S
Calling ioctl() to re-read partition table.
% W) _; B) C7 j1 ]$ B% u$ x, } Syncing disks.
, d  b+ w1 A( i( G
- x' R0 ]9 Z. i0 S, h- X* O9 A # ---------------------------------------$ |, e! D: x+ W
$ Y  x- l7 ?3 R( O7 c4 V; N% [
[root@racnode1 ~]# : n+ ?6 y1 P2 [
fdisk /dev/iscsi/data1/part. V- k! p# Q$ u2 e' [6 P' q& W, w# ]
Command (m for help):
) z7 ?/ |3 f8 l- ~6 S+ h8 M n) I2 h+ c+ M* D& X
Command action: p  F* X* n; c3 |+ v/ H
e extended- A6 D! N/ w3 r
p primary partition (1-4)
+ n& Q3 B3 ^  A1 Y, e, ] p
" l- e% C2 b" D Partition number (1-4):
, d# |2 y& }* c  A9 K 1
) k$ f" f* l6 U4 X$ p2 E) F First cylinder (1-33888, default 1):
1 t2 x& G  u& T" r( l! C, f0 i 18 C: u' X9 _2 e
Last cylinder or +size or +sizeM or +sizeK (1-33888, default 33888): ! b% Z( P* D; C
338888 V& ]4 Q  G2 M4 ^7 ^
9 p! a2 b) P+ k" _6 r/ W! E
Command (m for help): 9 {( b6 j: [9 m. W( [
p
3 S- J$ S' H; \9 y* h
$ h. W) _' s& t& c" A0 s0 b1 O$ p Disk /dev/iscsi/data1/part: 35.5 GB, 35534143488 bytes
( K: v6 a  C' u1 b! s 64 heads, 32 sectors/track, 33888 cylinders
4 |: L6 Y8 R, R4 T- ? Units = cylinders of 2048 * 512 = 1048576 bytes; q3 T" q$ h' }$ r, Q

; r7 X1 B! W# r0 C# z Device Boot Start End Blocks Id System
0 S9 H7 o" L; L+ \; z' I% N+ h' ?% | /dev/iscsi/data1/part1 1 33888 34701296 83 Linux
3 I0 I& f# j, p  d/ N # y1 U5 ~% \3 t8 E
Command (m for help): * y$ V- \% r, m9 l6 H+ Q
w. g! O: b  G! c- O4 n. Z' M
The partition table has been altered!
; y# o+ R3 G9 L 9 h4 ^" X4 u( _9 g0 N! E& X
Calling ioctl() to re-read partition table.
$ x* A: h- t2 L* Q2 C Syncing disks.8 y+ B* M" P$ G+ t7 M2 h- b
( W  H, x4 i$ z$ q6 N7 U. }" l

  [& Y1 T  B4 p% k) E& W # ---------------------------------------
6 u7 d  y1 O0 v$ l
+ I( X& C6 v( n6 ^/ \7 B* c, ^( c, q9 u [root@racnode1 ~]# 9 E+ R, C; }/ n7 Z
fdisk /dev/iscsi/fra1/part2 C: K  v* f5 w
Command (m for help): : W5 X5 z6 U* b+ \( r3 N
n
& \* ]" F' |$ S9 q" k/ C9 ] Command action) a& R: m* N4 E( _" ?
e extended! @" A( s  P$ \( _7 ]
p primary partition (1-4)3 t2 r+ o0 W( i6 z1 ]
p) a1 g2 H) I2 h% s  }1 Z3 V% |
Partition number (1-4):
. h$ D3 n; ^* r0 D7 K. E" M" e4 n 1
5 [9 }( A0 A5 p% W7 c# H First cylinder (1-33888, default 1):
9 p/ R3 l; b& @7 m: Q 1
: r( B0 B& i' ~ Last cylinder or +size or +sizeM or +sizeK (1-33888, default 33888):
+ M4 U, P. Y, t: u0 W+ w 33888
3 S7 `+ i* x2 I1 Z# H  [3 I& G5 Z6 a
# R4 s' V1 Q& }8 E# ^ Command (m for help):
& l# z9 C1 U" }$ Y4 s# m7 L0 F p
/ S+ d+ t; J/ e0 S5 T
! o" c) ]% Q! x- k1 O3 v& q Disk /dev/iscsi/fra1/part: 35.5 GB, 35534143488 bytes% q3 Q  I  K5 c" n
64 heads, 32 sectors/track, 33888 cylinders
2 p. L& U9 n* C0 ?9 r( y, A$ q. G" F Units = cylinders of 2048 * 512 = 1048576 bytes
4 t# n9 E. ?4 B* |( P% o ) j& a1 a1 c; q/ |- }8 h" G
Device Boot Start End Blocks Id System
( Z4 a2 o! m  K /dev/iscsi/fra1/part1 1 33888 34701296 83 Linux+ |* \% |( j1 h9 R6 e3 u

' d% B& W8 t. k" G5 K; F Command (m for help): 3 s3 d7 j, q7 k1 L" G2 o5 t% w/ p
w# x5 o0 q8 x- f1 [2 ?/ Z
The partition table has been altered!
% d2 J& K: c  V" | & n: c* D: {/ _+ c, Y
Calling ioctl() to re-read partition table.9 U- t8 T% M" Q; f1 u
Syncing disks.
4 B4 A6 F+ [5 S6 l/ m验证新分区
! \+ F& v0 z7 x从 racnode1 创建所有必需的分区后,您现在应当使用以下命令作为 Oracle RAC 集群 (racnode2) 中所有其余节点的“root”用户帐户,以便于向内核通知分区更改。请注意,从 Openfiler 发现的 iSCSI 目标名称与本地 SCSI 设备名称的映射在两个 Oracle RAC 节点上将有所不同。这不是问题,也不会造成任何问题,因为我们不会使用本地 SCSI 设备名称,而是使用 udev 在上一节中创建的本地设备名称。
% Z; z3 T5 i& Y从 racnode2 中,运行以下命令:
9 P8 h% W4 a" @" R复制6 T1 T4 o0 z! ]) E1 r+ L! K
Copied to ClipboardError: Could not Copy
9 k$ Q7 l9 O1 d( N[root@racnode2 ~]#
" Z# s* A2 s* w0 ?( _& O8 P, A partprobe4 A; w" R7 c* O/ d3 S) m
6 Q$ a$ H! i# i: V' B* F
[root@racnode2 ~]# : G* f8 }* V- M& s! Q, b
fdisk -l
4 E1 t& ?& u6 r8 [9 [
6 `0 e6 E* N$ x Disk /dev/sda: 160.0 GB, 160000000000 bytes
% U& B6 K* n/ G9 G, C5 `( _ 255 heads, 63 sectors/track, 19452 cylinders/ t9 b9 {+ p& J& r
Units = cylinders of 16065 * 512 = 8225280 bytes4 ~( O& x. `, U, @

/ H  D& V9 }# k. e Device Boot Start End Blocks Id System
( Z/ Q* v6 Y2 k /dev/sda1 * 1 13 104391 83 Linux
* R# ^" \  ^( O6 O /dev/sda2 14 19452 156143767+ 8e Linux LVM
! n+ C. Y( d+ ^+ \& ]7 U6 M   @. B9 v  Q& O/ D9 Z( N) k
Disk /dev/sdb: 35.5 GB, 35534143488 bytes/ h; z5 w7 Z% q2 c5 X% m/ z( o
64 heads, 32 sectors/track, 33888 cylinders$ J. ]9 x0 [. }* }1 @
Units = cylinders of 2048 * 512 = 1048576 bytes5 x7 A$ F* q9 n" H# v% W4 O9 g3 i

  A$ `5 {0 |8 e! ]7 K2 M9 c$ H: D Device Boot Start End Blocks Id System
+ y+ |5 |$ n; n' ^4 Z" } /dev/sdb1 1 33888 34701296 83 Linux' S5 U& v5 m" u
& p+ o; g6 r) ?; B& M
Disk /dev/sdc: 35.5 GB, 35534143488 bytes$ `  h- A+ f9 X* G
64 heads, 32 sectors/track, 33888 cylinders6 s) H- M  p6 {. D; z" L5 p
Units = cylinders of 2048 * 512 = 1048576 bytes% ~7 z0 O, _" [! ^% @# {+ a' T1 T
' v4 r2 b3 J9 V8 F. I5 ~
Device Boot Start End Blocks Id System- M2 w6 w) X. r; K8 |8 a
/dev/sdc1 1 33888 34701296 83 Linux
% N4 P3 g( k4 o; c5 i& l0 j9 A . I! C+ M' J8 a6 e, D
Disk /dev/sdd: 2315 MB, 2315255808 bytes
) L, C7 U5 B* f, v# B7 y9 R 72 heads, 62 sectors/track, 1012 cylinders# t$ D8 l- [+ y, S8 S
Units = cylinders of 4464 * 512 = 2285568 bytes  o) I2 I% a$ G# A/ S' f+ Q
" V8 y& g* w& S/ G5 k
Device Boot Start End Blocks Id System/ d: m8 I5 o4 P& M) d' [
/dev/sdd1 1 1012 2258753 83 Linux/ `/ J9 J; p& `: G1 Y
[root@racnode2 ~]#
3 G- X3 Y! R" p( P( n, Q  ?$ G partprobe
/ x, u# Y) b. |/ Q/ S* f( C- ] ' F5 K- `1 f; j+ C# ^- ^
[root@racnode2 ~]#
  v5 r6 a8 T: q6 W7 j3 L8 @ fdisk -l: ^1 J6 S% X4 s, c9 l8 H! d
. {0 M3 J8 ~' Y$ m) k0 @
Disk /dev/sda: 160.0 GB, 160000000000 bytes
; s7 V& r6 Y  D3 v$ y4 x6 F& Z' ?# I 255 heads, 63 sectors/track, 19452 cylinders. T5 U5 g$ @* P5 A
Units = cylinders of 16065 * 512 = 8225280 bytes
! i3 I8 ?& Y) B; O' W9 W1 c4 s + F$ s. h( Q) c$ ]
Device Boot Start End Blocks Id System
. e/ g/ s, L! N" { /dev/sda1 * 1 13 104391 83 Linux
7 l, ^6 Z& |& |$ }% o: M /dev/sda2 14 19452 156143767+ 8e Linux LVM6 N" D- R+ L2 ?( O! k) s

. J1 n9 {5 A! Y Disk /dev/sdb: 35.5 GB, 35534143488 bytes
' o' N2 I0 n" L$ @ 64 heads, 32 sectors/track, 33888 cylinders
6 S* y, L- F4 X Units = cylinders of 2048 * 512 = 1048576 bytes6 ]8 g2 r2 L+ L/ L5 c- X8 z
. \3 R( P9 v) `! ], Q. K$ P+ u
Device Boot Start End Blocks Id System, H& r% b! r4 P$ m; V
/dev/sdb1 1 33888 34701296 83 Linux
$ f. |2 Z+ I1 ?( r$ A( B; S 0 O6 v0 Z5 d5 ^" b) M" f
Disk /dev/sdc: 35.5 GB, 35534143488 bytes) G! h, L6 d) g$ _+ Y" w' ~
64 heads, 32 sectors/track, 33888 cylinders  S& R( c' w9 C1 \) w7 o6 B
Units = cylinders of 2048 * 512 = 1048576 bytes6 A0 ]+ g0 X8 I* B4 T
, c+ k/ }0 d) F4 n. a( G
Device Boot Start End Blocks Id System
6 [3 F; B5 N2 D+ b* K5 v /dev/sdc1 1 33888 34701296 83 Linux# [$ h- V& z/ N& @& C8 @; A- k
% u9 L# l! X) Z3 g5 _; X
Disk /dev/sdd: 2315 MB, 2315255808 bytes
8 G6 r9 m# I2 j9 n! x7 s0 O 72 heads, 62 sectors/track, 1012 cylinders
) r) x. f" B- K1 |) J4 P Units = cylinders of 4464 * 512 = 2285568 bytes
2 w" ~  r$ \7 H3 C4 X9 ? . d: d3 `( G2 H, i+ e1 j* {3 Z
Device Boot Start End Blocks Id System+ k/ M5 p. m1 t( w2 ~5 v2 V5 A+ ?$ {
/dev/sdd1 1 1012 2258753 83 Linux
* A2 y3 N/ B0 S+ F0 i# y7 N* C最后一步,您应当在两个 Oracle RAC 节点上运行以下命令以验证 udev 是否为每个新分区创建了新的符号链接:: V; C3 L0 {' |/ V2 P& I% V
复制
9 x4 K1 [- Q  m( L" HCopied to ClipboardError: Could not Copy! _) r' R+ n- x, r
[root@racnode2 ~]#   g/ i2 G3 Q' ^8 @( \' w$ I' R
(cd /dev/disk/by-path; ls -l *openfiler* | awk '{FS=" "; print $9 " " $10 " " $11}')
. Y# O: l0 J$ k3 a6 x$ L$ f ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0 -> ../../sdd
# c9 M6 U* Z" a6 M ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0-part1 -> ../../sdd1
- Y; y8 Z3 _4 k( {5 b6 v9 B- q3 X ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0 -> ../../sdc
9 Z5 f* E. @4 ^: b! Y3 W" H ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0-part1 -> ../../sdc17 f$ o- B& Y* s& P( o# o
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0 -> ../../sdb: p; {* g, G3 b+ x) g1 X
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0-part1 -> ../../sdb1
) R" J7 H: s/ c1 g+ {[root@racnode2 ~]#   u0 {( g. k( A
(cd /dev/disk/by-path; ls -l *openfiler* | awk '{FS=" "; print $9 " " $10 " " $11}')2 H" q2 D& @5 b" I* r
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0 -> ../../sdd7 Z4 c/ X# _' N. u/ r( p* p
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0-part1 -> ../../sdd1
2 [0 ~* z1 D0 Q: m2 Q: p ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0 -> ../../sdc
  j4 ^' N( L' M5 {* r- b ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0-part1 -> ../../sdc1
3 m( `3 u5 J6 K: f9 b) a' z ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0 -> ../../sdb
" q9 P, U$ a$ V/ ] ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0-part1 -> ../../sdb1& o! H, N2 T, R% k  Y
以上清单显示 udev 确实为每一个新分区创建了新的设备名称。在本指南稍后为 ASMlib 配置卷时,我们将使用这些新设备名称:7 Q  z# r! _4 l! [" `& k0 z

- E' k; `4 @- _$ Q3 c/ ]- y/dev/iscsi/crs1/part1: Y( v% _5 K2 S
/dev/iscsi/data1/part1
" o( g/ @2 x1 v, V3 p" n; A/dev/iscsi/fra1/part1! t- q5 A5 i, U  b& H; u0 ~: V

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-7-9 17:31:28 | 显示全部楼层
在 Oracle RAC 节点上配置 iSCSI 卷4 i. J2 u6 v4 S; m( i' g/ Y7 c

在集群中的两个 Oracle RAC 节点上配置 iSCSI 启动器。而创建分区只应在 RAC 集群的一个节点上执行。

iSCSI 客户端可以是提供 iSCSI 支持(驱动程序)的任何系统(Linux、Unix、MS Windows、Apple Mac 等)。在我们的示例中,客户端是两个 Linux 服务器(racnode1 和 racnode2),它们运行的是 Oracle Enterprise Linux 5.4。

在本节中,我们将在两个 Oracle RAC 节点上配置 iSCSI 软件启动器。Oracle Enterprise Linux 5.4 包括 iSCSI 软件启动器,该软件启动器位于 iscsi-initiator-utils RPM 中。这是对早期版本 Oracle Enterprise Linux (4.x) 的一个更改,这些早期版本中包含作为 Linux-iSCSI 项目的一部分而开发的 Linux iscsi-sfnet 软件驱动程序。所有 iSCSI 管理任务(如发现和登录)将使用 Open-iSCSI 中包含的命令行接口 iscsiadm。

iSCSI 软件启动器将配置为自动登录网络存储服务器 (openfiler1),并发现 上一节中创建的 iSCSI 卷。之后,我们将逐步使用 udev 为发现的每个 iSCSI 目标名称创建永久性本地 SCSI 设备名称(即/dev/iscsi/crs1)。拥有一致的本地 SCSI 设备名称及其映射到的 iSCSI 目标,有助于在配置 ASM 时能够区分三个卷。但是,在此之前,我们首先必须安装 iSCSI 启动器软件。

注:本指南使用 ,它是 Oracle Database 的自动存储管理 (ASM) 特性的一个支持库。ASMLib 将用于对本指南中所使用的所有 iSCSI 卷进行标记。默认情况下,ASMLib 已为 ASM 使用的存储设备提供了永久性路径和权限。有了该特性后,无需用存储设备路径和权限更新 udev 或 devlabel文件。就本文来说,实际上我仍然选择使用 udev 为发现的每个 SCSI 目标名称创建永久性本地 SCSI 设备名称。这提供了一种自我文档编制的方法,有助于快速确定每个卷的名称和位置。

安装 iSCSI(启动器)服务

就 Oracle Enterprise Linux 5.4 来说,默认情况下不会安装 Open-iSCSI iSCSI 软件启动器。该软件包含在 1 号 CD 上的 iscsi-initiator-utils 程序包中。要确定该程序包是否已安装(大多数情况下没有安装),在两个 Oracle RAC 节点上执行以下命令:

[root@racnode1 ~]# rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"| grep iscsi-initiator-utils

如果 iscsi-initiator-utils 程序包未安装,将 1 号 CD 加载到每个 Oracle RAC 节点中并执行以下命令:

[root@racnode1 ~]# mount -r /dev/cdrom /media/cdrom [root@racnode1 ~]# cd /media/cdrom/Server [root@racnode1 ~]# rpm -Uvh iscsi-initiator-utils-* [root@racnode1 ~]# cd / [root@racnode1 ~]# eject

确认 iscsi-initiator-utils 程序包现在已安装:

[root@racnode1 ~]# rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"| grep iscsi-initiator-utils iscsi-initiator-utils-6.2.0.871-0.10.el5 (x86_64)
1 G3 k, }$ a/ G  j9 ?1 M/ f& m

配置 iSCSI(启动器)服务

验证 iscsi-initiator-utils 程序包已经安装到两个 Oracle RAC 节点之后,启动 iscsid 服务,并使其在系统引导时自动启动。我们还将配置 iscsi 服务在系统启动时自动启动,自动登录到所需的 iSCSI 目标。

[root@racnode1 ~]# service iscsid start Turning off network shutdown. Starting iSCSI daemon: [ OK ]                                                     [ OK ][root@racnode1 ~]# chkconfig iscsid on [root@racnode1 ~]# chkconfig iscsi on

现在 iSCSI 服务已经启动,下面使用 iscsiadm 命令行接口发现网络存储服务器上的所有可用目标。这应该在两个 Oracle RAC 节点上执行,以检验配置是否正常工作:

[root@racnode1 ~]# iscsiadm -m discovery -t sendtargets -p openfiler1-priv 192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.crs1192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.fra1192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.data1

手动登录到 iSCSI 目标

此时,iSCSI 启动器服务已经启动,每个 Oracle RAC 节点都能够从网络存储服务器中发现可用目标。下一步是手动登录每个可用目标,这可以使用 iscsiadm 命令行接口完成。这需要在两个 Oracle RAC 节点上运行。注意,我必须指定网络存储服务器的 IP 地址而非其主机名 (openfiler1-priv) — 我认为必须这么做,因为上述发现使用 IP 地址显示目标。

[root@racnode1 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.crs1 -p 192.168.2.195 -l [root@racnode1 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.data1 -p 192.168.2.195 -l [root@racnode1 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.fra1 -p 192.168.2.195 -l

配置自动登录

下一步是确保在计算机引导(或 iSCSI 启动器服务启动/重启)时,客户端将自动登录到上面列出的每个目标。如同上面描述的手动登录过程,在两个 Oracle RAC 节点上执行以下命令:

[root@racnode1 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.crs1 -p 192.168.2.195 --op update -n node.startup -v automatic [root@racnode1 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.data1 -p 192.168.2.195 --op update -n node.startup -v automatic [root@racnode1 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.fra1 -p 192.168.2.195 --op update -n node.startup -v automatic

创建永久性本地 SCSI 设备名称

在本节中,我们将逐步为每个 iSCSI 目标名称创建永久性本地 SCSI 设备名称。我们将使用 udev 来完成该任务。拥有一致的本地 SCSI 设备名称及其映射到的 iSCSI 目标,有助于在配置 ASM 时能够区分三个卷。尽管并未严格要求这么做(因为我们将对所有卷使用 ),这提供了一种自我文档编制的方法,有助于快速确定每个 iSCSI 卷的名称和位置。

如果任一 Oracle RAC 节点引导并且 iSCSI 启动器服务启动,它会以一种随机的方式自动登录到配置的每个目标,并将这些目标映射到下一个可用的本地 SCSI 设备名称。例如,目标 iqn.2006-01.com.openfiler:racdb.crs1 可能会映射到 /dev/sdb。实际上,我可以通过查看/dev/disk/by-path 目录来确定所有目标的当前映射:

[root@racnode1 ~]# (cd /dev/disk/by-path; ls -l *openfiler* | awk '{FS=" "; print $9 " " $10 " " $11}') ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0 -> ../../sdbip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0 -> ../../sddip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0 -> ../../sdc

使用上述 ls 命令的输出结果,我们可以建立以下当前映射:

iSCSI 目标名称到本地 SCSI 设备名称的当前映射
iSCSI 目标名称SCSI 设备名称
iqn.2006-01.com.openfiler:racdb.crs1
/dev/sdb
iqn.2006-01.com.openfiler:racdb.data1
/dev/sdd
iqn.2006-01.com.openfiler:racdb.fra1
/dev/sdc

但是,每次重新引导 Oracle RAC 节点时,该映射都可能有所不同。例如,重新引导之后,可能会决定将 iSCSI 目标 iqn.2006-01.com.openfiler:racdb.crs1 映射到本地 SCSI 设备 /dev/sdc。由于您无法预测重新引导后的 iSCSI 目标映射,依赖于使用本地 SCSI 设备名称是不现实的。

我们需要的是可引用的一致的设备名称(即 /dev/iscsi/crs1),该设备名称在重新引导后将始终指向相应的 iSCSI 目标。这就是引入名为 udev 的动态设备管理 工具的原因。 udev 提供了一个动态设备目录,使用一组可配置的规则通过符号链接指向实际设备。当 udev 收到设备事件(例如,客户端登录到 iSCSI 目标)时,就会根据 sysfs 中提供的可用设备属性匹配其配置好的规则以便识别设备。匹配规则可以提供其他设备信息或指定设备节点名和多个符号链接名,并指示 udev 运行其他程序(例如,一个 SHELL 脚本)作为设备事件处理过程的一部分。

第一步是创建一个新的规则文件。该文件将命名为 /etc/udev/rules.d/55-openiscsi.rules,并且只包含一行用于接收我们感兴趣事件的名称=值对。它还将定义一个调出 SHELL 脚本 (/etc/udev/scripts/iscsidev.sh),用于处理事件。

在两个 Oracle RAC 节点上创建以下规则文件 /etc/udev/rules.d/55-openiscsi.rules:

..............................................# /etc/udev/rules.d/55-openiscsi.rulesKERNEL=="sd*", BUS=="scsi", PROGRAM="/etc/udev/scripts/iscsidev.sh %b",SYMLINK+="iscsi/%c/part%n"..............................................

现在,我们需要创建在接收该事件时将调用的 UNIX SHELL 脚本。我们首先在两个 Oracle RAC 节点上创建一个单独的目录,用于存储 udev 脚本:

[root@racnode1 ~]# mkdir -p /etc/udev/scripts

接下来,在两个 Oracle RAC 节点上创建 UNIX shell 脚本 /etc/udev/scripts/iscsidev.sh:

..............................................#!/bin/sh # FILE: /etc/udev/scripts/iscsidev.shBUS=${1}HOST=${BUS%%:*} [ -e /sys/class/iscsi_host ] || exit 1file="/sys/class/iscsi_host/host${HOST}/device/session*/iscsi_session*/targetname"target_name=$(cat ${file})# This is not an open-scsi driveif [ -z "${target_name}" ]; then   exit 1fi# Check if QNAP drivecheck_qnap_target_name=${target_name%%:*}if [ $check_qnap_target_name = "iqn.2004-04.com.qnap" ]; then    target_name=`echo "${target_name%.*}"`fiecho "${target_name##*.}"..............................................

创建 UNIX SHELL 脚本后,将其更改为可执行文件:

[root@racnode1 ~]# chmod 755 /etc/udev/scripts/iscsidev.sh

既然已经配置了 udev,下面将在两个 Oracle RAC 节点上重新启动 iSCSI 服务:

[root@racnode1 ~]# service iscsi stop Logging out of session [sid: 6, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]Logging out of session [sid: 7, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]Logging out of session [sid: 8, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]Logout of [sid: 6, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]: successfulLogout of [sid: 7, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]: successfulLogout of [sid: 8, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]: successfulStopping iSCSI daemon:                               [ OK ][root@racnode1 ~]# service iscsi start iscsid dead but pid file existsTurning off network shutdown. Starting iSCSI daemon: [ OK ]                                                     [ OK ]Setting up iSCSI targets: Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]: successfulLogin to [iface: default, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]: successfulLogin to [iface: default, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]: successful [ OK ]

下面,我们来看一下我们的辛勤工作是否得到了回报:

[root@racnode1 ~]# ls -l /dev/iscsi/* /dev/iscsi/crs1:total 0lrwxrwxrwx 1 root root 9 Nov  3 18:13 part -> ../../sdc/dev/iscsi/data1:total 0lrwxrwxrwx 1 root root 9 Nov  3 18:13 part -> ../../sde/dev/iscsi/fra1:total 0lrwxrwxrwx 1 root root 9 Nov  3 18:13 part -> ../../sdd

上面的清单显示, udev 所做的工作正是我们所期待的!现在,我们拥有了一组一致的本地设备名称,可用于引用 iSCSI 目标。例如,我们可以安全地认为设备名称 /dev/iscsi/crs1/part 将始终引用 iSCSI 目标 iqn.2006-01.com.openfiler:racdb.crs1。现在,我们拥有了一致的 iSCSI 目标名称到本地设备名称的映射,如下表所示:

iSCSI 目标名称到本地设备名称的映射
iSCSI 目标名称本地设备名称
iqn.2006-01.com.openfiler:racdb.crs1
/dev/iscsi/crs1/part
iqn.2006-01.com.openfiler:racdb.data1
/dev/iscsi/data1/part
iqn.2006-01.com.openfiler:racdb.fra1
/dev/iscsi/fra1/part
& J8 G! g- e0 n( [

在 iSCSI 卷上创建分区

现在,我们需要在每个 iSCSI 卷上创建一个占用整个卷大小的主分区。正如本文前面提到的,我将使用自动存储管理 (ASM) 存储 Oracle 集群件所需的共享文件、物理数据库文件(数据/索引文件、联机重做日志文件和控制文件),以及集群数据库的快速恢复区 (FRA)。

Oracle Clusterware 共享文件(OCR 和表决磁盘)将存储在一个名为 +CRS 的使用外部冗余 配置的 ASM 磁盘组中。集群数据库的物理数据库文件将存储在一个名为 +RACDB_DATA 的也使用外部冗余配置的 ASM 磁盘组中。最后,快速恢复区(RMAN 备份和存档重做日志文件)将存储于一个名为 +FRA 的使用外部冗余配置的第三个 ASM 磁盘组中。

下表列出了将要创建的三个 ASM 磁盘组及其将包含的 iSCSI 卷:

Oracle 共享驱动器配置
文件类型ASM 磁盘组名称iSCSI 目标(短)名称ASM 冗余
大小
ASMLib 卷名
OCR 和表决磁盘+CRScrs1External
2GB
ORCL:CRSVOL1
Oracle 数据库文件+RACDB_DATAdata1External
32GB
ORCL:DATAVOL1
Oracle 快速恢复区+FRAfra1External
32GB
ORCL:FRAVOL1

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

在本例中,我将在 racnode1 上运行 fdisk 命令,使用中通过 udev 创建的本地设备名称在每个 iSCSI 目标上创建一个主分区:


/ x& F$ t- B! ^7 ?/ |& y
  • /dev/iscsi/data1/part
    ) I3 S. Z3 L* X" r8 y& I, B/dev/iscsi/fra1/part

! B) G& A1 D7 n% C' X. {. u9 w

注:要在每个 iSCSI 卷上创建单个分区,只能从 Oracle RAC 集群中的一个节点上进行!(如racnode1)

# ---------------------------------------[root@racnode1 ~]# fdisk /dev/iscsi/crs1/part Command (m for help): n Command action   e   extended   p   primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-1012, default 1): 1 Last cylinder or +size or +sizeM or +sizeK (1-1012, default 1012): 1012 Command (m for help): p Disk /dev/iscsi/crs1/part: 2315 MB, 2315255808 bytes72 heads, 62 sectors/track, 1012 cylindersUnits = cylinders of 4464 * 512 = 2285568 bytes               Device Boot      Start         End      Blocks   Id  System/dev/iscsi/crs1/part1               1        1012     2258753   83  LinuxCommand (m for help): w The partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.# ---------------------------------------[root@racnode1 ~]# fdisk /dev/iscsi/data1/part Command (m for help): n Command action   e   extended   p   primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-33888, default 1): 1 Last cylinder or +size or +sizeM or +sizeK (1-33888, default 33888): 33888 Command (m for help): p Disk /dev/iscsi/data1/part: 35.5 GB, 35534143488 bytes64 heads, 32 sectors/track, 33888 cylindersUnits = cylinders of 2048 * 512 = 1048576 bytes                 Device Boot      Start         End      Blocks   Id  System/dev/iscsi/data1/part1               1       33888    34701296   83  LinuxCommand (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table.Syncing disks.# ---------------------------------------[root@racnode1 ~]# fdisk /dev/iscsi/fra1/part Command (m for help): n Command action   e   extended   p   primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-33888, default 1): 1 Last cylinder or +size or +sizeM or +sizeK (1-33888, default 33888): 33888 Command (m for help): p Disk /dev/iscsi/fra1/part: 35.5 GB, 35534143488 bytes64 heads, 32 sectors/track, 33888 cylindersUnits = cylinders of 2048 * 512 = 1048576 bytes               Device Boot      Start         End      Blocks   Id  System/dev/iscsi/fra1/part1               1       33888    34701296   83  LinuxCommand (m for help): w The partition table has been altered!Calling ioctl() to re-read partition table. Syncing disks.

验证新分区

在 racnode1 上创建所有需要的分区之后,现在应使用以下命令以“root”用户帐户从 Oracle RAC 集群的所有其余节点 (racnode2) 将分区更改通知给内核。注意,Openfiler 发现的 iSCSI 目标名称和本地 SCSI 设备名称的映射在两个 Oracle RAC 节点上将有所不同。不用担心,这不会导致任何问题,因为我们将使用 udev 在中创建的本地设备名称而不是其他的本地 SCSI 设备名称。

! f2 u" |) c6 f+ q

在 racnode2 上运行以下命令:

[root@racnode2 ~]# partprobe [root@racnode2 ~]# fdisk -l Disk /dev/sda: 160.0 GB, 160000000000 bytes255 heads, 63 sectors/track, 19452 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  System/dev/sda1   *           1          13      104391   83  Linux/dev/sda2              14       19452   156143767+  8e  Linux LVMDisk /dev/sdb: 35.5 GB, 35534143488 bytes64 heads, 32 sectors/track, 33888 cylindersUnits = cylinders of 2048 * 512 = 1048576 bytes   Device Boot      Start         End      Blocks   Id  System/dev/sdb1               1       33888    34701296   83  LinuxDisk /dev/sdc: 35.5 GB, 35534143488 bytes64 heads, 32 sectors/track, 33888 cylindersUnits = cylinders of 2048 * 512 = 1048576 bytes   Device Boot      Start         End      Blocks   Id  System/dev/sdc1               1       33888    34701296   83  LinuxDisk /dev/sdd: 2315 MB, 2315255808 bytes72 heads, 62 sectors/track, 1012 cylindersUnits = cylinders of 4464 * 512 = 2285568 bytes   Device Boot      Start         End      Blocks   Id  System/dev/sdd1               1        1012     2258753   83  Linux

最后,您应该在两个 Oracle RAC 节点上运行以下命令,以验证 udev 为每个新分区创建了新的符号链接:

[root@racnode2 ~]# (cd /dev/disk/by-path; ls -l *openfiler* | awk '{FS=" "; print $9 " " $10 " " $11}') ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0 -> ../../sddip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0-part1 -> ../../sdd1ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0 -> ../../sdcip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0-part1 -> ../../sdc1ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0 -> ../../sdbip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0-part1 -> ../../sdb1

上面的清单显示, udev 确实为每个新分区创建了新的设备名称。在,当我们为 ASMlib 配置卷时,将使用这些新的设备名称。


5 ~- z. i; y( `: g
  • /dev/iscsi/data1/part1
    # E5 q2 J* g# v4 |; o; V/dev/iscsi/fra1/part1
' o. i7 z+ |2 z5 H' A9 K7 [7 M

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-7-9 17:31:52 | 显示全部楼层
在 Oracle RAC 节点上配置 iSCSI 卷5 w5 {4 Z9 R9 b  V" d. h) p9 Q
在集群中的两个 Oracle RAC 节点上配置 iSCSI 启动器。而创建分区只应在 RAC 集群的一个节点上执行。# n" w' [0 F- w# _: k1 p% U
iSCSI 客户端可以是提供 iSCSI 支持(驱动程序)的任何系统(Linux、Unix、MS Windows、Apple Mac 等)。在我们的示例中,客户端是两个 Linux 服务器(racnode1 和 racnode2),它们运行的是 Oracle Enterprise Linux 5.4。
# n9 g  Y. O  X& i在本节中,我们将在两个 Oracle RAC 节点上配置 iSCSI 软件启动器。Oracle Enterprise Linux 5.4 包括 iSCSI 软件启动器,该软件启动器位于 iscsi-initiator-utils RPM 中。这是对早期版本 Oracle Enterprise Linux (4.x) 的一个更改,这些早期版本中包含作为 Linux-iSCSI 项目的一部分而开发的 Linux iscsi-sfnet 软件驱动程序。所有 iSCSI 管理任务(如发现和登录)将使用 Open-iSCSI 中包含的命令行接口 iscsiadm。8 R& E0 r* E: s, ^
iSCSI 软件启动器将配置为自动登录网络存储服务器 (openfiler1),并发现 上一节中创建的 iSCSI 卷。之后,我们将逐步使用 udev 为发现的每个 iSCSI 目标名称创建永久性本地 SCSI 设备名称(即/dev/iscsi/crs1)。拥有一致的本地 SCSI 设备名称及其映射到的 iSCSI 目标,有助于在配置 ASM 时能够区分三个卷。但是,在此之前,我们首先必须安装 iSCSI 启动器软件。
) q, b5 y; c: j8 v# p$ {注:本指南使用 ,它是 Oracle Database 的自动存储管理 (ASM) 特性的一个支持库。ASMLib 将用于对本指南中所使用的所有 iSCSI 卷进行标记。默认情况下,ASMLib 已为 ASM 使用的存储设备提供了永久性路径和权限。有了该特性后,无需用存储设备路径和权限更新 udev 或 devlabel文件。就本文来说,实际上我仍然选择使用 udev 为发现的每个 SCSI 目标名称创建永久性本地 SCSI 设备名称。这提供了一种自我文档编制的方法,有助于快速确定每个卷的名称和位置。( S. D7 a" E2 K( C2 @: ^! C- ^
安装 iSCSI(启动器)服务
' [0 ^1 G% E8 H就 Oracle Enterprise Linux 5.4 来说,默认情况下不会安装 Open-iSCSI iSCSI 软件启动器。该软件包含在 1 号 CD 上的 iscsi-initiator-utils 程序包中。要确定该程序包是否已安装(大多数情况下没有安装),在两个 Oracle RAC 节点上执行以下命令:9 u0 f% Q6 O: l! e! V
[root@racnode1 ~]# rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"| grep iscsi-initiator-utils ( m! V, C& X/ }, j6 w5 S
如果 iscsi-initiator-utils 程序包未安装,将 1 号 CD 加载到每个 Oracle RAC 节点中并执行以下命令:0 W3 \! ^3 M- r; E1 }
[root@racnode1 ~]# mount -r /dev/cdrom /media/cdrom [root@racnode1 ~]# cd /media/cdrom/Server [root@racnode1 ~]# rpm -Uvh iscsi-initiator-utils-* [root@racnode1 ~]# cd / [root@racnode1 ~]# eject
; Q9 m* E, E9 I6 b. o0 v% j6 y确认 iscsi-initiator-utils 程序包现在已安装:8 J; v8 |* r' R  r: j9 h3 _# d
[root@racnode1 ~]# rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"| grep iscsi-initiator-utils iscsi-initiator-utils-6.2.0.871-0.10.el5 (x86_64) 8 P# K! ~  W$ j
& Y. D4 j& N; c5 W
配置 iSCSI(启动器)服务$ C& _- T9 D0 u( W+ _: T4 T
验证 iscsi-initiator-utils 程序包已经安装到两个 Oracle RAC 节点之后,启动 iscsid 服务,并使其在系统引导时自动启动。我们还将配置 iscsi 服务在系统启动时自动启动,自动登录到所需的 iSCSI 目标。* N  s' z3 W5 b; `2 f# X* n' s
[root@racnode1 ~]# service iscsid start Turning off network shutdown. Starting iSCSI daemon: [ OK ]" X  S* o. y0 y- p) M7 Y
                                                     [ OK ]" K  L, D/ V# h# h! w8 A1 Q
[root@racnode1 ~]# chkconfig iscsid on [root@racnode1 ~]# chkconfig iscsi on
2 J) k" G& D* {! x4 s; n- ^( V: f现在 iSCSI 服务已经启动,下面使用 iscsiadm 命令行接口发现网络存储服务器上的所有可用目标。这应该在两个 Oracle RAC 节点上执行,以检验配置是否正常工作:0 {7 \% ~5 ~) x# ]) D+ A8 a4 n
[root@racnode1 ~]# iscsiadm -m discovery -t sendtargets -p openfiler1-priv 192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.crs1+ M* U4 t9 Z3 v
192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.fra1, I; m" |7 J- }/ G9 @# @
192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.data1 5 e2 v* s* M) [; t& {7 ^
手动登录到 iSCSI 目标
+ }0 _  n0 S6 `( ~6 m- u此时,iSCSI 启动器服务已经启动,每个 Oracle RAC 节点都能够从网络存储服务器中发现可用目标。下一步是手动登录每个可用目标,这可以使用 iscsiadm 命令行接口完成。这需要在两个 Oracle RAC 节点上运行。注意,我必须指定网络存储服务器的 IP 地址而非其主机名 (openfiler1-priv) — 我认为必须这么做,因为上述发现使用 IP 地址显示目标。8 o3 @0 f. y9 a5 l4 v+ o3 }# Q
[root@racnode1 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.crs1 : @3 H: z& H" }  K4 m1 M9 G
-p 192.168.2.195 -l [root@racnode1 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.data1 + Q* G! m3 P" V2 M  _( D
-p 192.168.2.195 -l [root@racnode1 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.fra1 1 E8 G* o9 [" Q
-p 192.168.2.195 -l
: i* S. |2 Q( m' L配置自动登录
( J0 @# Z: @1 d3 M9 v9 W下一步是确保在计算机引导(或 iSCSI 启动器服务启动/重启)时,客户端将自动登录到上面列出的每个目标。如同上面描述的手动登录过程,在两个 Oracle RAC 节点上执行以下命令:
3 G/ U" Z5 u  l" s$ S! b/ A[root@racnode1 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.crs1
9 v) G3 n& u/ m+ @4 _1 d-p 192.168.2.195 --op update -n node.startup -v automatic [root@racnode1 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.data1
! U+ s9 N! \6 O$ f' R7 X-p 192.168.2.195 --op update -n node.startup -v automatic [root@racnode1 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.fra1 # @/ i8 r/ C% }: z" D( J; ^, \, S0 d
-p 192.168.2.195 --op update -n node.startup -v automatic : }6 p" h" l" t% V9 B+ C
创建永久性本地 SCSI 设备名称
9 y- l5 N- `. g- O% o6 A在本节中,我们将逐步为每个 iSCSI 目标名称创建永久性本地 SCSI 设备名称。我们将使用 udev 来完成该任务。拥有一致的本地 SCSI 设备名称及其映射到的 iSCSI 目标,有助于在配置 ASM 时能够区分三个卷。尽管并未严格要求这么做(因为我们将对所有卷使用 ),这提供了一种自我文档编制的方法,有助于快速确定每个 iSCSI 卷的名称和位置。
- H4 ?: ^5 w, x5 C1 L如果任一 Oracle RAC 节点引导并且 iSCSI 启动器服务启动,它会以一种随机的方式自动登录到配置的每个目标,并将这些目标映射到下一个可用的本地 SCSI 设备名称。例如,目标 iqn.2006-01.com.openfiler:racdb.crs1 可能会映射到 /dev/sdb。实际上,我可以通过查看/dev/disk/by-path 目录来确定所有目标的当前映射:
) x: D- s2 D' B" K[root@racnode1 ~]# (cd /dev/disk/by-path; ls -l *openfiler* | awk '{FS=" ";
0 U  w" g& D0 `+ m9 w3 Y7 p5 mprint $9 " " $10 " " $11}') ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0 -> ../../sdb
7 T& c; G; |& Q- Y( D$ uip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0 -> ../../sdd
- l1 I" c7 u$ C+ t3 R* sip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0 -> ../../sdc
" V/ d" n8 P6 H/ l使用上述 ls 命令的输出结果,我们可以建立以下当前映射:
  ^. g% Z9 Y( i5 e) B$ s8 viSCSI 目标名称到本地 SCSI 设备名称的当前映射
' t7 O+ y" L' e9 A: U* v7 Q6 TiSCSI 目标名称 SCSI 设备名称" J( F6 p' I# ]3 ?: c) W# m" G* w
iqn.2006-01.com.openfiler:racdb.crs1 /dev/sdb
. X, U. L9 ^1 O$ n; uiqn.2006-01.com.openfiler:racdb.data1 /dev/sdd( g  s, m" K4 s! o2 w" K7 x
iqn.2006-01.com.openfiler:racdb.fra1 /dev/sdc5 L4 _( Z4 r! i( l. M# E
但是,每次重新引导 Oracle RAC 节点时,该映射都可能有所不同。例如,重新引导之后,可能会决定将 iSCSI 目标 iqn.2006-01.com.openfiler:racdb.crs1 映射到本地 SCSI 设备 /dev/sdc。由于您无法预测重新引导后的 iSCSI 目标映射,依赖于使用本地 SCSI 设备名称是不现实的。
* u! Z* B, c( t' N# R  G  c我们需要的是可引用的一致的设备名称(即 /dev/iscsi/crs1),该设备名称在重新引导后将始终指向相应的 iSCSI 目标。这就是引入名为 udev 的动态设备管理 工具的原因。 udev 提供了一个动态设备目录,使用一组可配置的规则通过符号链接指向实际设备。当 udev 收到设备事件(例如,客户端登录到 iSCSI 目标)时,就会根据 sysfs 中提供的可用设备属性匹配其配置好的规则以便识别设备。匹配规则可以提供其他设备信息或指定设备节点名和多个符号链接名,并指示 udev 运行其他程序(例如,一个 SHELL 脚本)作为设备事件处理过程的一部分。
% m/ K0 q. b( }6 @第一步是创建一个新的规则文件。该文件将命名为 /etc/udev/rules.d/55-openiscsi.rules,并且只包含一行用于接收我们感兴趣事件的名称=值对。它还将定义一个调出 SHELL 脚本 (/etc/udev/scripts/iscsidev.sh),用于处理事件。
" s, D4 o5 x1 T# i在两个 Oracle RAC 节点上创建以下规则文件 /etc/udev/rules.d/55-openiscsi.rules:! Q% b  H( ?% e4 y" ?) V. d" v: G
..............................................
2 ?: Q" v- l7 c  q: }# /etc/udev/rules.d/55-openiscsi.rules9 A/ o6 |) N# Q
KERNEL=="sd*", BUS=="scsi", PROGRAM="/etc/udev/scripts/iscsidev.sh %b",5 u+ A; v# z* @8 p
SYMLINK+="iscsi/%c/part%n"+ L/ K; `7 q1 u$ D# _( A9 ^( n
............................................... m$ L8 f+ u4 @
现在,我们需要创建在接收该事件时将调用的 UNIX SHELL 脚本。我们首先在两个 Oracle RAC 节点上创建一个单独的目录,用于存储 udev 脚本:
+ S! g6 z) e: o  g0 a7 U$ y[root@racnode1 ~]# mkdir -p /etc/udev/scripts
7 M! X/ f# A& Q( S3 v! a+ Y. H接下来,在两个 Oracle RAC 节点上创建 UNIX shell 脚本 /etc/udev/scripts/iscsidev.sh:
7 @/ w6 Z# y# `. [8 g  ]# X8 C ..............................................% h9 n. l( s+ q
#!/bin/sh
! l1 H- u+ V, e5 G/ r # FILE: /etc/udev/scripts/iscsidev.sh
1 a8 i7 |3 I& A- `BUS=${1}
, \5 Q. L7 x& J7 F6 i& z! \HOST=${BUS%%:*}, K' k8 m  J, b, v
[ -e /sys/class/iscsi_host ] || exit 1
) i4 O5 l$ U0 l5 ]! m9 p: a8 Mfile="/sys/class/iscsi_host/host${HOST}/device/session*/iscsi_session*/
- U! |5 f5 K4 T6 Ltargetname"2 h% ~, |3 [! j9 O* |$ d
target_name=$(cat ${file})
7 q0 Y- z! R% r; g" q3 R& \7 c5 o# This is not an open-scsi drive
! a- m, o. S9 Jif [ -z "${target_name}" ]; then
+ D4 q) z% J+ j, g* p/ y   exit 1
7 W+ P9 ?$ Z$ @$ f( M1 g# Lfi, ~6 U: }2 P& N
# Check if QNAP drive
! l; [1 S! y1 A4 dcheck_qnap_target_name=${target_name%%:*}% }, }5 ?. Z4 P3 E! H4 J2 d, R
if [ $check_qnap_target_name = "iqn.2004-04.com.qnap" ]; then/ N* |9 V1 U! }  V9 I9 q) t1 L
    target_name=`echo "${target_name%.*}"`
: s/ F5 O+ }+ w  @  x6 bfi
4 W. n7 K6 O. s# s# W& u  Uecho "${target_name##*.}"
! o. `( x4 ]) S1 v.............................................. - s' i+ x' {+ t3 t6 m) u, w
创建 UNIX SHELL 脚本后,将其更改为可执行文件:
$ x, u. M; s7 v% C5 g5 B2 D [root@racnode1 ~]# chmod 755 /etc/udev/scripts/iscsidev.sh " }+ e) [# ]; N. L
既然已经配置了 udev,下面将在两个 Oracle RAC 节点上重新启动 iSCSI 服务:
* x: O7 }$ d% _[root@racnode1 ~]# service iscsi stop Logging out of session [sid: 6, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]
2 j$ o4 ?6 ]! q: t2 KLogging out of session [sid: 7, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]
; }7 z- y7 H$ F. Q7 H( T$ ^( s5 u" _Logging out of session [sid: 8, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]
8 g, D  h' J' J# H1 k3 d3 CLogout of [sid: 6, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]: successful
/ I+ ?: w% r: v" C9 f2 yLogout of [sid: 7, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]: successful$ Y- m0 G8 i; A$ {( |3 O
Logout of [sid: 8, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]: successful
; i" W. R9 q& L6 i" A5 e8 TStopping iSCSI daemon:                               [ OK ]/ S: Z3 i$ J3 x. E$ b1 f* {
[root@racnode1 ~]# service iscsi start iscsid dead but pid file exists
3 ]1 {7 @4 G+ l1 ^- y- @: x) \; mTurning off network shutdown. Starting iSCSI daemon: [ OK ]3 y0 Q! e& ^. M8 B4 R
                                                     [ OK ]" m+ y: R7 ~$ W
Setting up iSCSI targets: Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]
% u3 [# y/ o% D/ ?. [4 [( }Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]
' R/ |! Q( `7 D! w+ I9 g/ {Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]
  k( Z+ F0 p) G5 jLogin to [iface: default, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]: successful
7 l5 ?7 @! k- ?3 r( qLogin to [iface: default, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]: successful5 Z) ]6 n; L) a  u6 ]+ ~: N) F
Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]: successful [ OK ] * A- N& ?( R. B5 j& {# }
下面,我们来看一下我们的辛勤工作是否得到了回报:1 t6 z: a& X* f; i' t6 v8 ~
[root@racnode1 ~]# ls -l /dev/iscsi/* /dev/iscsi/crs1:
6 J+ B; z8 V% Z' O' j1 Ototal 0+ S: J; B- L" T
lrwxrwxrwx 1 root root 9 Nov  3 18:13 part -> ../../sdc. {! Z) i' s1 J! j
/dev/iscsi/data1:. F: B; X! ^  U; V* f9 H
total 0; N7 Z' j5 r: B/ A2 e2 y) ]8 A1 U
lrwxrwxrwx 1 root root 9 Nov  3 18:13 part -> ../../sde
  d1 |1 N/ X4 k: O- b/dev/iscsi/fra1:6 N0 f0 D" V& i+ Z
total 0/ X. {. L% H, z1 @# w. ?9 O
lrwxrwxrwx 1 root root 9 Nov  3 18:13 part -> ../../sdd
: d1 y2 W2 d, p* }. B上面的清单显示, udev 所做的工作正是我们所期待的!现在,我们拥有了一组一致的本地设备名称,可用于引用 iSCSI 目标。例如,我们可以安全地认为设备名称 /dev/iscsi/crs1/part 将始终引用 iSCSI 目标 iqn.2006-01.com.openfiler:racdb.crs1。现在,我们拥有了一致的 iSCSI 目标名称到本地设备名称的映射,如下表所示:
; A, m) b# y$ M5 j  biSCSI 目标名称到本地设备名称的映射! d$ M% N, d  H1 X. F
iSCSI 目标名称 本地设备名称5 O) j+ |' A7 t0 B
iqn.2006-01.com.openfiler:racdb.crs1 /dev/iscsi/crs1/part
8 B) Q* O# Y# J1 ziqn.2006-01.com.openfiler:racdb.data1 /dev/iscsi/data1/part: F# ?  f* u! Y
iqn.2006-01.com.openfiler:racdb.fra1 /dev/iscsi/fra1/part9 |7 W5 W" k7 i+ c( O5 Z

# o$ }/ c3 ~% m- Q4 p/ Z% E) m在 iSCSI 卷上创建分区
, e' W- a7 u6 x6 m) Z/ h6 `现在,我们需要在每个 iSCSI 卷上创建一个占用整个卷大小的主分区。正如本文前面提到的,我将使用自动存储管理 (ASM) 存储 Oracle 集群件所需的共享文件、物理数据库文件(数据/索引文件、联机重做日志文件和控制文件),以及集群数据库的快速恢复区 (FRA)。
. R/ E7 y% v( @; R4 LOracle Clusterware 共享文件(OCR 和表决磁盘)将存储在一个名为 +CRS 的使用外部冗余 配置的 ASM 磁盘组中。集群数据库的物理数据库文件将存储在一个名为 +RACDB_DATA 的也使用外部冗余配置的 ASM 磁盘组中。最后,快速恢复区(RMAN 备份和存档重做日志文件)将存储于一个名为 +FRA 的使用外部冗余配置的第三个 ASM 磁盘组中。
7 D, y. p/ S. H$ n+ l/ Q# J' w下表列出了将要创建的三个 ASM 磁盘组及其将包含的 iSCSI 卷:+ k" D! x9 V. a' P4 Z
Oracle 共享驱动器配置
) _6 Z( p4 u2 e+ h2 d文件类型 ASM 磁盘组名称 iSCSI 目标(短)名称 ASM 冗余 大小 ASMLib 卷名( ]0 \" @( e) V5 S3 T* P, W6 Y
OCR 和表决磁盘 +CRS crs1 External 2GB ORCL:CRSVOL18 P1 ?  q% X" a4 o7 a5 H, w
Oracle 数据库文件 +RACDB_DATA data1 External 32GB ORCL:DATAVOL1( A7 j5 j& G5 b6 h3 J
Oracle 快速恢复区 +FRA fra1 External 32GB ORCL:FRAVOL1! y# B. a' R6 t* v9 Q1 J! g
如上表所示,我们需要在每个 iSCSI 卷(共三个)上创建一个 Linux 主分区。 fdisk 命令在 Linux 中用于创建(和删除)分区。对于每个 iSCSI 卷(共三个),您都可以在创建主分区时使用默认值,因为默认操作是使用整个磁盘。您可以放心地忽略任何指示设备未包含有效 DOS 分区(或 Sun、SGI 或 OSF 磁盘标签)的警告。
# V/ G* P$ v8 e9 Z2 q在本例中,我将在 racnode1 上运行 fdisk 命令,使用中通过 udev 创建的本地设备名称在每个 iSCSI 目标上创建一个主分区:
" r3 e1 r$ S; l5 e; _' H) L! N& M& h5 v. N6 G& }
/dev/iscsi/crs1/part
+ L5 q0 V4 K% q$ z, E5 o. s/dev/iscsi/data1/part( E0 E4 q$ o! |) @9 k
/dev/iscsi/fra1/part
& }5 C4 s+ O) s* o  Q1 `/ y/ K. D9 p
! q9 K4 W! m3 ^: k! R# p注:要在每个 iSCSI 卷上创建单个分区,只能从 Oracle RAC 集群中的一个节点上进行!(如racnode1)
! T: t$ Z0 U7 Z+ v1 z # ---------------------------------------( q. b/ I7 ~. N8 k" [; i
[root@racnode1 ~]# fdisk /dev/iscsi/crs1/part Command (m for help): n Command action
, g( L! i" z) b7 L  y4 J) i: z   e   extended
7 }( {- {+ Z# C   p   primary partition (1-4)  p Partition number (1-4): 1 First cylinder (1-1012, default 1): 1 Last cylinder or +size or +sizeM or +sizeK (1-1012, default 1012): 1012 Command (m for help): p Disk /dev/iscsi/crs1/part: 2315 MB, 2315255808 bytes
4 x( K& V9 Q/ b' ]+ |' ?72 heads, 62 sectors/track, 1012 cylinders3 F' h! h' l) n( ^( I8 u) L9 c
Units = cylinders of 4464 * 512 = 2285568 bytes
6 W' Y7 C1 s' l& w               Device Boot      Start         End      Blocks   Id  System
, z! @) W4 Y: i5 v6 m6 S3 s0 B" a/dev/iscsi/crs1/part1               1        1012     2258753   83  Linux- n3 T% h0 [( I) F' R7 `
Command (m for help): w The partition table has been altered!
5 @0 F4 A$ ^, F% h1 r- V( @; ICalling ioctl() to re-read partition table.
( D% a" y2 o2 [+ BSyncing disks.
' y0 W$ h. R' U& J4 G- {) r# P- J# ---------------------------------------7 L8 ^4 I: |+ E) ~, s
[root@racnode1 ~]# fdisk /dev/iscsi/data1/part Command (m for help): n Command action0 c) _5 e- ?  O" Z7 M% q
   e   extended
% t/ k1 O2 h7 Q# S( e   p   primary partition (1-4)  p Partition number (1-4): 1 First cylinder (1-33888, default 1): 1 Last cylinder or +size or +sizeM or +sizeK (1-33888, default 33888): 33888 Command (m for help): p Disk /dev/iscsi/data1/part: 35.5 GB, 35534143488 bytes
7 M2 F. H( J  G6 n64 heads, 32 sectors/track, 33888 cylinders
# i2 m2 U5 \/ K! p  b/ ZUnits = cylinders of 2048 * 512 = 1048576 bytes' a1 L2 a+ K# [% u+ D* K
                 Device Boot      Start         End      Blocks   Id  System7 p; E- ]  M  m$ b: l$ m
/dev/iscsi/data1/part1               1       33888    34701296   83  Linux2 N* K* V) A0 R2 n3 K. X$ ^
Command (m for help): w The partition table has been altered!9 U9 g; T1 i( H+ q7 E# g8 B6 g
Calling ioctl() to re-read partition table.
0 r% U5 B5 G8 [: X0 U1 `  l( TSyncing disks.
- D  U: f( `. w, g6 ~# ---------------------------------------
: y% |) a& e5 E5 w$ D[root@racnode1 ~]# fdisk /dev/iscsi/fra1/part Command (m for help): n Command action
1 R2 w( I9 x8 W* R' ~( g   e   extended
9 o; E: n) W6 A( z/ |5 a6 `2 s   p   primary partition (1-4)  p Partition number (1-4): 1 First cylinder (1-33888, default 1): 1 Last cylinder or +size or +sizeM or +sizeK (1-33888, default 33888): 33888 Command (m for help): p Disk /dev/iscsi/fra1/part: 35.5 GB, 35534143488 bytes  a4 p: ~2 \# y8 G
64 heads, 32 sectors/track, 33888 cylinders
7 x. P# j- P, {: E7 zUnits = cylinders of 2048 * 512 = 1048576 bytes; `3 V2 u8 @  |
               Device Boot      Start         End      Blocks   Id  System
: }0 y! R5 ?1 w: U& ]% ?1 u8 i' C3 P/dev/iscsi/fra1/part1               1       33888    34701296   83  Linux  b7 p  f$ n$ p) ?( G4 Q
Command (m for help): w The partition table has been altered!8 X/ n* d8 Z. t' G+ Y  j9 l% r
Calling ioctl() to re-read partition table.
3 D; R: Y: t$ o" v' x3 V- X Syncing disks. 1 ?5 X! C! s- J) c: {
验证新分区( o/ L4 V! F, E+ c; l4 _$ p
在 racnode1 上创建所有需要的分区之后,现在应使用以下命令以“root”用户帐户从 Oracle RAC 集群的所有其余节点 (racnode2) 将分区更改通知给内核。注意,Openfiler 发现的 iSCSI 目标名称和本地 SCSI 设备名称的映射在两个 Oracle RAC 节点上将有所不同。不用担心,这不会导致任何问题,因为我们将使用 udev 在中创建的本地设备名称而不是其他的本地 SCSI 设备名称。
' a' L2 v; q% p/ |/ F$ |
0 N7 h! Z7 K7 L  s% O在 racnode2 上运行以下命令:
2 `5 w  Q5 Q0 |' b; h& n[root@racnode2 ~]# partprobe [root@racnode2 ~]# fdisk -l Disk /dev/sda: 160.0 GB, 160000000000 bytes0 i. I( V  V* G$ |4 x$ G$ D) b( n
255 heads, 63 sectors/track, 19452 cylinders
( X* y% A% d& f8 MUnits = cylinders of 16065 * 512 = 8225280 bytes% B# V3 r: w9 Z# W8 }/ ?' X) A
   Device Boot      Start         End      Blocks   Id  System
! s' t" v4 S5 |/ |$ z/dev/sda1   *           1          13      104391   83  Linux
  w/ @( E5 Q( n4 X: L/dev/sda2              14       19452   156143767+  8e  Linux LVM0 |) p& O8 u1 X) Z4 r3 a" r, r
Disk /dev/sdb: 35.5 GB, 35534143488 bytes2 t- P) I( F0 t; M
64 heads, 32 sectors/track, 33888 cylinders  y/ X3 r% Q: r7 }! `& T
Units = cylinders of 2048 * 512 = 1048576 bytes
+ r& u9 L3 T2 M' E' C5 X/ S   Device Boot      Start         End      Blocks   Id  System( O5 `# T* ^" i4 P' Y! c' L0 ?- I
/dev/sdb1               1       33888    34701296   83  Linux; b: t% V3 v9 w* b1 N6 K
Disk /dev/sdc: 35.5 GB, 35534143488 bytes
# g% B$ J# z8 X/ H64 heads, 32 sectors/track, 33888 cylinders
4 S+ H* J3 M& v7 YUnits = cylinders of 2048 * 512 = 1048576 bytes' \7 y8 g" r! h0 r# C3 n6 c
   Device Boot      Start         End      Blocks   Id  System
8 q+ m/ K4 ?: E5 a2 S. p, a/dev/sdc1               1       33888    34701296   83  Linux
9 R, U; M) j8 R4 a1 gDisk /dev/sdd: 2315 MB, 2315255808 bytes
- q5 _7 K# d% [4 I/ U72 heads, 62 sectors/track, 1012 cylinders
- m: i& P6 Y  b$ q. TUnits = cylinders of 4464 * 512 = 2285568 bytes; B+ c4 v) \) d* f6 e, A
   Device Boot      Start         End      Blocks   Id  System! F# m+ c8 h* I' I6 L& a$ T: {
/dev/sdd1               1        1012     2258753   83  Linux # `9 b3 V( u; D( }% A% d. R1 |" U
最后,您应该在两个 Oracle RAC 节点上运行以下命令,以验证 udev 为每个新分区创建了新的符号链接:
& b. i8 o: t+ j1 v7 x3 B* d. e7 k$ G[root@racnode2 ~]# (cd /dev/disk/by-path; ls -l *openfiler* | awk '{FS=" "; print $9 " " $10 " " $11}') ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0 -> ../../sdd7 o( ]7 l+ j4 f7 e" M6 r3 t
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0-part1 -> ../../sdd1
( l0 m! i& k* G% L4 ~& m/ o$ @8 Qip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0 -> ../../sdc
; A: H- D, Q& Q* \$ wip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0-part1 -> ../../sdc1) v& r/ t" X5 P& v0 a; F& d
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0 -> ../../sdb! C6 C5 Y' O1 v: g% E. G) [
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0-part1 -> ../../sdb1 / M! X$ n0 {  W. g/ {
上面的清单显示, udev 确实为每个新分区创建了新的设备名称。在,当我们为 ASMlib 配置卷时,将使用这些新的设备名称。
, O. G. ?. t/ [  V8 z" X7 x) d! Y- I' w+ C# S
/dev/iscsi/crs1/part19 e0 E* u8 o3 M8 x, _
/dev/iscsi/data1/part1
( _. N6 K! l: p3 O2 L, K" E! S/dev/iscsi/fra1/part1. S8 o" B. y- [, o" Z5 F8 N) f8 l

( @% u8 N7 t  t9 \) M
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-11 23:15 , Processed in 0.022644 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表