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

oracle rac使用iscsi设备

[复制链接]

0

主题

0

回帖

9

积分

管理员

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

3 Q. j0 E! {9 b2 ^/ y- Y
在集群中的两个 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]复制" R  S) c& \4 a9 P5 v
Copied to Clipboard% k# o7 r& _) _8 N# O6 v
Error: Could not Copy" B7 V2 X. G, w
' b5 a9 e1 a5 u9 y6 {4 ]
[root@racnode1 ~]#  rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"| grep iscsi-initiator-utils
, O- s9 ~9 n' Q+ V" d  s
如果未安装 iscsi-initiator-utils 软件包,则将 CD #1 加载到每一个 Oracle RAC 节点中,然后执行以下操作:
[size=1.78]复制
7 d, I( K3 R  [+ a2 P8 LCopied to Clipboard1 d) z$ V! x! r7 V- j4 @6 j
Error: Could not Copy
8 K8 G7 Y; Z- W9 x8 M/ w; p
# d1 L2 p2 w- H
[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

5 |* Q% E6 p8 X: x4 A
验证现已安装 iscsi-initiator-utils 软件包:
[size=1.78]复制
# D4 n* r% q1 O: p1 QCopied to Clipboard* h9 [) d: J6 B* ]7 {6 @, o( X
Error: Could not Copy* C1 V* Y2 Q2 h+ v

5 B2 z+ d* V3 _$ R. l$ q4 V5 y* B' l[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)
: y: v* F3 _$ Q8 i
配置 iSCSI(启动器)服务
验证两个 Oracle RAC 节点上均安装了 iscsi-initiator-utils 软件包之后,启动 iscsid 服务并设置其在系统启动时自动启动。我们还将配置 iSCSI 服务自动启动,以便于在系统启动时登录到所需 iSCSI 目标。
[size=1.78]复制
+ M" w1 ]! R4 n9 ICopied to Clipboard
% b5 F6 K5 q. mError: Could not Copy' h! ?# k# ]  z6 D! q+ @% q0 Q

9 H' P, J* u! C* [' t" e[root@racnode1 ~]#  service iscsid start Turning off network shutdown. Starting iSCSI daemon:   OK ]   OK ]  [root@racnode1 ~]#  chkconfig iscsid on [root@racnode1 ~]#  chkconfig iscsi on

/ K, N/ p9 G/ \* L8 U
现在 iSCSI 服务已启动,请使用 iscsiadm 命令行界面来发现网络存储服务器上的所有可用目标。这应当在两个 Oracle RAC 节点上执行,以验证配置是否正常运行:
[size=1.78]复制
% T7 ]) R8 q/ R$ B& w  pCopied to Clipboard
6 Y( ?8 I7 U# b: b# S! `Error: Could not Copy
2 X/ t# b" ~7 }' \* L1 w

. l3 I9 {: W5 S[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

$ q) o! J, F: P, ~* [- i
手动登录至 iSCSI 目标
至此,iSCSI 启动器服务已启动,每一个 Oracle RAC 节点都可以从网络存储服务器中发现可用目标。下一步是手动登录至每一个可用目标,可以使用 iscsiadm 命令行界面来执行此操作。两个 Oracle RAC 节点上都需要运行此任务。请注意,我需要指定 IP 地址,而不是网络存储服务器的主机名 (openfiler1-priv) - 我认为这是必需的,因为(上述)发现显示了使用 IP 地址的目标。
[size=1.78]复制
. q3 a5 a) h2 A& I+ m% X1 X3 SCopied to Clipboard
- ?- Y- ?. N3 ^. ^Error: Could not Copy
, y# E+ @# Z* U- e
$ E% u6 t- g8 |6 _* g
[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
& @; \* H5 X8 q& M, e0 Z7 d
配置自动登录
下一步是确保客户端将在机器启动时(或 iSCSI 启动器服务启动/重新启动时)自动登录到上述每一个目标。与上述手动登录过程一样,在两个 Oracle RAC 节点上执行以下操作:
[size=1.78]复制
% }) W; ?9 {% {. rCopied to Clipboard
' j3 K/ g1 B& B& m! q3 ]Error: Could not Copy/ Z/ S2 v6 H+ z* J& g; g% K! Y4 i
' X% H7 L- q: l6 `
[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

! `6 a; L) s8 G1 o" {
创建持久本地 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]复制$ x; y: ~# Z$ v
Copied to Clipboard
& n' D7 i/ y* x) k+ V+ VError: Could not Copy
7 I+ u1 ?' S5 v+ v8 a
2 k7 H% W8 X  O5 K1 H# i  \
[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

% A2 l. v3 F: g4 Z7 a9 i- ]
我们可以使用上述输出建立以下当前映射:
当前 iSCSI 目标名称到本地 SCSI 设备名称映射
8 P/ v+ H! V" B
iSCSI 目标名称
SCSI 设备名称

/ P1 O7 Q% f  P4 _4 B" k, R
iqn.2006-01.com.openfiler:racdb.crs1
/dev/sdb

; {: v& X9 T& u1 O" v) h+ }
iqn.2006-01.com.openfiler:racdb.data1
/dev/sdd

2 x; ?6 {5 [  R0 z
iqn.2006-01.com.openfiler:racdb.fra1
/dev/sdc
* Y1 Q9 X) S. _) Z  F$ p& D
1 ]8 V3 `5 \0 X' {( G; `
但是,每次重新启动 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]复制
& e% G" w, a4 _& o) s* \6 aCopied to Clipboard1 _4 _; b4 ^. Z  W3 a! C
Error: Could not Copy
; F7 M9 `2 ^: W, K0 F* N

& I; J' @, G& d% K+ S0 ~) K$ ].............................................. # /etc/udev/rules.d/55-openiscsi.rules KERNEL=="sd*", BUS=="scsi", PROGRAM="/etc/udev/scripts/iscsidev.sh %b",SYMLINK+="iscsi/%c/part%n" ..............................................
% Q6 p+ B7 W! ?, ^3 [7 i
我们现在需要创建 UNIX SHELL 脚本。当收到此事件时将调用该脚本。让我们首先在两个 Oracle RAC 节点上创建一个单独的目录来存储 udev 脚本:
[size=1.78]复制& V0 `; s6 Q( }
Copied to Clipboard$ v# o; v) N$ }6 c7 x
Error: Could not Copy9 x' d" C  U% [7 v

6 X! @5 w+ `6 l7 l, q3 U[root@racnode1 ~]#  mkdir -p /etc/udev/scripts
9 R% z3 ^7 H% r. k, m* p3 M
接下来,在两个 Oracle RAC 节点上创建 UNIX shell 脚本 /etc/udev/scripts/iscsidev.sh:
[size=1.78]复制) r; e. Z; [: F# [* K
Copied to Clipboard* w0 r9 |3 d$ y: ^( ~+ r
Error: Could not Copy
9 b) y5 P2 g( b+ ^
+ Z+ L9 a6 ?6 I2 ^  k
.............................................. #!/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##*.}" ..............................................
6 o# o3 ?( e6 G: X
在创建 UNIX SHELL 脚本之后,将其更改为可执行文件:
[size=1.78]复制" w, t7 F+ a; f/ S
Copied to Clipboard
$ ^6 S1 |$ W5 I" [2 c- w$ U. vError: Could not Copy3 @+ T' `) y2 ?

" T# J/ z  v/ H, j[root@racnode1 ~]#  chmod 755 /etc/udev/scripts/iscsidev.sh
; S: `8 m8 Y3 e- U
现在已经配置了 udev,接下来在两个 Oracle RAC 节点上重新启动 iSCSI 服务:
[size=1.78]复制$ |7 v! u+ g' U, {
Copied to Clipboard
. p5 a( }9 Q0 C; t9 g8 Q  ]/ T0 lError: Could not Copy% c8 }- i& e7 P- U+ j* F
( l9 y* i. {( l! L
[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 ]
6 X5 w/ {7 _% ]' P& g
我们来看看最终的结果:
[size=1.78]复制
! v4 p# S; k, R, Y8 @# x( RCopied to Clipboard0 G* Q  u9 m3 v
Error: Could not Copy! B( y, r9 g& k% D
5 p; d. \& s$ B
[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

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

. O' y" ]+ h: P
iSCSI 目标名称
本地设备名称
0 Z& ?) ?5 ?3 Q& X% Q9 T
iqn.2006-01.com.openfiler:racdb.crs1
/dev/iscsi/crs1/part

; K  j: g4 E( ]- d% t; _+ \% @/ C6 d5 W
iqn.2006-01.com.openfiler:racdb.data1
/dev/iscsi/data1/part
  f2 x; c( ~& D4 L6 z1 k
iqn.2006-01.com.openfiler:racdb.fra1
/dev/iscsi/fra1/part

. A0 W/ y+ m& g% i$ d
" t( g  E( M, P  L2 S
在 iSCSI 卷上创建分区
我们现在需要在跨整个卷大小的各个 iSCSI 卷上创建一个主分区。如前所述,我将使用自动存储管理 (ASM) 来存储 Oracle Clusterware 所需的共享文件、物理数据库文件(数据/索引文件、联机重做日志文件和控制文件)以及集群数据库的快速恢复区 (FRA)。
Oracle Clusterware 共享文件(OCR 和表决磁盘)将存储在名为 +CRS 的 ASM 磁盘组中,该磁盘组将配置为外部冗余。集群数据库的物理数据库文件将存储在名为 +RACDB_DATA 的 ASM 磁盘组中,该磁盘组也将配置为外部冗余。最后,快速恢复区(RMAN 备份和归档重做日志文件)将存储在名为 +FRA 的第三个 ASM 磁盘组中,该磁盘组也将配置为外部冗余。
下表列出了将创建的三个 ASM 磁盘组以及它们将包含哪些 iSCSI 卷:
Oracle 共享驱动器配置
$ \6 ?. V! n+ A2 w+ B0 Y
文件类型
ASM 磁盘组名称
iSCSI 目标(短)名称
ASM 冗余
大小
ASMLib 卷名

) H3 x1 K1 E) r5 i* z) S: u
OCR 和表决磁盘
+CRScrs1外部2GB
ORCL:CRSVOL1

# L/ ?0 Y) a+ b$ ?, ]7 C4 s
Oracle 数据库文件
+RACDB_DATAdata1外部32 GB
ORCL:DATAVOL1
) g+ F% {7 I5 m- T, {) z, R2 F5 K9 d6 C# N
Oracle 快速恢复区
+FRAfra1外部32 GB
ORCL:FRAVOL1

7 E  w( |! G6 s8 |& g) I# j

9 j5 I8 a4 G* m- Z) G$ n4 p
如上表所示,我们需要在每一个 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) Z* b0 A1 j  I  D
注意:在每一个 iSCSI 卷上创建单一分区时,只能从 Oracle RAC 集群中的一个节点运行!(即 racnode1)
[size=1.78]复制! L# z) r7 n) m( G
Copied to Clipboard
! j+ G' E( Y1 ~Error: Could not Copy
/ t- D+ J4 v2 q, @0 F

& p/ a% O+ f$ B+ p( c9 P# ---------------------------------------  [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.
0 u* _9 w  o8 L
验证新分区
从 racnode1 创建所有必需的分区后,您现在应当使用以下命令作为 Oracle RAC 集群 (racnode2) 中所有其余节点的“root”用户帐户,以便于向内核通知分区更改。请注意,从 Openfiler 发现的 iSCSI 目标名称与本地 SCSI 设备名称的映射在两个 Oracle RAC 节点上将有所不同。这不是问题,也不会造成任何问题,因为我们不会使用本地 SCSI 设备名称,而是使用 udev 在上一节中创建的本地设备名称。
从 racnode2 中,运行以下命令:
[size=1.78]复制
" S& B3 [! E6 z7 _8 pCopied to Clipboard: D; B, _% Y! T
Error: Could not Copy/ I. d' c6 Y2 x9 p! o' l( Y% F

4 i; Q6 i7 Z) v1 }, I. E" _: {[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
* `( H9 g0 |7 Z) F$ o/ B
最后一步,您应当在两个 Oracle RAC 节点上运行以下命令以验证 udev 是否为每个新分区创建了新的符号链接:
[size=1.78]复制& W% n/ |# x; u+ z  g4 ~
Copied to Clipboard5 D3 T% _4 e* O* W" z. t% K/ [. ^
Error: Could not Copy
' @$ N, A, _6 l7 H( q9 \

1 q3 u9 _! g1 F. o5 u4 z[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
. ~: f/ N8 f5 R
以上清单显示 udev 确实为每一个新分区创建了新的设备名称。在本指南稍后为 ASMlib 配置卷时,我们将使用这些新设备名称:
9 w( h4 t: j, }$ w. R6 Z8 H
  • /dev/iscsi/crs1/part1
  • /dev/iscsi/data1/part1
  • /dev/iscsi/fra1/part1
    * ?$ ?  w, P- z2 z

0

主题

0

回帖

9

积分

管理员

积分
9
QQ
 楼主| 发表于 2021-7-9 17:25:52 | 显示全部楼层
12.在 Oracle RAC 节点上配置 iSCSI 卷
. n, u5 y+ I/ b- o; U. u在集群中的两个 Oracle RAC 节点上配置 iSCSI 启动器。但是,应当仅在 RAC 集群中的节点之一上执行创建分区的操作。1 X+ K8 G: M# ?$ Y& `4 x
iSCSI 客户端可以是任何提供 iSCSI 支持(驱动程序)的系统(Linux、Unix、MS Windows、Apple Mac 等)。在本例中,客户端是两个 Linux 服务器,即 racnode1 和 racnode2,运行 Oracle Enterprise Linux 5.4。
' G6 I* d. C' l% s在本节中,我们将在两个 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。
) e9 ~+ g: V2 n3 i, M% |) N1 i& uiSCSI 软件启动器将被配置为自动登录至网络存储服务器 (openfiler1) 并发现上一节中创建的 iSCSI 卷。随后,我们将使用 udev 为所发现的每一个 iSCSI 目标名称创建持久本地 SCSI 设备名称(即 /dev/iscsi/crs1)。拥有一致的本地 SCSI 设备名称和所映射到的 iSCSI 目标,有助于在配置 ASM 时区分三个不同的卷。但是,在此之前,我们需要先安装 iSCSI 启动器软件。
! _% W. j' ], O$ `- A, @6 }注意: 本指南使用 ASMLib 2.0,它是 Oracle 数据库的自动存储管理 (ASM) 特性的支持库。ASMLib 将用于标记本指南中使用的所有 iSCSI 卷。默认情况下,ASMLib 已经为与 ASM 一起使用的存储设备提供了持久路径和权限。此功能消除了使用存储设备路径和权限更新 udev 或 devlabel 文件的需要。在本文和实践中,我仍然选择为使用 udev 发现的每一个 iSCSI 目标名称创建持久本地 SCSI 设备名称。这提供了一种自我归档方法,有助于快速识别每一个卷的名称和位置。
9 v: e. D/ ?& q2 Q) T6 Z. n安装 iSCSI(启动器)服务
3 f- ^) Q# b) U4 o. Z# f- _对于 Oracle Enterprise Linux 5.4,默认情况下不会安装 Open-iSCSI iSCSI 软件启动器。该软件包含在 iscsi-initiator-utils 软件包中,可从 CD #1 中找到该软件包。要确定是否安装了此软件包(大多数情况下未安装),请在两个 Oracle RAC 节点上执行以下操作:
* O6 ^! b# d, j1 [* O- f) R3 x复制. F- f8 \1 _3 F; g
Copied to ClipboardError: Could not Copy  H" b- ^+ u1 H
[root@racnode1 ~]# - g' o2 I6 U0 C1 T3 M. l
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"| grep iscsi-initiator-utils# u0 B4 U6 a! ^8 N% I) C
[root@racnode1 ~]#
+ X; p. Q7 H% ]! T rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"| grep iscsi-initiator-utils: l) J; Q6 E% I, P
如果未安装 iscsi-initiator-utils 软件包,则将 CD #1 加载到每一个 Oracle RAC 节点中,然后执行以下操作:% N6 w: t/ b4 z: \+ X  i
复制
" E6 O% l& q7 r2 h: r: lCopied to ClipboardError: Could not Copy
+ Q" v" D# D% {% o7 |0 T[root@racnode1 ~]# - \7 m9 n2 e& G, t) \% N8 A
mount -r /dev/cdrom /media/cdrom7 L" A# ]0 e2 x& W6 Y
[root@racnode1 ~]# 1 O% Z4 f6 u( s% ?. c
cd /media/cdrom/Server" _- L& y; P$ M6 u; l" O
[root@racnode1 ~]#
: u6 S8 S/ b' M! |8 B' G rpm -Uvh iscsi-initiator-utils-*
0 j8 G7 z& V5 @7 a: u [root@racnode1 ~]#
5 d3 o6 c5 E! G/ E( } cd /
/ r4 C% D4 c# j) U0 G' C [root@racnode1 ~]#
8 P2 F6 x) }5 v" D6 u eject" F9 x* }# s3 i5 o. f* |
[root@racnode1 ~]#
# K0 B; Y. n7 d6 U3 ^; s& ^ mount -r /dev/cdrom /media/cdrom
/ ?; C9 `* e! H1 ]: [5 L2 O( V/ f* z8 X [root@racnode1 ~]#
6 X  [* }, i5 M cd /media/cdrom/Server
7 @& p$ U7 h3 G/ I7 |6 _ [root@racnode1 ~]#
3 h2 z' t* g( ?; O2 _) p  [1 C rpm -Uvh iscsi-initiator-utils-*
) c, P+ O) `, } [root@racnode1 ~]# ; S5 _. [; N! p& Q% W
cd /- W3 \3 ?$ t6 F& t6 A( g5 a2 W
[root@racnode1 ~]#
. O: \. C$ e% e# j% M eject8 G! i8 ?% y/ ~. l
验证现已安装 iscsi-initiator-utils 软件包:
$ J* }3 e. t8 J& m4 n复制
- M0 [( C+ [$ z( ^2 \8 A* Y8 bCopied to ClipboardError: Could not Copy
6 E7 H$ G$ f& a[root@racnode1 ~]# % L6 D' U  q2 v
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"| grep iscsi-initiator-utils
' c0 M  h* V+ O" D: x% N iscsi-initiator-utils-6.2.0.871-0.10.el5 (x86_64)7 a- g9 p$ S0 Y( C1 O. Q$ A, ~* A- z
[root@racnode1 ~]# 8 Y* \" h  D) B' A0 L
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"| grep iscsi-initiator-utils/ H% Z9 J8 g9 o$ A
iscsi-initiator-utils-6.2.0.871-0.10.el5 (x86_64)
" d1 A+ I- E! {2 y配置 iSCSI(启动器)服务0 y7 N/ l& F- `. J* ?' _( |. S8 h
验证两个 Oracle RAC 节点上均安装了 iscsi-initiator-utils 软件包之后,启动 iscsid 服务并设置其在系统启动时自动启动。我们还将配置 iSCSI 服务自动启动,以便于在系统启动时登录到所需 iSCSI 目标。& p* S. I& b, K! Y1 }. b8 O
复制$ \$ w' L  c- E- j7 p' U* O9 X
Copied to ClipboardError: Could not Copy
9 G0 Y6 H6 N& t# ^" @' Q[root@racnode1 ~]# ; _' @% x+ [/ \  i/ F0 F+ c/ y
service iscsid start" R$ [  i& M  G* ~% l9 V% x1 ~/ @
Turning off network shutdown. Starting iSCSI daemon:
( [8 y. X; }6 S ' f* F1 s& I5 }3 W
OK ]
* T; q' F% A6 X1 t* b; @7 l% J ; s. O/ J2 n- H6 z% V) |

, {9 ^" b7 z% k OK ]
6 J. Q3 d: n" s! u/ X9 y2 |
2 a5 c% t, O+ f [root@racnode1 ~]# 7 Q% T2 `& @8 g) n8 J
chkconfig iscsid on/ G( J) M; w, _/ \/ _
[root@racnode1 ~]#
) Q; _9 e: a  A) j" W+ j chkconfig iscsi on
  C+ t" [6 D! [/ ^- C[root@racnode1 ~]# ; Y+ k) W% V: M) E
service iscsid start
% z6 H$ Q4 s6 d  G Turning off network shutdown. Starting iSCSI daemon:
" }/ H/ V% _/ e6 Z
  c' e" |3 p3 F8 K7 ^) f OK ]2 }" A) d2 F& ^2 }

' [" c: y! {4 d" h5 X: ?3 X8 E' k7 ] ) F. f  e/ W6 u9 B
OK ]6 Z" z0 Y9 o& z8 l* w! C2 [

" g5 K1 M, B0 M0 P5 D3 v8 x [root@racnode1 ~]#
# u* ]" F; L" D) { chkconfig iscsid on. ~& [( s+ ]$ N+ I
[root@racnode1 ~]#
- c: E/ I& I- n. n* F, M, Q chkconfig iscsi on
; |4 }2 V# P  |4 |/ w1 f% q现在 iSCSI 服务已启动,请使用 iscsiadm 命令行界面来发现网络存储服务器上的所有可用目标。这应当在两个 Oracle RAC 节点上执行,以验证配置是否正常运行:
9 a4 c" P3 Y) ^8 Q4 d# g( s复制
; P$ g& e0 G2 O. k  ICopied to ClipboardError: Could not Copy
+ ^3 {4 \" Q6 V& L& i[root@racnode1 ~]#
3 S( j' q) b8 Y6 m" w iscsiadm -m discovery -t sendtargets -p openfiler1-priv" A$ Z" N6 y- I. B
192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.crs1
, b8 C+ k8 Z) j( E 192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.fra18 T, u( A3 O7 N. ~* `  p$ i' ]
192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.data1
1 Z2 b, D  @4 c- N& y' ^[root@racnode1 ~]# % R4 }. F: B3 a( A' _
iscsiadm -m discovery -t sendtargets -p openfiler1-priv- B" z6 b/ u* b& Q  v
192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.crs1/ _* h0 I: H6 l4 b2 y5 G# W4 ~' F
192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.fra1
5 R8 H$ i) v, m/ [1 V8 Z+ ?( L 192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.data1
4 G; `. `. _5 e/ T- Z1 H7 k手动登录至 iSCSI 目标
: D' @0 S8 s9 B) J. `至此,iSCSI 启动器服务已启动,每一个 Oracle RAC 节点都可以从网络存储服务器中发现可用目标。下一步是手动登录至每一个可用目标,可以使用 iscsiadm 命令行界面来执行此操作。两个 Oracle RAC 节点上都需要运行此任务。请注意,我需要指定 IP 地址,而不是网络存储服务器的主机名 (openfiler1-priv) - 我认为这是必需的,因为(上述)发现显示了使用 IP 地址的目标。
+ X7 ?0 S. T! T7 `! d1 M5 `复制* F9 q, u( t  M
Copied to ClipboardError: Could not Copy
0 y6 A5 }, `- q8 W8 [9 X[root@racnode1 ~]# : |1 w. O2 c" D4 c0 \9 \5 G) B
iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.crs1 -p 192.168.2.195 -l8 g9 {' m: I2 |
[root@racnode1 ~]# 6 p6 Y5 [8 O3 x8 F9 m( F( w* b
iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.data1 -p 192.168.2.195 -l
* `- w, _9 w; T; ] [root@racnode1 ~]#
  b; D( r; h) Q& x7 c0 U8 z5 ~" B# E& h iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.fra1 -p 192.168.2.195 -l2 C5 Y  z3 ?# l% i; B5 v3 L1 ?
[root@racnode1 ~]# + a8 Z2 N) A4 [0 a$ ?9 z. }. i4 m2 }3 x
iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.crs1 -p 192.168.2.195 -l" ^" l. d; d9 X% z. y# F& G9 g
[root@racnode1 ~]#
# X5 a$ s/ r+ }* R iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.data1 -p 192.168.2.195 -l9 S" ?+ {$ }# T) y: D6 m: T
[root@racnode1 ~]#
4 m+ o. L% J$ K- ^ iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.fra1 -p 192.168.2.195 -l
) g) E6 S, u4 p. O3 ]配置自动登录% ^; D+ D( w' i1 w7 S
下一步是确保客户端将在机器启动时(或 iSCSI 启动器服务启动/重新启动时)自动登录到上述每一个目标。与上述手动登录过程一样,在两个 Oracle RAC 节点上执行以下操作:
/ h' J8 A4 z6 Y8 ^6 X( v复制
# r8 J% K5 h2 h( z4 H$ y' ZCopied to ClipboardError: Could not Copy& U4 R9 X# C; Q
[root@racnode1 ~]# 3 y5 n% ^8 q1 K( ]5 M) o/ i+ W* Y
iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.crs1 -p 192.168.2.195 --op update -n node.startup -v automatic
7 n3 k) i8 e% @! t. Q [root@racnode1 ~]# 3 m; z7 N: {( m$ [
iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.data1 -p 192.168.2.195 --op update -n node.startup -v automatic& V$ @2 G" O9 e* Y/ W" P3 q- W# X
[root@racnode1 ~]#
  t9 z4 ~; {' F- a2 k iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.fra1 -p 192.168.2.195 --op update -n node.startup -v automatic" L1 }* |2 X: K5 d
[root@racnode1 ~]#
% s& W* y, `6 @& d$ K* W1 ~ iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.crs1 -p 192.168.2.195 --op update -n node.startup -v automatic
& }; k! o4 Q/ n, a2 } [root@racnode1 ~]#
; u. Q& ]: l) M" l# M iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.data1 -p 192.168.2.195 --op update -n node.startup -v automatic
7 q& G& \1 n4 u; s+ q7 R [root@racnode1 ~]#
& b9 F( n7 h: Z  [) c1 Y8 v' ]6 h iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.fra1 -p 192.168.2.195 --op update -n node.startup -v automatic
! D3 b! m% {6 K3 u' T+ a1 i创建持久本地 SCSI 设备名称  h! F" E. A3 n7 n  k2 v  c
在本节中,我们将为每一个 iSCSI 目标名称创建持久本地 SCSI 设备名称。这将使用 udev 来完成。拥有一致的本地 SCSI 设备名称和所映射到的 iSCSI 目标,有助于在配置 ASM 时区分三个不同的卷。这并不是一项严格的需求,因为我们将为所有卷使用 ASMLib 2.0,而这提供了一种自我归档方法来快速识别每一个 iSCSI 卷的名称和位置。6 q3 J8 b) s+ K# U
当任何一个 Oracle RAC 节点启动以及 iSCSI 启动器服务启动时,它将自动登录到以随机方式配置的每一个目标,并将其映射至下一个可用的本地 SCSI 设备名称。例如,目标 iqn.2006-01.com.openfiler:racdb.crs1 可能会映射到 /dev/sdb。我实际上可以通过查看 /dev/disk/by-path 目录来确定所有目标的当前映射:
0 d( Z& L9 E9 H/ r! f/ t0 h复制
& S: V5 D" j/ r8 ^Copied to ClipboardError: Could not Copy+ }% c. Y0 L/ j, L
[root@racnode1 ~]#
2 C: B0 n7 Z# Z: U8 U1 b+ x+ ]6 y (cd /dev/disk/by-path; ls -l *openfiler* | awk '{FS=" "; print $9 " " $10 " " $11}')$ U2 Z' E7 z# g* C
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0 -> ../../sdb2 f" M( C1 U: D& O! z
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0 -> ../../sdd- Y2 C: s/ ]  f9 n, }2 Z
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0 -> ../../sdc
6 y0 s+ c; a$ J! |/ f[root@racnode1 ~]# 5 b" H* A5 U$ L& U+ }9 O0 D/ f% n
(cd /dev/disk/by-path; ls -l *openfiler* | awk '{FS=" "; print $9 " " $10 " " $11}')
# e* J. R) i3 d5 p ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0 -> ../../sdb
' X( o1 T" Z* } ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0 -> ../../sdd
! y0 X: D$ N% r: h- W8 U+ H- H6 t ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0 -> ../../sdc* }8 h: Y) a  ]5 V6 r, C% M9 e
我们可以使用上述输出建立以下当前映射:1 z3 V8 B  V3 b' M8 j# c- g
当前 iSCSI 目标名称到本地 SCSI 设备名称映射
7 E6 ^  d8 |0 j( M0 qiSCSI 目标名称 SCSI 设备名称8 ]7 d' O$ o4 u2 a2 _1 q
iqn.2006-01.com.openfiler:racdb.crs1 /dev/sdb  h6 `4 l4 O) h7 C  b) U4 T
iqn.2006-01.com.openfiler:racdb.data1 /dev/sdd
! n& v& f/ O8 a4 T: J3 }* Jiqn.2006-01.com.openfiler:racdb.fra1 /dev/sdc) f) R- w: H# e) ~* s
但是,每次重新启动 Oracle RAC 节点时,此映射可能会发生更改。例如,在重新启动后,可能会确定 iSCSI 目标 iqn.2006-01.com.openfiler:racdb.crs1 映射到本地 SCSI 设备 /dev/sdc。因此,依赖于使用本地 SCSI 设备名称是不切实际的,因为在重新启动后无法预测 iSCSI 目标映射。! e& k! F8 N- r; ~
我们需要的是一个可供引用的一致设备名称(即 /dev/iscsi/crs1),它在重启后始终指向适当的 iSCSI 目标。这就是名为 udev 的动态设备管理工具的用武之地。udev 使用符号链接提供动态设备目录,这些链接使用一系列可配置规则指向实际设备。当 udev 接收到设备事件(例如,客户端登录到 iSCSI 目标)时,它会将其配置的规则与 sysfs 中提供的可用设备属性进行匹配以识别设备。匹配规则可能会提供额外的设备信息或指定设备节点名称和多个符号链接名称,并指示 udev 运行其他程序(例如 SHELL 脚本)作为设备事件处理过程的一部分。+ o6 Y: G% S* @$ k* Z5 w- ^5 p
下一步是创建一个新的规则文件。该文件将被命名为 /etc/udev/rules.d/55-openiscsi.rules 且仅包含一行 name=value 对,用于接收我们感兴趣的事件。它还将定义一个调用 SHELL 脚本 (/etc/udev/scripts/iscsidev.sh) 来处理事件。. g4 e, s8 M6 y' c+ ~. Z: w
在两个 Oracle RAC 节点上创建以下规则文件 /etc/udev/rules.d/55-openiscsi.rules:3 t* t+ T3 Q' f3 O
复制7 b; b, A* A7 K$ |; d
Copied to ClipboardError: Could not Copy
2 L( D( i2 Q9 S4 h$ E..............................................
) d% a" Z" W' w # /etc/udev/rules.d/55-openiscsi.rules
! [3 b0 H* @; H5 | KERNEL=="sd*", BUS=="scsi", PROGRAM="/etc/udev/scripts/iscsidev.sh %b",SYMLINK+="iscsi/%c/part%n"# F: o6 |& N0 S8 }2 @
..............................................6 f5 `0 ^  J; r& p; a
..............................................
: q! A. `: k" k" T+ A4 u5 e # /etc/udev/rules.d/55-openiscsi.rules
9 o) t5 Y0 T$ I4 O" _) f. S KERNEL=="sd*", BUS=="scsi", PROGRAM="/etc/udev/scripts/iscsidev.sh %b",SYMLINK+="iscsi/%c/part%n"! w2 {  ]% M  e8 F
..............................................
7 s2 |: R1 L7 A' b' d1 J! `我们现在需要创建 UNIX SHELL 脚本。当收到此事件时将调用该脚本。让我们首先在两个 Oracle RAC 节点上创建一个单独的目录来存储 udev 脚本:
( E' ~7 [. K- ?3 P& C复制
8 y5 y% y0 e% M: U! J; N' F: YCopied to ClipboardError: Could not Copy; p4 G% k6 q0 ]) e, F# i2 r% f3 B& N$ n
[root@racnode1 ~]# ! Q  g" u* Q  Q
mkdir -p /etc/udev/scripts+ `! _" _0 W! q1 V' \
[root@racnode1 ~]#
9 ~0 s5 c# v, _( h. x2 z mkdir -p /etc/udev/scripts" m  D/ y/ h: {; N$ t7 N2 k  T
接下来,在两个 Oracle RAC 节点上创建 UNIX shell 脚本 /etc/udev/scripts/iscsidev.sh:1 I* \5 _0 D3 c) }3 M) ^/ @7 D
复制: \$ k9 h! \2 ]/ L5 [- U' r
Copied to ClipboardError: Could not Copy
) z* m. v" {% P( M$ p' ~, p..............................................
2 q% m1 Y0 W' T5 m1 f0 f #!/bin/sh
9 N$ Q0 N" q: u8 s! } . Y- q# f6 b* o
# FILE: /etc/udev/scripts/iscsidev.sh
$ D- J$ A) g/ \  l0 W4 Q. {( _
4 D( y8 A) I2 g& \ BUS=${1}
3 L) [1 O; V, y HOST=${BUS%%:*}& G# m0 V0 z/ r( f9 b( h
" O; y; N/ ?: O% E4 J4 a) a, w
-e /sys/class/iscsi_host ] || exit 1
- h* l$ u. [, ~+ w . T  k0 I  a  s* a  Y" X, N
file="/sys/class/iscsi_host/host${HOST}/device/session*/iscsi_session*/targetname"
; V. ^% t3 F& ?) q7 D% z% _
( Z! p  J' G2 d- J8 D target_name=$(cat ${file})
, j7 y# O; f, L/ P " i8 x# u( ]6 Q  `: o4 f' O$ X
# This is not an open-scsi drive% V- g+ s  g# t) \& t
if -z "${target_name}" ]; then
. Z: @* `9 T( A: c; l exit 1% d' t: m- Z' O( Z, P! ]% K7 }
fi* a0 s& M, u6 ?2 e; L* U

& \9 L/ k4 ^+ j2 _( G # Check if QNAP drive
+ K' o5 I/ l0 P check_qnap_target_name=${target_name%%:*}  t3 ~: \. N1 Z( ~6 {7 @
if $check_qnap_target_name = "iqn.2004-04.com.qnap" ]; then
4 D9 I$ T# y2 C target_name=`echo "${target_name%.*}"`
% I8 ^% q$ H, _+ M' ^; ^ fi
, }! K9 x1 y8 t/ i' Q) E 1 A. k+ A6 E" U7 G9 W5 ^% H
echo "${target_name##*.}"$ h( _# F* \" e! t" n2 V4 n
..............................................$ Q: x  c$ }7 }+ m  X5 U; Y
..............................................2 C  C' {: [5 Y' `* h5 x% d
#!/bin/sh
1 ^! T) w/ l1 |. D( \ 1 Q$ z% e! \1 A* v: f
# FILE: /etc/udev/scripts/iscsidev.sh
2 s' S1 y7 w- z$ D
8 T& D5 e' L1 @) J BUS=${1}
' P9 Q& e0 y+ o- o HOST=${BUS%%:*}
. R- Z3 K" n* {+ h) B  C  H $ h$ {; T9 P& X  ]3 _
-e /sys/class/iscsi_host ] || exit 1
, m5 p# |! p" e' _1 ]% l* y * [1 J8 R3 B9 F) l. a" V
file="/sys/class/iscsi_host/host${HOST}/device/session*/iscsi_session*/targetname"; h7 I. S) o  ]- I! c
  V1 W3 s8 s# S% M
target_name=$(cat ${file})
/ r& Y" E9 e& M" W, {
* O: E# s& a; @& v3 p0 W! B # This is not an open-scsi drive
; q* U& U6 [5 ^* M if -z "${target_name}" ]; then! {6 S- f( ^1 y( a. ]" u
exit 13 ?( |; c4 x. R" e
fi
0 z" ^& _$ D& s0 w % o6 o: N2 }; Q, n) s- C8 ~
# Check if QNAP drive
( G! f4 c# u! y! P% `2 e! X* T check_qnap_target_name=${target_name%%:*}
' W( H( y8 a" o9 Q$ F, `  B0 S3 i if $check_qnap_target_name = "iqn.2004-04.com.qnap" ]; then
! n6 P( H; C; ]& t5 N5 f- E5 r target_name=`echo "${target_name%.*}"`
! Z9 i9 S7 W2 m fi2 {/ n) {, s9 A( d
5 e6 |8 W+ z7 n: T+ Q: L- c
echo "${target_name##*.}"3 N/ r3 [6 d2 r+ ~% |
..............................................2 I7 e: a. b9 Z: a
在创建 UNIX SHELL 脚本之后,将其更改为可执行文件:
4 N- [$ o6 ], K复制
8 Q. Y2 H/ _$ F/ WCopied to ClipboardError: Could not Copy
0 T4 S7 Z* `  n) T. e[root@racnode1 ~]#
5 X  {) _7 D8 J( ? chmod 755 /etc/udev/scripts/iscsidev.sh
- G' E) P' G' q[root@racnode1 ~]# ( f: ^8 b7 F4 K' c4 P& N
chmod 755 /etc/udev/scripts/iscsidev.sh: A2 a4 O! O! T+ ?. K
现在已经配置了 udev,接下来在两个 Oracle RAC 节点上重新启动 iSCSI 服务:
9 C* A3 w  s7 u. C( t4 r: X& o复制4 c& c2 x- `, V8 S8 W7 R
Copied to ClipboardError: Could not Copy
, {7 {2 r+ z$ T3 |2 Z% w% d[root@racnode1 ~]#
* k2 b9 x& Q; x& `. }1 {% m service iscsi stop& `8 c, }1 h2 b9 i' ^
Logging out of session [sid: 6, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]9 |8 {0 L% k5 p! |
Logging out of session [sid: 7, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]# w! n  |4 v# V
Logging out of session [sid: 8, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]# K  Y) i" _0 q5 t# P
Logout of [sid: 6, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]: successful
4 q+ O, J5 c/ S. ~5 ]  W4 | Logout of [sid: 7, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]: successful; R: N$ `% V0 q5 A; o
Logout of [sid: 8, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]: successful
+ `% D. Y. P: I; h0 _ Stopping iSCSI daemon:
" y7 X: q* `/ s: Q7 G, l + t! n$ P) V  C: d) j+ E1 g  n/ z
OK ]8 X4 d1 l+ ^  E1 {6 N1 l/ h

; n0 F$ j; B+ p. @4 v( ? [root@racnode1 ~]# + P- O- P% T# [0 K
service iscsi start/ B8 @1 b* H6 v! |# A) E
iscsid dead but pid file exists
- t; ^& k% p, b; E& ^" P Turning off network shutdown. Starting iSCSI daemon:
! w; F; ?2 y. H2 H " d8 t% |7 N% ~$ t9 L- g; f
OK ]- j- b; h+ G* x. k6 {6 u+ F8 X( O

0 ~" e$ O$ K. u2 F " Z1 o* e6 c+ G" l* n3 b* I) J
OK ]
5 g* R! O' @: X' u! E' z) | Setting up iSCSI targets: Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]$ c, W" E+ Z# J- ], _$ y
Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]
( J, E( T9 j5 X8 }+ X& D5 t+ \$ ~$ g Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]
! W/ g6 x( b! l# s  x. O! a$ Z Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]: successful
, p& a9 t" D4 ~3 N! y% X# t8 D Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]: successful
7 h2 V4 D' s& f Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]: successful+ N9 I" c9 k! u) N
- x1 {! q* w, b& n2 I
$ V: c3 C- S/ z9 x2 s
OK ]& }$ ?  ]$ K1 V9 L( x% ~
[root@racnode1 ~]# + e# ?6 x( ~- `
service iscsi stop$ ^3 }/ a. P/ r8 a  O
Logging out of session [sid: 6, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]0 `3 {0 }" t" b8 U6 }3 d
Logging out of session [sid: 7, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]- t! u0 _. R* ]& g
Logging out of session [sid: 8, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]
) v/ r3 ^/ X$ k% v8 p% d7 W* d Logout of [sid: 6, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]: successful+ M  W# u, Q, X9 Z8 T
Logout of [sid: 7, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]: successful
0 I. [1 d4 u& v Logout of [sid: 8, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]: successful
: O: x! Q" ?9 c% ~  V Stopping iSCSI daemon: - }2 H7 `; W3 x7 e

1 q) M6 q) w8 D% l# X7 S OK ]
+ u) f' w  R3 o# _3 }4 d$ A , R0 |7 P  N1 R1 P
[root@racnode1 ~]# ) L' y2 r+ u2 `' C: x; Z
service iscsi start
. s& B' V4 T5 B6 {/ F) p0 p' z9 } iscsid dead but pid file exists
/ N4 Z$ i" k* x; L Turning off network shutdown. Starting iSCSI daemon: , q' ^, `% `/ C
5 [# h% W. K4 [- W, f  k9 p
OK ]
, v5 Q( G0 X+ \5 r1 P# G7 D
9 {# q9 ~0 E% A; w9 Q0 U5 X 9 U6 J* j9 ]. m/ w
OK ]8 d' `0 |" H1 W
Setting up iSCSI targets: Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]/ Z0 I: k, h5 {1 T, @
Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]" L' @6 J( M! G' L3 M
Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]
3 n7 E/ w0 Y3 k' b" f Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]: successful
& ~; I  w' ^9 Y% G) G* e; @ Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]: successful2 O: N! b3 J# z
Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]: successful6 U) Y$ H1 j6 d; r3 V; x% m
5 s) w/ I/ j" [. z

" b: t' Y. _! V: f% u OK ]4 I* z$ U) U) }) i6 s
我们来看看最终的结果:
, u9 c9 z- [) V9 F% f复制
  I' P5 R6 |/ ?$ w) A7 a9 QCopied to ClipboardError: Could not Copy
. l* X5 P" c$ W) \[root@racnode1 ~]# + l& Y$ D3 a# E! u& T+ A
ls -l /dev/iscsi/*
: A% i9 L4 ~" q; }/ s8 Q /dev/iscsi/crs1:
; a6 j# g, S( [' K; a7 _7 | total 0. d' @9 X$ ?. G8 G0 f5 i4 h; M
lrwxrwxrwx 1 root root 9 Nov 3 18:13 part -> ../../sdc+ v+ O# D$ D/ _* w: e  o; ~

$ l  j5 Q% r$ z) r. Y% C! {# @ /dev/iscsi/data1:3 Y% f3 P9 d+ g6 m, a4 H
total 05 ~1 [+ [% H1 ]& I9 |. \) f( y: F
lrwxrwxrwx 1 root root 9 Nov 3 18:13 part -> ../../sde9 w4 K. ~- c! Z7 s* O% o4 ^0 ]

9 x3 m6 R/ C: N# K& {, m9 D, i* n) D /dev/iscsi/fra1:5 {/ i- Y' q- B" X  x5 X) j) B
total 0
! w& L5 r5 N9 ^( p& g9 H% d lrwxrwxrwx 1 root root 9 Nov 3 18:13 part -> ../../sdd6 Z; z8 l# T( f+ Q4 ^
[root@racnode1 ~]#
  v9 s* E# Z! g2 H" L ls -l /dev/iscsi/*
# t2 @! _2 z, R6 d  o4 V /dev/iscsi/crs1:7 s- A, G! Q5 S( U( a( n' j
total 09 [' |2 J! A* O, v  l1 C. [7 x7 n
lrwxrwxrwx 1 root root 9 Nov 3 18:13 part -> ../../sdc: b7 M( a; Q* r
+ Y8 k" v7 E# V/ F0 o; h& h3 Y
/dev/iscsi/data1:- c1 y+ j% d# D6 {5 _4 J( m
total 0
& u& C8 R! ?( Y3 A2 S7 ? lrwxrwxrwx 1 root root 9 Nov 3 18:13 part -> ../../sde
  e) h. x# U7 Y/ }4 @. N/ f! v% P $ }0 d; D1 ?) U# e" S6 \
/dev/iscsi/fra1:
: u  G- o, t& _' P7 a: B* n total 0
3 W; B3 W2 U; u, N( W# D, @ lrwxrwxrwx 1 root root 9 Nov 3 18:13 part -> ../../sdd, L( r! F# o$ p. r
以上清单显示 udev 完成了其应当完成的工作!我们现在拥有了一组一致的本地设备名称,可用于引用 iSCSI 目标。例如,我们可以安全地假定设备名称 /dev/iscsi/crs1/part 将始终引用 iSCSI 目标 iqn.2006-01.com.openfiler:racdb.crs1。我们现在通过一致的 iSCSI 目标名称与本地设备名称相映射,如下表所述:
6 o) Z7 c5 y2 h6 `6 SiSCSI 目标名称到本地设备名称映射
; h& F* a* y+ _8 i# A. riSCSI 目标名称 本地设备名称8 D- N- b  r0 i2 k% A+ X
iqn.2006-01.com.openfiler:racdb.crs1 /dev/iscsi/crs1/part  b8 }- v! B+ `* V! I# f6 L
iqn.2006-01.com.openfiler:racdb.data1 /dev/iscsi/data1/part% a- p/ u2 |2 K! d' p( I
iqn.2006-01.com.openfiler:racdb.fra1 /dev/iscsi/fra1/part
' r+ g# V0 o( @- D8 I  c4 M在 iSCSI 卷上创建分区& M- I7 V4 j5 }# a4 V5 K; [# [: f
我们现在需要在跨整个卷大小的各个 iSCSI 卷上创建一个主分区。如前所述,我将使用自动存储管理 (ASM) 来存储 Oracle Clusterware 所需的共享文件、物理数据库文件(数据/索引文件、联机重做日志文件和控制文件)以及集群数据库的快速恢复区 (FRA)。( W  M$ H& U' S! R" `
Oracle Clusterware 共享文件(OCR 和表决磁盘)将存储在名为 +CRS 的 ASM 磁盘组中,该磁盘组将配置为外部冗余。集群数据库的物理数据库文件将存储在名为 +RACDB_DATA 的 ASM 磁盘组中,该磁盘组也将配置为外部冗余。最后,快速恢复区(RMAN 备份和归档重做日志文件)将存储在名为 +FRA 的第三个 ASM 磁盘组中,该磁盘组也将配置为外部冗余。
3 C5 \* b& {  J+ I( |2 c; c下表列出了将创建的三个 ASM 磁盘组以及它们将包含哪些 iSCSI 卷:
& j% H2 ?1 C" x$ u  |+ p4 j) jOracle 共享驱动器配置
. }, A7 f: e: B) J' _文件类型 ASM 磁盘组名称 iSCSI 目标(短)名称 ASM 冗余 大小 ASMLib 卷名
4 r) |0 G0 B% K0 M+ i; g7 GOCR 和表决磁盘 +CRS crs1 外部 2GB ORCL:CRSVOL1
$ {1 Q, u, \$ P6 \- h0 D1 ~Oracle 数据库文件 +RACDB_DATA data1 外部 32 GB ORCL:DATAVOL1" t* n5 p4 h: ?8 @0 Y; S4 _
Oracle 快速恢复区 +FRA fra1 外部 32 GB ORCL:FRAVOL12 b5 F- w  m% T' N; B! ]
如上表所示,我们需要在每一个 iSCSI 卷上都创建一个 Linux 主分区。fdisk 命令在 Linux 中用于创建(和删除)分区。对于每一个 iSCSI 卷,您都可以在创建主分区时使用默认值,因为默认操作是使用整个磁盘。您可以安全地忽略任何可能表明设备不包含有效 DOS 分区(或 Sun、SGI 或 OSF 磁盘标签)的警告。# C, [3 s3 Q( [, H9 [
在本例中,我将从 racnode1 中运行 fdisk 命令,并使用 udev 在上一节中创建的本地设备名称在每一个 iSCSI 目标上创建单一主分区:; T' d1 D* |( x2 f
/dev/iscsi/crs1/part  w* C' [& w4 F0 i$ X: m  L8 m
/dev/iscsi/data1/part
4 e! X8 \% x, x- ]$ M$ Y/dev/iscsi/fra1/part
  {+ @8 D% A# X8 `注意:在每一个 iSCSI 卷上创建单一分区时,只能从 Oracle RAC 集群中的一个节点运行!(即 racnode1)& e' O4 \2 c  I
复制7 F, [; s% h. a% o7 B5 m+ `
Copied to ClipboardError: Could not Copy
) o7 l; ?: Q4 |# ---------------------------------------2 O  N4 y7 n6 T" Z3 f' l+ i

7 n5 t3 ^/ g$ r. i4 a0 S [root@racnode1 ~]# . z3 J3 F9 _$ e
fdisk /dev/iscsi/crs1/part- m8 D: C, |4 ~% F! L7 b3 \
Command (m for help):
/ x( ?* ?* ^6 R& @- R" Y n
9 ~7 @1 F+ M0 D% D7 | Command action- g& r( y% r5 D, u3 r5 d5 c
e extended4 y* P0 B. N( ]! f0 _
p primary partition (1-4)
( V# \" h7 q! c+ e# [ p0 K8 s# q; ^4 q( c
Partition number (1-4):
8 q0 `5 S+ e2 P+ ?. y 1- \" e% ]2 f* q0 C1 Z" C/ w, K
First cylinder (1-1012, default 1):
, b# \# b3 S: k8 T4 X  K 1
2 v" S' D0 o. e% p2 `4 d% L Last cylinder or +size or +sizeM or +sizeK (1-1012, default 1012): % {0 J2 p2 h/ i# a3 R( o! y
1012+ z% m+ g0 V' M# Z2 o2 d, Y" p

% P  l# p; S1 A Command (m for help):
. Z& s( g" R' }# | p, t  _" y3 S& R
2 r+ w4 [: {, l1 c
Disk /dev/iscsi/crs1/part: 2315 MB, 2315255808 bytes
6 j4 z, k( v7 K/ z! H4 q0 I/ } 72 heads, 62 sectors/track, 1012 cylinders
3 @; u% R: J& M; \& v: {2 [ Units = cylinders of 4464 * 512 = 2285568 bytes
7 a+ f+ m3 F8 @$ {- T6 S$ G # b8 I4 K2 [6 [0 |/ ]
Device Boot Start End Blocks Id System3 w8 `3 [. h' ?3 `9 L
/dev/iscsi/crs1/part1 1 1012 2258753 83 Linux
: n& i( N7 o& @
) m0 J+ |$ }- _& N- F3 k Command (m for help):
, n& e* y3 v8 R; Z! K# n: _7 F6 b w
* I# ^' ?- B3 t The partition table has been altered!, r3 x9 a& K% S0 m1 o0 `# W

$ G7 x; Y  f1 ?) B. B$ m( J Calling ioctl() to re-read partition table.
9 Z. k3 R8 R* z: V/ N  j" y% Q Syncing disks.
" e* h" T9 ~- b0 }
6 |" K$ D) D6 L( d/ i # ---------------------------------------/ [7 v6 C1 P9 y. O" M

& w1 ~! d9 y6 N! J0 M" s* o [root@racnode1 ~]#
; J+ R9 S/ v6 K' f+ _ fdisk /dev/iscsi/data1/part
4 R5 G; A2 m5 B) e* W' v Command (m for help): . z& J; y% V: \/ E
n
* m) k& o( R6 H/ o2 y, H8 h Command action  E" k5 ], j* T3 l6 F# Y
e extended& D) z3 q2 ]5 I" h
p primary partition (1-4), F% w" f+ t& i: o) W0 p  k
p
3 X' f  ^- B" S+ U3 X# ~1 d; i! H Partition number (1-4):
/ n: c' J& |) L0 p" O 1
# N2 U; }- C% y3 t& w. \ First cylinder (1-33888, default 1): 7 l0 }  j) s0 B/ v1 P
1
& w2 L3 L; \( z  p Last cylinder or +size or +sizeM or +sizeK (1-33888, default 33888): . ?7 r6 t3 E6 p7 v# K3 s
33888
, }9 A- y/ m7 d5 U5 K- l' @; k' ?
* d0 h7 c% \2 J7 K3 G7 a: b Command (m for help):
  S$ e" t  k- R- E3 ^- p3 ^  |2 w p( d. w/ O+ Z/ C7 ?4 n& j
# }+ W( Z: }7 K* b- P3 P
Disk /dev/iscsi/data1/part: 35.5 GB, 35534143488 bytes
( H8 D) U0 l+ y. _  T$ W 64 heads, 32 sectors/track, 33888 cylinders+ P8 C: `, Z% g
Units = cylinders of 2048 * 512 = 1048576 bytes
$ _1 o$ }, R! @+ ~
" v" d0 V- o* ]8 z% l  ~' c1 x Device Boot Start End Blocks Id System
4 c' f7 Z/ l! X* K; _( y5 F" B# W /dev/iscsi/data1/part1 1 33888 34701296 83 Linux
  \( d. t* w. H$ E, { 2 G1 ?3 z# e7 r' R
Command (m for help):
' H) _1 J) S  K w
1 ]; o$ J4 [$ V: d The partition table has been altered!
" L3 {0 u$ c6 X1 ` / P/ Q2 q7 U/ B0 Q. Y$ D
Calling ioctl() to re-read partition table.1 h' y  a, m; ^, i
Syncing disks.
. p5 A; f* H1 e0 i' T, F 2 t1 b7 x1 W1 I! n
4 q1 m6 ^* h4 Q9 _7 w7 `
# ---------------------------------------) R( w4 g: y5 j& j3 u

7 o) i0 u, F, o- j4 K0 A8 m [root@racnode1 ~]# * r9 a( p  c% E: z9 W3 c
fdisk /dev/iscsi/fra1/part- a5 g% l: m; _( |  Y
Command (m for help):
; _- o2 ^2 ?% H% I  b+ ~ n
2 F- r7 P$ k" ?! p- h. y Command action: B! G+ e8 k, ~9 V; x# }
e extended4 R' T# }9 R1 e4 `% C  |( b- B2 l
p primary partition (1-4)8 b; V0 {" n7 Z1 I8 U# F& S7 l( P1 ^
p
4 u3 c- d1 t) {" H( x8 S, J Partition number (1-4): % ^5 T3 W# \' z; m+ T
1
' k8 z* x1 }( p First cylinder (1-33888, default 1): " a, |% ^5 T' ^9 i, S1 Z1 Y* q8 s
13 K) ~; n  {3 g. H" g$ p1 b
Last cylinder or +size or +sizeM or +sizeK (1-33888, default 33888):
+ D: ?* F% f$ l) t0 i( V5 C 33888+ v' P* N2 a* b! j0 y

7 ?. B; I3 z/ k4 N Command (m for help): 0 a" G5 ^4 r1 j
p
, [& H$ J$ g/ g# c6 X0 h$ _' |5 b
' y$ T* ~3 v7 l7 m3 y" l2 J Disk /dev/iscsi/fra1/part: 35.5 GB, 35534143488 bytes4 b: ]+ D# S0 q. c' f
64 heads, 32 sectors/track, 33888 cylinders" ]' G# H# f6 A7 ^" [2 ?( J
Units = cylinders of 2048 * 512 = 1048576 bytes
% f" f+ ?% q' Z; e& U  q' S - E% `$ _, _6 X8 r7 k  a
Device Boot Start End Blocks Id System& X+ c5 O' x2 [
/dev/iscsi/fra1/part1 1 33888 34701296 83 Linux& P* H' y6 ~. }! |* ?
( ~$ A+ X. Y8 V
Command (m for help): 7 R" `1 J( Q( Z2 H. ~7 h- `5 h; j8 z; ~. R
w$ q. R6 J+ H$ u# _! s7 W5 A
The partition table has been altered!- _4 p7 h# G5 f- u" O4 T& J

% J* H5 r7 n, n* _* ^9 V Calling ioctl() to re-read partition table.) d# ^- a6 A) S) a' R$ J5 J
Syncing disks.
+ _, l- s1 C  G+ x/ ?7 z3 p7 I# ---------------------------------------
9 d/ [& c+ ~- L9 [, D / O# j( Q' x. j" I( b; ~$ N+ U+ C
[root@racnode1 ~]#
; ~# s% B. u. p  G4 Q1 k fdisk /dev/iscsi/crs1/part% T  B' Y: Z2 w/ |
Command (m for help):   h1 d6 C+ S' @, _0 r3 q1 U; W
n
3 M  p5 F& I4 T Command action% p, r0 f; ^+ e4 s6 L8 J
e extended
8 m- h  y7 n  |9 ]! |" q& N/ G/ T1 G p primary partition (1-4)1 c: @6 Y; [% |) s5 ?
p* o4 `1 j; R8 [0 V: ?7 |3 U9 C, a
Partition number (1-4): + `+ @2 m; V7 Y
1
3 @( n  G7 p' ^0 i  q First cylinder (1-1012, default 1):
- V- |) T, A# e7 X; o 10 V% o6 f  F& B( V6 {* f$ b
Last cylinder or +size or +sizeM or +sizeK (1-1012, default 1012):
% n- b" j) V9 k, K# h# p 10121 i+ g/ I1 h3 J5 Q- l0 c6 o. Z0 R
, M2 I/ I; J) M. |
Command (m for help): 5 c! _" D& v* D) Q9 O
p
- l% V4 G1 f0 v* {1 f7 x! g
% N6 h( @  L) h; X( A7 @ Disk /dev/iscsi/crs1/part: 2315 MB, 2315255808 bytes
* A2 Y9 O5 m8 g1 v. R# F 72 heads, 62 sectors/track, 1012 cylinders
; w; L9 h) E* h/ _% L1 H, [ Units = cylinders of 4464 * 512 = 2285568 bytes
$ R' M/ D+ R; T0 c
6 P. Y4 q! W+ ] Device Boot Start End Blocks Id System& A* Z+ |' n. X3 h7 B. {
/dev/iscsi/crs1/part1 1 1012 2258753 83 Linux
/ \5 S8 O3 r; A, P7 C - R3 y* o9 ^7 e
Command (m for help): ! m" H- P$ L7 Q0 R2 C+ S
w
8 s, u- v. {6 ~+ L+ Q. e The partition table has been altered!- l5 ]7 Z3 H, p. {" a" n8 Z

) }8 _, t% k% [& Z9 d5 K Calling ioctl() to re-read partition table.
) Z0 \% H) M# V+ g% `# ~' C Syncing disks." T' y2 {( q! {) y: N

) h& t6 i: ]4 k, q/ ~/ x1 X # ---------------------------------------
. X. ^2 V! o) R; X
; ^3 _; @  z8 z3 e, u [root@racnode1 ~]#
4 m' A- B, k: ?3 j/ m# U! ? fdisk /dev/iscsi/data1/part5 z" c5 L: z, h) w- S0 |& V
Command (m for help):
  O/ N% e" x7 e- G, z n) V8 c# y% D* ?9 J; Y9 w; @
Command action
# Y1 I6 b6 e2 L# |$ j5 v" u e extended
( [9 x0 k: ?  B! ^7 e* L p primary partition (1-4)
) n! o' B5 S, u8 }5 ] p+ t. N/ ?& g& o7 d' }; t
Partition number (1-4):
, q6 c9 w  j+ \6 T 11 t1 I# s: s+ c
First cylinder (1-33888, default 1): 8 U! i* ]0 K; W. e1 d
1
& D9 j  A0 o9 v4 H! Q; } Last cylinder or +size or +sizeM or +sizeK (1-33888, default 33888):
- V0 p, e1 I2 g1 c- n 33888
% y1 G5 E- e7 W / F: y4 A& |% m
Command (m for help): - Z9 G8 ?/ _5 x" R8 _! p9 X  P
p
! j5 S& q( i; ?5 F" z
, t1 R7 P6 Y+ ~/ ^, r  N! M" L Disk /dev/iscsi/data1/part: 35.5 GB, 35534143488 bytes  Z1 j) t* Q* A6 x) q  B
64 heads, 32 sectors/track, 33888 cylinders6 u. r' [" A, d, a
Units = cylinders of 2048 * 512 = 1048576 bytes
8 n$ C1 {" U* d5 W3 O% w / U0 I  S4 G4 D3 J! a( V* t5 k4 @
Device Boot Start End Blocks Id System# J* |9 X/ U- m+ e; @; z- C$ A
/dev/iscsi/data1/part1 1 33888 34701296 83 Linux- |- D( Y# Z( _4 p1 X' g1 O
# _+ s  |7 |& y2 L: ?8 r
Command (m for help): 8 z( |! C0 D& H7 D$ F) [. I
w  v; w: Q8 e5 U
The partition table has been altered!
: J+ ?" S5 F. }0 B5 f; K 2 {% i5 ^. I$ C- n3 l
Calling ioctl() to re-read partition table.: |2 q' p5 X+ E
Syncing disks.
& P) s' y3 I. p( W& F$ l& B
5 w5 `2 F6 i) c) p
0 I& `! d4 Z: D/ w; Y2 D0 U # ---------------------------------------
( G2 N" c* ~0 y$ c 9 c1 L/ v# s. k. U2 |' I- x5 U9 u
[root@racnode1 ~]# 9 S. ~2 A% }6 s
fdisk /dev/iscsi/fra1/part+ [3 n: |9 p9 N0 _$ t4 m3 M) `0 Y$ ]
Command (m for help):
; H. g9 E* S) S, s  X$ m n$ B# t6 U3 i6 \/ ?
Command action4 g) J1 p. s. [/ m+ \$ {
e extended
) k+ H6 x& s8 m8 O4 U' v p primary partition (1-4)# r' k( v& u  o0 m
p" ]# h' C( o8 l9 F+ P! F
Partition number (1-4):
  |' A" d0 m( c$ l- c 1# x9 s1 o0 I" E! Q$ r, F. M
First cylinder (1-33888, default 1): ; @* l6 C1 p# A" l" _. T7 A% M7 b
1
7 I, d3 z  Q: n6 `; H/ D) x Last cylinder or +size or +sizeM or +sizeK (1-33888, default 33888):
  K) X* E+ H# M- c8 `3 j 33888, z/ d3 x- g$ j/ I' t
- h& \  z# Q7 C
Command (m for help):
! n- _  {  I) ^: E: }5 \- E p
' t6 w& r3 o7 V8 [
+ E' D7 n: s' j. ^ Disk /dev/iscsi/fra1/part: 35.5 GB, 35534143488 bytes3 T0 a* m( u5 x; _0 n
64 heads, 32 sectors/track, 33888 cylinders
+ t% T  M! B2 G, S: Y Units = cylinders of 2048 * 512 = 1048576 bytes1 u; @  p8 a* G8 b; c
* ~3 a4 |$ G4 R6 m
Device Boot Start End Blocks Id System5 u9 g& p+ t' V# J7 m% e
/dev/iscsi/fra1/part1 1 33888 34701296 83 Linux
: R+ q! u) M9 }% ] * P8 k7 j* B$ o' G: P" X
Command (m for help):
( W- N$ X3 h; |- Y4 m, S& o3 f w
# K/ f$ F* o, C8 S) o The partition table has been altered!: s4 A+ ]7 ?1 ]: r% E% A1 i) F
! S! f' Q% E! o# Z: o" q
Calling ioctl() to re-read partition table.
% Y, q. H: O& v# p8 N  T/ T Syncing disks.
; _7 V, ^: g1 l验证新分区3 c3 j, F8 Y; G# M1 w
从 racnode1 创建所有必需的分区后,您现在应当使用以下命令作为 Oracle RAC 集群 (racnode2) 中所有其余节点的“root”用户帐户,以便于向内核通知分区更改。请注意,从 Openfiler 发现的 iSCSI 目标名称与本地 SCSI 设备名称的映射在两个 Oracle RAC 节点上将有所不同。这不是问题,也不会造成任何问题,因为我们不会使用本地 SCSI 设备名称,而是使用 udev 在上一节中创建的本地设备名称。
1 U6 H5 r- _' x5 `  o9 @/ [从 racnode2 中,运行以下命令:
) _* b4 `/ a0 E2 A, ~( T) [复制* z1 R6 a4 s4 T7 ?
Copied to ClipboardError: Could not Copy
% N% X4 w" x# Q, [5 d[root@racnode2 ~]#
" f  I4 Q; b5 ~7 ]$ U3 t partprobe
1 W1 m1 ^! X* G- p. _- G" n0 } ) b2 b4 M6 F5 [# K  F- a
[root@racnode2 ~]#
2 g8 Z3 |' Z3 w4 t fdisk -l
% g1 v+ f" J& z3 E, \( x; ^ ; c  O* p' u8 D  ^/ o- x
Disk /dev/sda: 160.0 GB, 160000000000 bytes
3 @6 K$ f0 ?' D, \6 L  a% ?8 _  M$ f 255 heads, 63 sectors/track, 19452 cylinders0 C# B9 C" @: r& d) H0 h8 w$ U# z7 U  J/ k
Units = cylinders of 16065 * 512 = 8225280 bytes
5 ~( O2 T7 ]& N! j 5 H. Q# R" _; f# }
Device Boot Start End Blocks Id System
; b8 H$ g7 b% K; _& ?4 n1 L /dev/sda1 * 1 13 104391 83 Linux
) _7 ?3 @- E1 \' { /dev/sda2 14 19452 156143767+ 8e Linux LVM
3 l6 d) P; j% n1 { 4 H( k, C: a! @# p# Z! R/ R
Disk /dev/sdb: 35.5 GB, 35534143488 bytes
3 J& S' I; d1 f 64 heads, 32 sectors/track, 33888 cylinders3 ?, @/ K# b( f6 Z5 o
Units = cylinders of 2048 * 512 = 1048576 bytes
" ~4 w4 N5 j% i9 M " \" |2 u  r/ c6 S! }" C6 J
Device Boot Start End Blocks Id System
' v! y/ K1 y4 K9 x$ e /dev/sdb1 1 33888 34701296 83 Linux+ p/ i$ R+ n, y- ~/ j% @
* t! Y' j9 _& _
Disk /dev/sdc: 35.5 GB, 35534143488 bytes
: a1 P3 ^& J: ?  O' D 64 heads, 32 sectors/track, 33888 cylinders
8 Q' k3 U2 ]5 o Units = cylinders of 2048 * 512 = 1048576 bytes
& ~% M) F* b; U" `6 |+ C* `4 E2 G; F1 r
  q5 D: @1 w2 N" B9 l1 a Device Boot Start End Blocks Id System
. r4 Y% h& D0 c: i# B& V$ d /dev/sdc1 1 33888 34701296 83 Linux
# D' ~) E* o, _ 7 v$ z1 D! H5 C4 K  K
Disk /dev/sdd: 2315 MB, 2315255808 bytes
: H: e5 |$ r$ A/ a- f! H 72 heads, 62 sectors/track, 1012 cylinders( B$ C% a; p7 F2 T0 L# d
Units = cylinders of 4464 * 512 = 2285568 bytes/ n' M! X4 g! E0 C! J" M* S

1 |' a( l* Z+ Q Device Boot Start End Blocks Id System- [1 z; z2 H/ ?( h3 H. q- q
/dev/sdd1 1 1012 2258753 83 Linux
* {$ H8 ?) W, T: w' y1 d9 R' P[root@racnode2 ~]#
3 R6 M; g5 {' B, O2 f partprobe' W# w9 F- W1 i1 E5 p% U
2 a- R( d2 Q+ L* `9 C  Y3 H
[root@racnode2 ~]# 4 k! l, N) J5 X1 @# H7 V$ X% A
fdisk -l) R( W( N% d5 [9 h4 m2 Z" C& ?
. f5 q: s8 Z7 y3 S- O) G! k1 ]
Disk /dev/sda: 160.0 GB, 160000000000 bytes
/ u3 j8 D, ?; }. C8 ^4 d) h 255 heads, 63 sectors/track, 19452 cylinders0 q) z7 p+ s, u. n$ h
Units = cylinders of 16065 * 512 = 8225280 bytes
+ [) _. p: E2 K, I1 k 0 n9 N9 p* P+ K* K0 a0 \3 R$ c3 M, w
Device Boot Start End Blocks Id System
$ v9 q6 F$ s' f6 ? /dev/sda1 * 1 13 104391 83 Linux
! z' P! \, s6 r8 H) f8 f /dev/sda2 14 19452 156143767+ 8e Linux LVM7 [; D" ?" H; Q
1 b1 p( G* y/ p5 T/ p
Disk /dev/sdb: 35.5 GB, 35534143488 bytes" g3 y' J  y* P4 A) T2 }
64 heads, 32 sectors/track, 33888 cylinders
" {' A3 I  y# k1 M2 V0 w) j Units = cylinders of 2048 * 512 = 1048576 bytes
; j( \$ B2 `3 d3 \  J& X, v! R
- k# U: F$ B3 r! J( U. U Device Boot Start End Blocks Id System6 H' t+ B$ V; u* Q# M6 ^6 E
/dev/sdb1 1 33888 34701296 83 Linux6 t3 V8 W! k8 `1 K1 M0 n: ^

4 `8 r5 V. U  n7 y( C9 { Disk /dev/sdc: 35.5 GB, 35534143488 bytes% `$ x( ^+ P. x" \0 I& P
64 heads, 32 sectors/track, 33888 cylinders
4 W  m! `; ~4 s. n2 h: W Units = cylinders of 2048 * 512 = 1048576 bytes4 a0 R9 n- h$ \  f) R
4 \5 H' W6 w. M9 q
Device Boot Start End Blocks Id System, t+ f  H5 @, d+ M, i
/dev/sdc1 1 33888 34701296 83 Linux
" L! H+ U5 R3 h6 u7 q8 Q
7 ]& v# u7 W$ i, v7 x( F. u Disk /dev/sdd: 2315 MB, 2315255808 bytes; y4 T1 Q' h; y
72 heads, 62 sectors/track, 1012 cylinders
6 @/ l% s0 s& X4 J" O/ y& F+ w4 h. a Units = cylinders of 4464 * 512 = 2285568 bytes5 I8 \1 f8 f$ }4 _9 ~' ~9 L8 ~

. u1 x- O: L, H3 ?' q/ l/ U* u3 h1 R Device Boot Start End Blocks Id System
, c6 R( m5 K% ]) Z6 A7 a /dev/sdd1 1 1012 2258753 83 Linux
  R: t- U  f+ ?5 M" N最后一步,您应当在两个 Oracle RAC 节点上运行以下命令以验证 udev 是否为每个新分区创建了新的符号链接:
% L( a* ^3 ]  o$ r- y复制( M0 r: S9 O; |" p- N5 ~- M, L
Copied to ClipboardError: Could not Copy
; {+ f' U. j1 }[root@racnode2 ~]# ( }* A; \6 }$ V. j
(cd /dev/disk/by-path; ls -l *openfiler* | awk '{FS=" "; print $9 " " $10 " " $11}')) v' |/ H2 {, I8 j+ B2 G7 f6 {- r
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0 -> ../../sdd
& J( ^9 y7 N: k& E ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0-part1 -> ../../sdd16 `6 K. e9 p0 f7 I* n8 n7 I
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0 -> ../../sdc0 Z/ A7 f/ a. m9 H+ v3 U6 `. R: m
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0-part1 -> ../../sdc1; f  k4 f( t* H, c" O/ d! H
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0 -> ../../sdb
6 i1 f) l/ f, H+ g7 Z4 _ ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0-part1 -> ../../sdb10 I) W& Q; ~2 {+ v3 X+ V
[root@racnode2 ~]# 2 O# c/ a- N) Y& x% ^5 X9 B+ C
(cd /dev/disk/by-path; ls -l *openfiler* | awk '{FS=" "; print $9 " " $10 " " $11}')* J8 w0 b( A, _; Y0 C
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0 -> ../../sdd
; q! L* n- C0 f! b4 ` ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0-part1 -> ../../sdd1& e5 j0 k5 n" I' n( P- S9 w
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0 -> ../../sdc
% k! X; I+ {) C& w0 ] ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0-part1 -> ../../sdc1
% \# a# b- f. f/ @0 ` ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0 -> ../../sdb
: _* |8 q) m0 m5 \3 X3 ?2 X5 r2 w ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0-part1 -> ../../sdb1
, _# E: `1 z. r( ^8 R以上清单显示 udev 确实为每一个新分区创建了新的设备名称。在本指南稍后为 ASMlib 配置卷时,我们将使用这些新设备名称:0 I7 o* Z8 [& Q; j

+ J# N6 I& `; t/dev/iscsi/crs1/part1
( m- z; a$ T% M3 R" |* L$ R" [5 R3 T/dev/iscsi/data1/part1
: X2 Y/ O: Y& b: L/dev/iscsi/fra1/part1: d; l4 q+ D' g; w( y. ?

0

主题

0

回帖

9

积分

管理员

积分
9
QQ
 楼主| 发表于 2021-7-9 17:31:28 | 显示全部楼层
在 Oracle RAC 节点上配置 iSCSI 卷: j3 C+ U, M- V' C' s

在集群中的两个 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)
* j  V" ~  `1 C6 |

配置 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
4 V& D6 }) r. H

在 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 目标上创建一个主分区:

' e. T: Q2 Q, ^6 I
  • /dev/iscsi/data1/part
    * }; B, }$ r9 E- ]5 l/dev/iscsi/fra1/part

# B  {8 n( Y4 @1 \7 s! P

注:要在每个 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 设备名称。

2 {, f2 X! w$ E- q) y6 y5 ~5 X

在 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 配置卷时,将使用这些新的设备名称。

4 o, G, |+ b4 s& s: l* V' `
  • /dev/iscsi/data1/part1
    + I5 l% U9 b. @& O+ H  E/dev/iscsi/fra1/part1

3 f! `# c3 U/ p) p

0

主题

0

回帖

9

积分

管理员

积分
9
QQ
 楼主| 发表于 2021-7-9 17:31:52 | 显示全部楼层
在 Oracle RAC 节点上配置 iSCSI 卷
: I" I5 i, p6 v. V" F2 P在集群中的两个 Oracle RAC 节点上配置 iSCSI 启动器。而创建分区只应在 RAC 集群的一个节点上执行。
; |0 h2 b/ B* s) A; S+ M7 ?iSCSI 客户端可以是提供 iSCSI 支持(驱动程序)的任何系统(Linux、Unix、MS Windows、Apple Mac 等)。在我们的示例中,客户端是两个 Linux 服务器(racnode1 和 racnode2),它们运行的是 Oracle Enterprise Linux 5.4。
( I+ {( E; P  z在本节中,我们将在两个 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。
" B! Y0 X3 I: K8 r& ]iSCSI 软件启动器将配置为自动登录网络存储服务器 (openfiler1),并发现 上一节中创建的 iSCSI 卷。之后,我们将逐步使用 udev 为发现的每个 iSCSI 目标名称创建永久性本地 SCSI 设备名称(即/dev/iscsi/crs1)。拥有一致的本地 SCSI 设备名称及其映射到的 iSCSI 目标,有助于在配置 ASM 时能够区分三个卷。但是,在此之前,我们首先必须安装 iSCSI 启动器软件。
7 X, p$ \( ~+ B注:本指南使用 ,它是 Oracle Database 的自动存储管理 (ASM) 特性的一个支持库。ASMLib 将用于对本指南中所使用的所有 iSCSI 卷进行标记。默认情况下,ASMLib 已为 ASM 使用的存储设备提供了永久性路径和权限。有了该特性后,无需用存储设备路径和权限更新 udev 或 devlabel文件。就本文来说,实际上我仍然选择使用 udev 为发现的每个 SCSI 目标名称创建永久性本地 SCSI 设备名称。这提供了一种自我文档编制的方法,有助于快速确定每个卷的名称和位置。
+ q$ y; q, N7 B  X( K" v2 J安装 iSCSI(启动器)服务
& Q+ X4 z3 G" b' W0 Y7 L' G, l就 Oracle Enterprise Linux 5.4 来说,默认情况下不会安装 Open-iSCSI iSCSI 软件启动器。该软件包含在 1 号 CD 上的 iscsi-initiator-utils 程序包中。要确定该程序包是否已安装(大多数情况下没有安装),在两个 Oracle RAC 节点上执行以下命令:, H2 D/ g& @* R; P7 V5 ~$ n' T) f
[root@racnode1 ~]# rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"| grep iscsi-initiator-utils : [+ v, Q$ n: H+ F
如果 iscsi-initiator-utils 程序包未安装,将 1 号 CD 加载到每个 Oracle RAC 节点中并执行以下命令:
+ q7 E* {. x. Z% }" l[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 & F  }4 X+ X6 ~0 O3 n3 b3 G
确认 iscsi-initiator-utils 程序包现在已安装:
1 l3 P9 C8 P5 D7 O7 ]  P" g0 y7 | [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) 7 |5 D- C: O" p8 `/ n5 Q& }0 z
2 {: U4 p9 j( ^! s2 m2 y# n7 {
配置 iSCSI(启动器)服务
  L& k$ d4 h- [" U5 T验证 iscsi-initiator-utils 程序包已经安装到两个 Oracle RAC 节点之后,启动 iscsid 服务,并使其在系统引导时自动启动。我们还将配置 iscsi 服务在系统启动时自动启动,自动登录到所需的 iSCSI 目标。% [5 u. f: j* V: F
[root@racnode1 ~]# service iscsid start Turning off network shutdown. Starting iSCSI daemon: [ OK ]' P0 f! M4 o$ r6 P" L
                                                     [ OK ]
) E$ X1 c, C* P" P[root@racnode1 ~]# chkconfig iscsid on [root@racnode1 ~]# chkconfig iscsi on ! v1 j6 V% w( `8 l" _2 F4 G3 m
现在 iSCSI 服务已经启动,下面使用 iscsiadm 命令行接口发现网络存储服务器上的所有可用目标。这应该在两个 Oracle RAC 节点上执行,以检验配置是否正常工作:
" m8 _6 E* W" P[root@racnode1 ~]# iscsiadm -m discovery -t sendtargets -p openfiler1-priv 192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.crs1
% T# }5 e& Q& M5 K/ W2 O192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.fra1
7 l/ X7 J' G+ D: D1 f7 q192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.data1 ! V  c' s& E; D+ p4 I+ E* X
手动登录到 iSCSI 目标) R- {* o, w6 r( O+ N
此时,iSCSI 启动器服务已经启动,每个 Oracle RAC 节点都能够从网络存储服务器中发现可用目标。下一步是手动登录每个可用目标,这可以使用 iscsiadm 命令行接口完成。这需要在两个 Oracle RAC 节点上运行。注意,我必须指定网络存储服务器的 IP 地址而非其主机名 (openfiler1-priv) — 我认为必须这么做,因为上述发现使用 IP 地址显示目标。
: S; ?4 d, y- Z; C. L[root@racnode1 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.crs1   p2 Z1 L8 p" \3 i
-p 192.168.2.195 -l [root@racnode1 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.data1 - J/ Y+ T/ D$ |" d
-p 192.168.2.195 -l [root@racnode1 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.fra1
+ Z# }- k3 W( q-p 192.168.2.195 -l ! {6 X; U, k2 g7 d' b
配置自动登录
% X+ p- V2 z- ~% t$ q2 D下一步是确保在计算机引导(或 iSCSI 启动器服务启动/重启)时,客户端将自动登录到上面列出的每个目标。如同上面描述的手动登录过程,在两个 Oracle RAC 节点上执行以下命令:
* L& K, A0 O' n7 Q[root@racnode1 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.crs1   o9 p* z' {) B, |$ V2 o# a7 Z
-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 1 N" B& J! K: D% |# g
-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
$ m( \6 j& m$ f2 Z. _8 r# E% `-p 192.168.2.195 --op update -n node.startup -v automatic / c  Z5 L) d9 b
创建永久性本地 SCSI 设备名称& P1 T' W' Z/ u$ }( u$ w- l6 ]
在本节中,我们将逐步为每个 iSCSI 目标名称创建永久性本地 SCSI 设备名称。我们将使用 udev 来完成该任务。拥有一致的本地 SCSI 设备名称及其映射到的 iSCSI 目标,有助于在配置 ASM 时能够区分三个卷。尽管并未严格要求这么做(因为我们将对所有卷使用 ),这提供了一种自我文档编制的方法,有助于快速确定每个 iSCSI 卷的名称和位置。
4 m0 B  q1 j9 U, K4 Q如果任一 Oracle RAC 节点引导并且 iSCSI 启动器服务启动,它会以一种随机的方式自动登录到配置的每个目标,并将这些目标映射到下一个可用的本地 SCSI 设备名称。例如,目标 iqn.2006-01.com.openfiler:racdb.crs1 可能会映射到 /dev/sdb。实际上,我可以通过查看/dev/disk/by-path 目录来确定所有目标的当前映射:
" A; s. [# }) ^8 x+ J' T[root@racnode1 ~]# (cd /dev/disk/by-path; ls -l *openfiler* | awk '{FS=" "; 1 q5 Z$ q9 ?, v8 V# L
print $9 " " $10 " " $11}') ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0 -> ../../sdb% j- x+ B2 ?5 U$ V8 a
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0 -> ../../sdd
1 V# c( x& b5 k: K9 D! mip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0 -> ../../sdc
; C8 V# X( {) _使用上述 ls 命令的输出结果,我们可以建立以下当前映射:7 L! ~/ E$ W: V' k& q
iSCSI 目标名称到本地 SCSI 设备名称的当前映射% X. a6 N; D6 I* ]" U4 H2 F, s
iSCSI 目标名称 SCSI 设备名称
% e' ?+ R0 p/ c/ U& i* z$ iiqn.2006-01.com.openfiler:racdb.crs1 /dev/sdb- I! x$ B9 s- i1 j
iqn.2006-01.com.openfiler:racdb.data1 /dev/sdd
) z- o; d" k( Xiqn.2006-01.com.openfiler:racdb.fra1 /dev/sdc" f  |& |2 ]* r% F* Q  {& j
但是,每次重新引导 Oracle RAC 节点时,该映射都可能有所不同。例如,重新引导之后,可能会决定将 iSCSI 目标 iqn.2006-01.com.openfiler:racdb.crs1 映射到本地 SCSI 设备 /dev/sdc。由于您无法预测重新引导后的 iSCSI 目标映射,依赖于使用本地 SCSI 设备名称是不现实的。
' ]  N2 l* t8 H; |- u! _4 a我们需要的是可引用的一致的设备名称(即 /dev/iscsi/crs1),该设备名称在重新引导后将始终指向相应的 iSCSI 目标。这就是引入名为 udev 的动态设备管理 工具的原因。 udev 提供了一个动态设备目录,使用一组可配置的规则通过符号链接指向实际设备。当 udev 收到设备事件(例如,客户端登录到 iSCSI 目标)时,就会根据 sysfs 中提供的可用设备属性匹配其配置好的规则以便识别设备。匹配规则可以提供其他设备信息或指定设备节点名和多个符号链接名,并指示 udev 运行其他程序(例如,一个 SHELL 脚本)作为设备事件处理过程的一部分。/ F) s1 f+ |  d, j3 N0 T& P+ D
第一步是创建一个新的规则文件。该文件将命名为 /etc/udev/rules.d/55-openiscsi.rules,并且只包含一行用于接收我们感兴趣事件的名称=值对。它还将定义一个调出 SHELL 脚本 (/etc/udev/scripts/iscsidev.sh),用于处理事件。- O* k$ _+ ~: e! `3 U' H
在两个 Oracle RAC 节点上创建以下规则文件 /etc/udev/rules.d/55-openiscsi.rules:
: ^& K6 ]( f% l  {) i .............................................." Y1 ?) J7 j; A5 K5 e1 ]# s
# /etc/udev/rules.d/55-openiscsi.rules7 ]& [& U- l6 C9 S8 O4 \* Y  h
KERNEL=="sd*", BUS=="scsi", PROGRAM="/etc/udev/scripts/iscsidev.sh %b",8 B" \! ~! S% ~) P8 h
SYMLINK+="iscsi/%c/part%n"
; O9 p, H/ }% ^6 S  q2 @# E..............................................
, Z6 l' d1 ?0 e4 t. d; y$ x现在,我们需要创建在接收该事件时将调用的 UNIX SHELL 脚本。我们首先在两个 Oracle RAC 节点上创建一个单独的目录,用于存储 udev 脚本:
3 i, a$ M# I5 s5 c/ D[root@racnode1 ~]# mkdir -p /etc/udev/scripts 4 n+ n9 ~/ {# \7 ?- `
接下来,在两个 Oracle RAC 节点上创建 UNIX shell 脚本 /etc/udev/scripts/iscsidev.sh:
$ z* `- H/ ^) R  L* ?% n/ y ..............................................
+ H8 n& x6 a- i7 e#!/bin/sh$ q, G: ?) A# Q% k  X
# FILE: /etc/udev/scripts/iscsidev.sh
6 ~/ C4 e& v8 w. ~4 o" K1 |$ o; OBUS=${1}* @, @; ]( Y- c5 j$ U4 ^
HOST=${BUS%%:*}: [2 C& L* W. j" F
[ -e /sys/class/iscsi_host ] || exit 15 T- D7 @5 m% x. k- `
file="/sys/class/iscsi_host/host${HOST}/device/session*/iscsi_session*/4 a8 K( u0 X7 n& f' m
targetname") N* m9 S2 e4 Y5 _* Q
target_name=$(cat ${file})) |6 `! e6 S! m
# This is not an open-scsi drive5 `4 e( z1 ^- T
if [ -z "${target_name}" ]; then
) z" U: S; u* O) A8 u$ S  v   exit 14 x3 m0 |9 C$ P; {8 B$ i7 g* m
fi: F/ s3 ^- P" I- c1 x
# Check if QNAP drive& K+ H5 V) O# n
check_qnap_target_name=${target_name%%:*}
) n! \5 b* ~/ `5 U" i/ u- Nif [ $check_qnap_target_name = "iqn.2004-04.com.qnap" ]; then
9 n4 t# @/ F0 G+ @- l    target_name=`echo "${target_name%.*}"`! Z6 H4 B9 n5 Z  c0 E. l
fi
% G) L4 _. B0 ~4 Z0 Iecho "${target_name##*.}"
% v0 w$ b5 z/ F- k5 O1 \4 }..............................................
+ i1 y8 ?3 c8 N. y; f6 k创建 UNIX SHELL 脚本后,将其更改为可执行文件:6 E% u0 l$ m; @/ ?8 y8 _
[root@racnode1 ~]# chmod 755 /etc/udev/scripts/iscsidev.sh & }$ Z% V' c& s
既然已经配置了 udev,下面将在两个 Oracle RAC 节点上重新启动 iSCSI 服务:
1 I/ a7 K9 B) b, b3 m[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]7 g0 z* ^9 N0 Z/ Q
Logging out of session [sid: 7, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]* R2 u. e& d! r! q% N" S. G
Logging out of session [sid: 8, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]7 m) U# v3 }7 b8 s$ V
Logout of [sid: 6, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]: successful/ `" P: n0 e1 A* P! n
Logout of [sid: 7, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]: successful
4 w* ^0 a% y3 @/ r. z; L# I7 ^6 PLogout of [sid: 8, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]: successful1 T1 Y% K2 Q5 D2 p
Stopping iSCSI daemon:                               [ OK ]
- h8 H5 B- c; o+ E% n[root@racnode1 ~]# service iscsi start iscsid dead but pid file exists
+ V) w7 w8 M& b* a7 X$ T  e# t' g! T8 g+ ~Turning off network shutdown. Starting iSCSI daemon: [ OK ]
' H4 f( O& p+ N                                                     [ OK ]
$ z6 g& J5 C* tSetting up iSCSI targets: Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]
# u6 c6 i2 ]# p; f0 mLogging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]
$ u0 w3 t% G3 \( o5 lLogging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]
" s7 N$ i8 E4 t- c2 e9 N$ XLogin to [iface: default, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]: successful
' q5 `4 @  y1 X! OLogin to [iface: default, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]: successful3 S/ A' f4 h% C
Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]: successful [ OK ] : b$ Y! g( _0 t, a6 v5 C+ U
下面,我们来看一下我们的辛勤工作是否得到了回报:& F; C' w1 [+ e( v
[root@racnode1 ~]# ls -l /dev/iscsi/* /dev/iscsi/crs1:, S' Z& n1 z# n4 l7 E
total 0' |; p  n8 @2 l8 B
lrwxrwxrwx 1 root root 9 Nov  3 18:13 part -> ../../sdc; s' V* l- F5 b$ ?' Y- K
/dev/iscsi/data1:
3 [& n9 g0 k2 A' w5 O4 Ntotal 0
; C7 L% u- S2 Z8 L! C. Qlrwxrwxrwx 1 root root 9 Nov  3 18:13 part -> ../../sde
1 s# H0 H1 b" g7 O0 E4 e9 ~/dev/iscsi/fra1:
$ \& C* O/ \+ C" F+ Ftotal 07 Q1 e  x! P. c8 A  M% C
lrwxrwxrwx 1 root root 9 Nov  3 18:13 part -> ../../sdd . V1 D5 |8 N$ I7 ]/ `5 |
上面的清单显示, udev 所做的工作正是我们所期待的!现在,我们拥有了一组一致的本地设备名称,可用于引用 iSCSI 目标。例如,我们可以安全地认为设备名称 /dev/iscsi/crs1/part 将始终引用 iSCSI 目标 iqn.2006-01.com.openfiler:racdb.crs1。现在,我们拥有了一致的 iSCSI 目标名称到本地设备名称的映射,如下表所示:
% l) z1 `7 k5 M6 N7 Z  h5 kiSCSI 目标名称到本地设备名称的映射/ |3 m1 m3 ^& O/ X) Q
iSCSI 目标名称 本地设备名称. g! d6 @: j2 D( x: O) j
iqn.2006-01.com.openfiler:racdb.crs1 /dev/iscsi/crs1/part2 Z1 @# |/ D& z
iqn.2006-01.com.openfiler:racdb.data1 /dev/iscsi/data1/part
" {% w* w' M2 z, F: _( J3 [: |5 d- riqn.2006-01.com.openfiler:racdb.fra1 /dev/iscsi/fra1/part/ W9 w3 D3 _4 r) g
, g/ p% n$ q3 S! H( ~, q8 k+ E
在 iSCSI 卷上创建分区  t+ Z$ y. x% d! U: g
现在,我们需要在每个 iSCSI 卷上创建一个占用整个卷大小的主分区。正如本文前面提到的,我将使用自动存储管理 (ASM) 存储 Oracle 集群件所需的共享文件、物理数据库文件(数据/索引文件、联机重做日志文件和控制文件),以及集群数据库的快速恢复区 (FRA)。1 v, i# l  Z, b! Z* c& o8 Z: R
Oracle Clusterware 共享文件(OCR 和表决磁盘)将存储在一个名为 +CRS 的使用外部冗余 配置的 ASM 磁盘组中。集群数据库的物理数据库文件将存储在一个名为 +RACDB_DATA 的也使用外部冗余配置的 ASM 磁盘组中。最后,快速恢复区(RMAN 备份和存档重做日志文件)将存储于一个名为 +FRA 的使用外部冗余配置的第三个 ASM 磁盘组中。9 e" Z/ k: g7 R' s& e
下表列出了将要创建的三个 ASM 磁盘组及其将包含的 iSCSI 卷:4 r$ V- l& a2 ^% f  m) D% U
Oracle 共享驱动器配置& L7 D# M! o7 i7 T  |2 A' d- s7 K
文件类型 ASM 磁盘组名称 iSCSI 目标(短)名称 ASM 冗余 大小 ASMLib 卷名
' Z1 X, @' t' w+ Y6 lOCR 和表决磁盘 +CRS crs1 External 2GB ORCL:CRSVOL1% M0 I' n' e$ d7 R
Oracle 数据库文件 +RACDB_DATA data1 External 32GB ORCL:DATAVOL1- E& ]( J% G5 E3 u) ^
Oracle 快速恢复区 +FRA fra1 External 32GB ORCL:FRAVOL1/ B, V/ |, J% S/ ^# b8 e# h
如上表所示,我们需要在每个 iSCSI 卷(共三个)上创建一个 Linux 主分区。 fdisk 命令在 Linux 中用于创建(和删除)分区。对于每个 iSCSI 卷(共三个),您都可以在创建主分区时使用默认值,因为默认操作是使用整个磁盘。您可以放心地忽略任何指示设备未包含有效 DOS 分区(或 Sun、SGI 或 OSF 磁盘标签)的警告。
4 L6 N' ?- l4 ~6 l/ S" ?在本例中,我将在 racnode1 上运行 fdisk 命令,使用中通过 udev 创建的本地设备名称在每个 iSCSI 目标上创建一个主分区:, L" J/ }7 y+ B" Y  a

' z6 t& t; x7 W: v& N2 @/dev/iscsi/crs1/part& y6 {  ~" w/ Y1 N
/dev/iscsi/data1/part- f+ J( w6 {& P  r
/dev/iscsi/fra1/part
, `, j0 Q' {1 _( X
1 e; {- z$ z, ]" e' W) q注:要在每个 iSCSI 卷上创建单个分区,只能从 Oracle RAC 集群中的一个节点上进行!(如racnode1)
. t/ V! L6 X" l6 n* j2 Q& x # ---------------------------------------1 D5 x' L5 |/ T5 H6 o" c3 h& n
[root@racnode1 ~]# fdisk /dev/iscsi/crs1/part Command (m for help): n Command action1 O- j' A& @5 q4 f! _1 D6 Y
   e   extended$ A- c* P+ x; ^9 s. {3 l7 m1 o
   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/ h  |+ E3 d) t# N/ w& g/ V- B1 l; x) ~
72 heads, 62 sectors/track, 1012 cylinders
- s) N. P$ C* D1 Q$ d! B: U! TUnits = cylinders of 4464 * 512 = 2285568 bytes
" X4 O+ x/ b6 w2 _               Device Boot      Start         End      Blocks   Id  System
' f/ ^# \- u" j/dev/iscsi/crs1/part1               1        1012     2258753   83  Linux
# d/ l" w: L8 }( Q3 e( XCommand (m for help): w The partition table has been altered!: D% U  Y2 j. T. e  `( D" v
Calling ioctl() to re-read partition table.
! S% D% h$ T" C, M3 c; MSyncing disks.$ U% d6 c* M8 e
# ---------------------------------------* G  s0 Y' F; \8 q: n
[root@racnode1 ~]# fdisk /dev/iscsi/data1/part Command (m for help): n Command action
8 d# k4 Y  F' p0 c/ H9 Y6 u   e   extended
* M6 t( [/ l) ?( G   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 bytes6 Y' K; j8 A0 w* v+ g1 G1 S8 n
64 heads, 32 sectors/track, 33888 cylinders# e5 T" L3 Q) r/ {! h# q
Units = cylinders of 2048 * 512 = 1048576 bytes
+ h4 r' p; Q+ V                 Device Boot      Start         End      Blocks   Id  System
' R9 O2 x% y( a1 Z/ ?! i9 I. g/dev/iscsi/data1/part1               1       33888    34701296   83  Linux" T" O# f. C1 }% }/ [& W
Command (m for help): w The partition table has been altered!1 h# B3 v2 _: n( w
Calling ioctl() to re-read partition table.2 f5 h2 p# ?, g+ T8 q/ j) G% g0 S
Syncing disks.
( [0 M; k9 f5 [- k' V# ---------------------------------------! r( j4 |, [$ s% n& H
[root@racnode1 ~]# fdisk /dev/iscsi/fra1/part Command (m for help): n Command action1 @& m9 R; l8 @2 o
   e   extended
: M7 Q5 @+ Q. r, ]' E& k   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
$ d$ {) D9 b* O; [% ~4 k: n64 heads, 32 sectors/track, 33888 cylinders
1 o# h) |: }/ i3 q( VUnits = cylinders of 2048 * 512 = 1048576 bytes
" |8 n! @: t/ Z               Device Boot      Start         End      Blocks   Id  System' Q. z% X( G+ K4 c% I
/dev/iscsi/fra1/part1               1       33888    34701296   83  Linux
8 e, I% w0 ~* M( K6 K% cCommand (m for help): w The partition table has been altered!5 B+ C  B5 b( e, y+ U# Q# H) d
Calling ioctl() to re-read partition table.- |' X3 n4 g- k2 S
Syncing disks.
5 d/ M7 z6 y0 {- @: G- p验证新分区+ H# A  [. a4 E5 R% a  S: E
在 racnode1 上创建所有需要的分区之后,现在应使用以下命令以“root”用户帐户从 Oracle RAC 集群的所有其余节点 (racnode2) 将分区更改通知给内核。注意,Openfiler 发现的 iSCSI 目标名称和本地 SCSI 设备名称的映射在两个 Oracle RAC 节点上将有所不同。不用担心,这不会导致任何问题,因为我们将使用 udev 在中创建的本地设备名称而不是其他的本地 SCSI 设备名称。2 E" ~% z7 k* _* K, \; L) r
/ ^+ R- U" X+ i7 p. Z+ Q
在 racnode2 上运行以下命令:6 F8 g2 b* w+ y9 p5 _, }
[root@racnode2 ~]# partprobe [root@racnode2 ~]# fdisk -l Disk /dev/sda: 160.0 GB, 160000000000 bytes
3 b$ e9 a* E8 X; U4 l. I255 heads, 63 sectors/track, 19452 cylinders: L/ Q5 D7 |. C' Y
Units = cylinders of 16065 * 512 = 8225280 bytes
. z& U$ [0 {2 `) k' K9 ?  |   Device Boot      Start         End      Blocks   Id  System; G0 ]; e" a: E, }2 g
/dev/sda1   *           1          13      104391   83  Linux
! ]. ^$ L" E) {/dev/sda2              14       19452   156143767+  8e  Linux LVM; G/ X9 O/ n; c$ }5 w# Q% C* Q5 R
Disk /dev/sdb: 35.5 GB, 35534143488 bytes
! ]! c" I* C5 {: A64 heads, 32 sectors/track, 33888 cylinders
& H& K+ L7 h/ H# T) |( H4 z  pUnits = cylinders of 2048 * 512 = 1048576 bytes
* ~) D0 D3 P/ h- N3 R! ?( T* T   Device Boot      Start         End      Blocks   Id  System7 {" ?% H. c  R( i7 R) `4 b* k
/dev/sdb1               1       33888    34701296   83  Linux' y9 i' \+ ]0 D% |2 Z6 B0 R  y
Disk /dev/sdc: 35.5 GB, 35534143488 bytes2 b3 `( [- P9 y9 V) J% m
64 heads, 32 sectors/track, 33888 cylinders1 t  a9 }0 K9 o3 y' p
Units = cylinders of 2048 * 512 = 1048576 bytes" j, m5 Z) U# y5 U+ E4 F
   Device Boot      Start         End      Blocks   Id  System
) u* z0 J7 A) h& K! h0 ~2 U/dev/sdc1               1       33888    34701296   83  Linux
  H& s; o; F( K# sDisk /dev/sdd: 2315 MB, 2315255808 bytes7 |* n4 K8 E6 R
72 heads, 62 sectors/track, 1012 cylinders/ n3 f, m- O9 |* C+ a
Units = cylinders of 4464 * 512 = 2285568 bytes$ ?2 D/ K1 F: e: S4 K8 I9 {9 q$ w
   Device Boot      Start         End      Blocks   Id  System3 B$ K0 ~& B% g) G. X' A& J
/dev/sdd1               1        1012     2258753   83  Linux
: p0 A& f2 ^0 \, S1 t' H最后,您应该在两个 Oracle RAC 节点上运行以下命令,以验证 udev 为每个新分区创建了新的符号链接:( f5 r- [/ I1 v+ m( S' O5 d* d5 G9 ?
[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 -> ../../sdd4 i8 k6 \, ?" U4 G# X1 ~
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0-part1 -> ../../sdd1
% L- F! F3 B% S$ h; X0 r# D7 e7 P) ^0 lip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0 -> ../../sdc6 l7 b2 x" |+ ^5 A
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0-part1 -> ../../sdc1
9 f* U0 i( J% t5 Y+ I* Bip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0 -> ../../sdb0 k8 @& F: w, V  a6 A' F8 O, ~4 [2 P
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0-part1 -> ../../sdb1 7 S1 f1 f: {4 K
上面的清单显示, udev 确实为每个新分区创建了新的设备名称。在,当我们为 ASMlib 配置卷时,将使用这些新的设备名称。
# S' M6 a" Z' }" U  C
) X" S0 n$ z* X) j/dev/iscsi/crs1/part1* O: G% S; s4 S
/dev/iscsi/data1/part16 n6 l: Q9 g# A0 `9 @) z8 ^8 w
/dev/iscsi/fra1/part1
% P& d) s" S* M* r1 o# r0 o) I! Q, m1 B
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-11 22:59 , Processed in 0.033620 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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