|
|
楼主 |
发表于 2021-7-9 17:25:52
|
显示全部楼层
12.在 Oracle RAC 节点上配置 iSCSI 卷
0 u. d8 y& d, Q6 `& E在集群中的两个 Oracle RAC 节点上配置 iSCSI 启动器。但是,应当仅在 RAC 集群中的节点之一上执行创建分区的操作。9 J/ K7 X4 n+ K
iSCSI 客户端可以是任何提供 iSCSI 支持(驱动程序)的系统(Linux、Unix、MS Windows、Apple Mac 等)。在本例中,客户端是两个 Linux 服务器,即 racnode1 和 racnode2,运行 Oracle Enterprise Linux 5.4。
/ i# L5 [3 C2 h' {/ o8 I在本节中,我们将在两个 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。/ ]" g) {/ \8 D& z9 e
iSCSI 软件启动器将被配置为自动登录至网络存储服务器 (openfiler1) 并发现上一节中创建的 iSCSI 卷。随后,我们将使用 udev 为所发现的每一个 iSCSI 目标名称创建持久本地 SCSI 设备名称(即 /dev/iscsi/crs1)。拥有一致的本地 SCSI 设备名称和所映射到的 iSCSI 目标,有助于在配置 ASM 时区分三个不同的卷。但是,在此之前,我们需要先安装 iSCSI 启动器软件。3 @+ T8 d! T* _) U. J8 V8 y
注意: 本指南使用 ASMLib 2.0,它是 Oracle 数据库的自动存储管理 (ASM) 特性的支持库。ASMLib 将用于标记本指南中使用的所有 iSCSI 卷。默认情况下,ASMLib 已经为与 ASM 一起使用的存储设备提供了持久路径和权限。此功能消除了使用存储设备路径和权限更新 udev 或 devlabel 文件的需要。在本文和实践中,我仍然选择为使用 udev 发现的每一个 iSCSI 目标名称创建持久本地 SCSI 设备名称。这提供了一种自我归档方法,有助于快速识别每一个卷的名称和位置。
. g: L4 v, t/ I& I安装 iSCSI(启动器)服务
8 K& J# d. U8 T/ b7 d+ s) s0 B对于 Oracle Enterprise Linux 5.4,默认情况下不会安装 Open-iSCSI iSCSI 软件启动器。该软件包含在 iscsi-initiator-utils 软件包中,可从 CD #1 中找到该软件包。要确定是否安装了此软件包(大多数情况下未安装),请在两个 Oracle RAC 节点上执行以下操作:& }( M8 N/ g3 [! C2 M8 A
复制% u2 z+ v, k" g
Copied to ClipboardError: Could not Copy
& K( O- v! {- O' k: c2 T[root@racnode1 ~]#
2 ?. I& w0 l# a rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"| grep iscsi-initiator-utils9 B/ n! Y0 ]$ j' ?' n
[root@racnode1 ~]#
% q/ b0 V, n2 H* T8 |/ { rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"| grep iscsi-initiator-utils6 O' y1 S4 E7 x9 |# b. u, d) w
如果未安装 iscsi-initiator-utils 软件包,则将 CD #1 加载到每一个 Oracle RAC 节点中,然后执行以下操作:. C6 n" N# P* X4 L. ]
复制1 n- I) ?1 d3 |+ I; w
Copied to ClipboardError: Could not Copy
+ r" Y3 q+ A* w[root@racnode1 ~]#
% d; ^$ L1 C4 N/ K& S& G+ u mount -r /dev/cdrom /media/cdrom% L1 a' I7 S3 ]- Y3 }( W9 g
[root@racnode1 ~]# L; T( G/ i9 [- b) _4 l b/ w
cd /media/cdrom/Server9 j* T7 \' ]# x, w# {3 W
[root@racnode1 ~]#
9 o" T3 _/ z5 C) a) P C# q9 D E rpm -Uvh iscsi-initiator-utils-*
: ^' x- W1 Z/ T) Y [root@racnode1 ~]# . T) C5 p \$ v) z
cd /8 C; ?+ C: p' V9 Z
[root@racnode1 ~]#
' j, a+ U$ X4 [4 v( w5 U eject) ~# |; j: e/ v
[root@racnode1 ~]#
7 z" G4 n% z* h, } mount -r /dev/cdrom /media/cdrom5 T: O$ P: Y5 ~8 l6 A
[root@racnode1 ~]#
& ^) P" L3 a8 H& V& F0 k' L) O cd /media/cdrom/Server7 a8 K2 Z1 U8 G+ w' X- a6 E
[root@racnode1 ~]# ' J: j1 a* b- e# [% |( D: O
rpm -Uvh iscsi-initiator-utils-*3 K0 V/ u0 p% c- l/ s) X: x8 e
[root@racnode1 ~]#
9 _4 p+ J9 O) s3 A" L$ r cd /
% b) I* m h1 y [root@racnode1 ~]#
* K2 i8 f7 |/ V3 K0 a5 i: T, A1 C: i eject* _3 D! n; n4 ]# j- M, `
验证现已安装 iscsi-initiator-utils 软件包:6 ]2 W# ~2 K& {& `" J
复制
7 v. d/ U) L: ~- cCopied to ClipboardError: Could not Copy
% S3 Y' Z, g1 Q# |2 r5 h[root@racnode1 ~]#
% w- l9 P& t2 [- u% x9 {* q/ Z* V rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"| grep iscsi-initiator-utils1 I9 B6 j0 ]; V
iscsi-initiator-utils-6.2.0.871-0.10.el5 (x86_64)+ l# u8 |3 k5 |' e8 a- f
[root@racnode1 ~]#
4 D2 ~5 z5 [2 o& @2 c, M9 u rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"| grep iscsi-initiator-utils
$ Y4 E5 p: H( e5 | iscsi-initiator-utils-6.2.0.871-0.10.el5 (x86_64)
5 ?" C, n2 b) w( a$ i/ `( {配置 iSCSI(启动器)服务/ \* Q- d, X; i3 a/ y- z( ?% I
验证两个 Oracle RAC 节点上均安装了 iscsi-initiator-utils 软件包之后,启动 iscsid 服务并设置其在系统启动时自动启动。我们还将配置 iSCSI 服务自动启动,以便于在系统启动时登录到所需 iSCSI 目标。; L4 r! O3 l, s$ `
复制' r7 A0 O' j5 r/ l% g
Copied to ClipboardError: Could not Copy
9 X# ^/ h* ^% U) v) M( V9 V[root@racnode1 ~]# % y5 Q+ Q$ ~- J
service iscsid start/ E f* O- V9 G8 [- N. \
Turning off network shutdown. Starting iSCSI daemon:
4 ^, _; x F" }; J% `' h 3 f% M5 N# d4 `
OK ]
6 X$ p# L t* U% y ; u% s* S# x+ X2 K: W
+ B9 y2 K7 C% v9 f7 y3 [' U, Y5 f; O/ D
OK ]
& _- u K7 Y4 p
$ G7 l+ U6 x* r7 _ [root@racnode1 ~]# & x+ I% e" l$ W& I' {7 G& A. u
chkconfig iscsid on
6 Y& V% P5 Q( B4 B5 ` [root@racnode1 ~]# % T$ Z9 [2 t9 L$ K5 o
chkconfig iscsi on: x0 f2 x5 }: K' j7 z% G
[root@racnode1 ~]# 5 P4 k$ a+ ^8 o, M: \
service iscsid start
! e- ~( g% T4 }# [. F" a Turning off network shutdown. Starting iSCSI daemon:
5 v; U2 X8 A# t+ R, S
1 H% z' r0 |! U M L( H OK ]
; T" z- O6 J0 I2 _2 q
7 ?( y; ?% {* w5 ` D
; N" G; ^4 \* R0 {- ^ OK ]
2 G- Y `" v+ j& ^9 P' n5 ~# }4 { % e* u Z7 s# T _6 d. u/ t/ \
[root@racnode1 ~]#
6 {3 g0 p# v5 ^) ~ chkconfig iscsid on
, ~: T& V1 p9 |& n1 [: H1 o- l" t [root@racnode1 ~]# $ }$ n/ W1 t" v* B5 S
chkconfig iscsi on( T; O/ x: ~: a2 x2 }
现在 iSCSI 服务已启动,请使用 iscsiadm 命令行界面来发现网络存储服务器上的所有可用目标。这应当在两个 Oracle RAC 节点上执行,以验证配置是否正常运行:
0 p: l) t* [/ x) R# h {! O( A复制
# |3 r4 I; ]6 \6 K5 LCopied to ClipboardError: Could not Copy
7 h( B1 f* B) W+ V3 k X[root@racnode1 ~]#
3 L% B+ s# q' c4 m7 t: b, u* K iscsiadm -m discovery -t sendtargets -p openfiler1-priv% B" J9 a" Q1 Y- ^ T- E
192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.crs16 n d( }2 ~* Z) P
192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.fra1% O8 N* }( B8 h
192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.data1* @$ o: J- x: D+ ~0 u
[root@racnode1 ~]#
d, l% }: g$ H iscsiadm -m discovery -t sendtargets -p openfiler1-priv
) ^/ {" r4 N* E8 E0 ? 192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.crs1
! u# V& W' y- W! q2 z( @' l 192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.fra1" e. o. O. n1 a( X5 V9 t0 u
192.168.2.195:3260,1 iqn.2006-01.com.openfiler:racdb.data1! j% c8 |- c( K# P8 T5 P
手动登录至 iSCSI 目标+ k( Z) S5 d& ^4 ~% D' i
至此,iSCSI 启动器服务已启动,每一个 Oracle RAC 节点都可以从网络存储服务器中发现可用目标。下一步是手动登录至每一个可用目标,可以使用 iscsiadm 命令行界面来执行此操作。两个 Oracle RAC 节点上都需要运行此任务。请注意,我需要指定 IP 地址,而不是网络存储服务器的主机名 (openfiler1-priv) - 我认为这是必需的,因为(上述)发现显示了使用 IP 地址的目标。
5 T( z/ T% v- @* n" U# ?复制: f2 v1 ~ S. B$ L% {
Copied to ClipboardError: Could not Copy( }6 C- j/ W* b+ q4 t/ @6 Y2 k
[root@racnode1 ~]# [" ?7 P- G' g$ R+ @% r2 z
iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.crs1 -p 192.168.2.195 -l
- A/ F/ b% N# t [root@racnode1 ~]# & K2 p6 P- L9 a" H1 A9 J" Y: _
iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.data1 -p 192.168.2.195 -l
! m1 `, a% X) H& O, w3 N6 W [root@racnode1 ~]# $ ?9 u# @! b+ M8 Y4 U. i
iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.fra1 -p 192.168.2.195 -l
T8 T3 | Y9 a+ t$ W3 i, H* G[root@racnode1 ~]#
, ^# a/ o! k; m/ R' u iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.crs1 -p 192.168.2.195 -l; u: B( _1 x6 j" s( R
[root@racnode1 ~]#
4 z7 E3 Q( o5 u( a/ ^$ z' Q$ r iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.data1 -p 192.168.2.195 -l
5 m; P: g& c. w [root@racnode1 ~]#
" A. K# G4 ~: v$ d Z C6 Z8 B iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.fra1 -p 192.168.2.195 -l8 Q* N( x/ K' |: D: b! k: i2 m4 D6 h
配置自动登录; |4 O2 \, B( G4 ?
下一步是确保客户端将在机器启动时(或 iSCSI 启动器服务启动/重新启动时)自动登录到上述每一个目标。与上述手动登录过程一样,在两个 Oracle RAC 节点上执行以下操作:/ L7 m$ j% L r2 C9 E
复制$ w0 T8 u) {7 k5 S* m8 @
Copied to ClipboardError: Could not Copy
) I# w0 \3 c. c6 b: S4 f[root@racnode1 ~]# % |8 C* i2 M; f
iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.crs1 -p 192.168.2.195 --op update -n node.startup -v automatic+ g) E1 P4 [7 X! K* @4 z! l
[root@racnode1 ~]# 6 \9 C+ b( _2 U9 B+ S
iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.data1 -p 192.168.2.195 --op update -n node.startup -v automatic1 @0 P+ `+ ^$ R; ]9 n( f+ W+ A& [$ w
[root@racnode1 ~]#
7 T) F9 |4 X5 j% ^+ ` iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.fra1 -p 192.168.2.195 --op update -n node.startup -v automatic
8 E8 n. u" x! L7 }" {! I1 b6 }1 g[root@racnode1 ~]# ' P+ x+ _' ]4 p0 F% D' ]
iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.crs1 -p 192.168.2.195 --op update -n node.startup -v automatic
# S E4 r: [$ h% R" o1 M: ^ [root@racnode1 ~]#
9 _8 |$ S8 l( m* q+ w9 q+ n iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.data1 -p 192.168.2.195 --op update -n node.startup -v automatic1 u8 z0 `& o! M9 P1 X# `0 t( d$ g" X$ X
[root@racnode1 ~]# 8 |8 u$ t! z6 g8 v: N: ?' e6 F
iscsiadm -m node -T iqn.2006-01.com.openfiler:racdb.fra1 -p 192.168.2.195 --op update -n node.startup -v automatic
/ D: Z+ c- k! z' |创建持久本地 SCSI 设备名称. ?# A( _) P7 a, E( E4 b
在本节中,我们将为每一个 iSCSI 目标名称创建持久本地 SCSI 设备名称。这将使用 udev 来完成。拥有一致的本地 SCSI 设备名称和所映射到的 iSCSI 目标,有助于在配置 ASM 时区分三个不同的卷。这并不是一项严格的需求,因为我们将为所有卷使用 ASMLib 2.0,而这提供了一种自我归档方法来快速识别每一个 iSCSI 卷的名称和位置。. c+ ]* F- ^8 `% k/ T
当任何一个 Oracle RAC 节点启动以及 iSCSI 启动器服务启动时,它将自动登录到以随机方式配置的每一个目标,并将其映射至下一个可用的本地 SCSI 设备名称。例如,目标 iqn.2006-01.com.openfiler:racdb.crs1 可能会映射到 /dev/sdb。我实际上可以通过查看 /dev/disk/by-path 目录来确定所有目标的当前映射:5 k. D+ M2 X, H
复制
! ^# w: X- K9 ^3 m: V4 f$ g, aCopied to ClipboardError: Could not Copy
* ^' H4 X; j" T/ B[root@racnode1 ~]#
8 c4 u: m- e8 ], \/ g (cd /dev/disk/by-path; ls -l *openfiler* | awk '{FS=" "; print $9 " " $10 " " $11}')! x* ]" X& e* |
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0 -> ../../sdb" a# P7 T6 x* z* ^& F" h& e
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0 -> ../../sdd; l) l$ I) l( Y4 {2 C
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0 -> ../../sdc1 y( n8 H; n- F! W; y8 p$ p+ m
[root@racnode1 ~]#
- N! c$ N- L! `! Y2 [/ _( {, V (cd /dev/disk/by-path; ls -l *openfiler* | awk '{FS=" "; print $9 " " $10 " " $11}')
8 [# c. W9 c" b3 \+ s ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0 -> ../../sdb
; K' ^* w8 v' R& ? ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0 -> ../../sdd
, {- v, P h- l& ?) ?! k ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0 -> ../../sdc, |. h7 U3 i2 B x% G0 n: E
我们可以使用上述输出建立以下当前映射:
" \2 ?' D# c0 ~. D% |1 z; J) x当前 iSCSI 目标名称到本地 SCSI 设备名称映射* p5 L: m4 m6 e9 m0 C* C
iSCSI 目标名称 SCSI 设备名称
& H5 t7 Y* b1 }5 Ziqn.2006-01.com.openfiler:racdb.crs1 /dev/sdb
4 j. T; B/ D7 }9 S1 Ciqn.2006-01.com.openfiler:racdb.data1 /dev/sdd
" O' d$ d3 j* Y$ @9 T2 Riqn.2006-01.com.openfiler:racdb.fra1 /dev/sdc
) N& Z. i- u" _* R. r: B3 j但是,每次重新启动 Oracle RAC 节点时,此映射可能会发生更改。例如,在重新启动后,可能会确定 iSCSI 目标 iqn.2006-01.com.openfiler:racdb.crs1 映射到本地 SCSI 设备 /dev/sdc。因此,依赖于使用本地 SCSI 设备名称是不切实际的,因为在重新启动后无法预测 iSCSI 目标映射。9 E+ I6 m, x4 \# p: p
我们需要的是一个可供引用的一致设备名称(即 /dev/iscsi/crs1),它在重启后始终指向适当的 iSCSI 目标。这就是名为 udev 的动态设备管理工具的用武之地。udev 使用符号链接提供动态设备目录,这些链接使用一系列可配置规则指向实际设备。当 udev 接收到设备事件(例如,客户端登录到 iSCSI 目标)时,它会将其配置的规则与 sysfs 中提供的可用设备属性进行匹配以识别设备。匹配规则可能会提供额外的设备信息或指定设备节点名称和多个符号链接名称,并指示 udev 运行其他程序(例如 SHELL 脚本)作为设备事件处理过程的一部分。/ H. @1 a4 N/ c6 u# A+ e: a3 r
下一步是创建一个新的规则文件。该文件将被命名为 /etc/udev/rules.d/55-openiscsi.rules 且仅包含一行 name=value 对,用于接收我们感兴趣的事件。它还将定义一个调用 SHELL 脚本 (/etc/udev/scripts/iscsidev.sh) 来处理事件。
, M4 t, [; o$ ?( G1 c在两个 Oracle RAC 节点上创建以下规则文件 /etc/udev/rules.d/55-openiscsi.rules:
8 K# M: X2 B0 ^8 t( u. u2 L复制
3 h+ f5 l* _# ~) H2 f; {/ i0 i2 g/ kCopied to ClipboardError: Could not Copy
3 N+ J! n( {, {& }3 x1 [: j% Q..............................................
$ K( a I5 {/ ?5 n8 t # /etc/udev/rules.d/55-openiscsi.rules
) {# O$ r4 k8 D5 r7 w+ } KERNEL=="sd*", BUS=="scsi", PROGRAM="/etc/udev/scripts/iscsidev.sh %b",SYMLINK+="iscsi/%c/part%n"- h7 {" o6 Y9 F$ r4 C
..............................................
; v% q" ]: K' Z, |: K0 h4 _..............................................( U: ]7 @) @7 p: Q( O- q
# /etc/udev/rules.d/55-openiscsi.rules3 D6 q" U, Z* |, A# u# ^
KERNEL=="sd*", BUS=="scsi", PROGRAM="/etc/udev/scripts/iscsidev.sh %b",SYMLINK+="iscsi/%c/part%n"
; A4 r' [, X. o5 E& U" P k ..............................................& _: ^# A7 i( C
我们现在需要创建 UNIX SHELL 脚本。当收到此事件时将调用该脚本。让我们首先在两个 Oracle RAC 节点上创建一个单独的目录来存储 udev 脚本:1 g; `% i: s' Y: R% Y4 d
复制$ K2 l# N2 `: D! }/ I) F
Copied to ClipboardError: Could not Copy
) S6 ~8 R* c) ] j& u. j[root@racnode1 ~]#
* W/ n5 G/ k, Q( ~ mkdir -p /etc/udev/scripts
0 q: I1 ? i' R[root@racnode1 ~]#
# U2 s' |; m6 D1 F9 ]: J, u( K0 a mkdir -p /etc/udev/scripts% J& \- a. V4 ]1 K8 p
接下来,在两个 Oracle RAC 节点上创建 UNIX shell 脚本 /etc/udev/scripts/iscsidev.sh:) _0 E3 Q4 e! L3 y
复制5 P8 h2 ^ n# m5 M* I( `
Copied to ClipboardError: Could not Copy
+ F5 I# Y- U! v9 ]..............................................6 n# a5 R& Y% C. G% z( `
#!/bin/sh" D5 U5 u7 b& N
7 h; _* u) r. f8 D, o( r
# FILE: /etc/udev/scripts/iscsidev.sh
^# S3 j8 H0 _5 h8 i( X
P" B0 U9 j1 Q- U4 C BUS=${1}
! f$ P) c8 Q6 X/ P7 `' a3 f+ o HOST=${BUS%%:*}
0 W0 s% n' C. `5 U
# ]/ |/ v9 }' a9 G& O: C2 g' C: ? -e /sys/class/iscsi_host ] || exit 1
" H1 {7 f4 s' o Q% u) R9 A9 ^7 H
( M* w' O6 E0 Y; b3 s file="/sys/class/iscsi_host/host${HOST}/device/session*/iscsi_session*/targetname"
" Z L' r7 }! B3 U . t1 s' F, b: |
target_name=$(cat ${file})3 R6 X3 p& t( K' Z' ]
5 k; L1 {* j5 G: L* a7 Q
# This is not an open-scsi drive
8 B# d6 |. @8 M7 m1 A) c if -z "${target_name}" ]; then z# M4 d2 M9 K6 ^5 g( Z% i
exit 1
1 E% t, z x7 [8 J& N* o fi
! @$ Y" S! w# h! u- d) m ; s. e4 x: c, H* I4 ?
# Check if QNAP drive
* D+ F' H) F: d0 e( J1 f, S check_qnap_target_name=${target_name%%:*}
& x% G1 A+ s$ X5 c) o: U, d if $check_qnap_target_name = "iqn.2004-04.com.qnap" ]; then
& z4 R' H+ |" K+ M6 C' T" u m5 J target_name=`echo "${target_name%.*}"`
% X- g) _6 `9 N5 C8 Q fi
/ x# r4 U; l. O& P6 Q
. C6 A1 y" }4 |/ g% t O echo "${target_name##*.}"7 n# \7 Y/ U5 [5 P- I0 `4 R
..............................................* O& A! D R: X8 r- [
..............................................
1 u. K7 b. q5 k; G8 d #!/bin/sh/ p+ w8 \! s$ L2 U# T
5 O- |9 y" H. Z # FILE: /etc/udev/scripts/iscsidev.sh" z; \! i* y5 j7 d# t
* ]7 s2 ^! |/ b- W! o BUS=${1}5 q/ d1 Q/ w6 T
HOST=${BUS%%:*}/ M5 {- r a4 j$ H2 D7 }- L8 x
* O! G' W: K1 g -e /sys/class/iscsi_host ] || exit 1
4 n) U3 e# _% g! U& ]% o' c
! o# F8 I1 @& q% V7 v file="/sys/class/iscsi_host/host${HOST}/device/session*/iscsi_session*/targetname"
1 {; h! f3 z$ c+ b* j$ B# G: E: P: L ( u# m/ R& o& h" k$ m- W8 {8 R
target_name=$(cat ${file})
- }" B5 D& H6 V' I- L
7 K! Z( A8 t$ o( W* t # This is not an open-scsi drive) W& w: I) n# ^- u
if -z "${target_name}" ]; then
+ Q/ ?! g7 o: g) k exit 1
( F; I$ y9 D9 w; S5 k fi5 i H/ F( _0 z2 @9 D/ ]
/ N( c# I- N) x # Check if QNAP drive
" q# R! O: K- I7 Q& `( T3 B check_qnap_target_name=${target_name%%:*}
9 }8 r: ?: r" P) `: {6 A* X9 a: W if $check_qnap_target_name = "iqn.2004-04.com.qnap" ]; then
( O( q1 ~6 G1 O target_name=`echo "${target_name%.*}"`
; H5 x; F* U& @% U" a7 c ^ fi; x v+ }4 ~& u
H0 j g# G3 _7 a g echo "${target_name##*.}"
) j6 Y! ]) z( N3 Z ..............................................
# o. C2 P# T$ ~! B* J6 ]在创建 UNIX SHELL 脚本之后,将其更改为可执行文件:& L/ I# k5 y: f% W& n
复制
1 A# L6 ?8 {3 `- z5 U! ^! mCopied to ClipboardError: Could not Copy
1 J, K3 T. M% U# S" T4 h[root@racnode1 ~]# + @0 E" c& \5 x& a9 z
chmod 755 /etc/udev/scripts/iscsidev.sh
4 y$ V, o# G" d& `[root@racnode1 ~]#
B9 i) q2 ]* d9 g5 y$ u chmod 755 /etc/udev/scripts/iscsidev.sh
; J% S; I+ ^) [4 U+ O& b现在已经配置了 udev,接下来在两个 Oracle RAC 节点上重新启动 iSCSI 服务:
" i. f- p; f7 K# N8 d# A5 a7 q4 q复制3 N1 W/ p- o. {
Copied to ClipboardError: Could not Copy
% a0 _7 R3 e9 _# t[root@racnode1 ~]#
2 _9 C$ A; \9 O* l% r service iscsi stop9 @" W; p2 j7 `. v5 a' c
Logging out of session [sid: 6, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]1 Z1 ]! _! p3 e' V: ?
Logging out of session [sid: 7, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]9 }7 X' ]2 H ^, |; @5 X. J) S) w
Logging out of session [sid: 8, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]* l9 u3 U% d; W5 Y6 @, d4 L
Logout of [sid: 6, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]: successful
0 F+ x. N) [; \: R; X Logout of [sid: 7, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]: successful/ L) u5 l6 g2 ~
Logout of [sid: 8, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]: successful: s. o' M9 e; E/ [4 Y' A9 b/ x
Stopping iSCSI daemon:
r& P( V7 |8 w1 j9 h/ S# s ( ?, ~1 F$ l' l6 \
OK ]. q+ q) W; C; m1 z: y( U2 e
+ q( e: c2 N( Y/ S [root@racnode1 ~]# ) r2 _* c8 ]6 c' t6 U
service iscsi start
5 C5 e7 V: Q# N3 D* \+ d/ U iscsid dead but pid file exists* ]$ a, l1 _; f6 z/ l
Turning off network shutdown. Starting iSCSI daemon: * ^. y8 I; r% q6 F+ P% K. h
+ _( ~7 m# q) X+ u
OK ]
5 ~7 I* r$ @1 U* A
- {9 [+ c/ L2 A, z" s% U4 M/ j ' Q0 K2 M2 ~8 s
OK ]
+ o; f+ ~8 h5 L) d% ? Setting up iSCSI targets: Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]
A; ^7 j1 X/ N! I- f Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]
2 z+ ^" n" W/ O0 e: w B2 i Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]
# X" m# _* ~/ z" W: n' `& S Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]: successful
. s* \) @7 v* d7 l0 X Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]: successful2 u0 D% `( j2 v: @* p
Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]: successful5 }: j" X, p# t% {4 @ y
8 T) K5 m# m2 p0 U9 a7 Q! H4 @" E , ]: B$ I2 Z6 ?% N1 z
OK ]! J" B! ^2 a+ ^% H- b
[root@racnode1 ~]# $ c% l' u! s( \6 H
service iscsi stop: V" C, v; H7 F5 ~0 S
Logging out of session [sid: 6, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]
4 T' ^% p- `# a2 A1 I3 a, n Logging out of session [sid: 7, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]& r5 u' j- \% p5 L0 L* q6 t9 C
Logging out of session [sid: 8, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]
; y6 x, Y( B& B. A Logout of [sid: 6, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]: successful
- L7 o) X! a+ X" n5 k Logout of [sid: 7, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]: successful2 a" G6 p2 @, L5 z
Logout of [sid: 8, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]: successful" }" f$ m6 U( a+ K
Stopping iSCSI daemon:
8 n. I$ e! j" V" S6 ?; v
. M) x+ k, h6 y; _0 K; \- [0 m& ~ OK ]' Y' t9 S( j$ l: Y' G" t8 P' \' [
9 }9 A/ l8 }! o& s2 }
[root@racnode1 ~]#
. y; v. U r4 D+ h0 ]6 } service iscsi start6 H! r5 p. R$ @2 G- @
iscsid dead but pid file exists
) b! i) T$ t: ]5 o w& ~+ G8 z0 U Turning off network shutdown. Starting iSCSI daemon:
' ~+ X5 y7 E! e+ k* ?3 J. l t. j2 R ; y& z) L# c6 V/ ?0 x
OK ]
) G$ T2 o8 |7 f 7 t: J i, g- c( }. g+ c
6 u: b5 t6 e1 ?1 Y; _+ u
OK ]
+ I3 ?$ r# j- `( b! y Setting up iSCSI targets: Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]5 ^* J/ u5 y$ B% w$ p
Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]
3 ~. d' V& \% c( F& L Logging in to [iface: default, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]
: b( C5 P! C! |; r( z0 S4 `' K6 h Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.crs1, portal: 192.168.2.195,3260]: successful" o, x! Q6 _+ B* q
Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.fra1, portal: 192.168.2.195,3260]: successful! X/ i! C. T) T9 y) P6 [
Login to [iface: default, target: iqn.2006-01.com.openfiler:racdb.data1, portal: 192.168.2.195,3260]: successful
0 y, r6 ?. U' Z' r) ^! f9 |# e& ` : n4 Y' L7 Z" u0 {" F6 X2 v V
, D7 u7 Z/ i& y+ K, H7 r OK ]
0 @2 s h- ^! A我们来看看最终的结果:
s5 E% x$ I( f9 f& j Q- U+ \复制
: D8 Y* C6 j# P, j- @& n% NCopied to ClipboardError: Could not Copy( x' m; G0 L8 o: v9 K* G
[root@racnode1 ~]#
, k* L6 h' I' t0 p8 \* M: D. \ ls -l /dev/iscsi/*
4 M% Z: V; l" c) _ /dev/iscsi/crs1:* _ p2 ]$ t- j
total 0
$ o; V- f& O7 r lrwxrwxrwx 1 root root 9 Nov 3 18:13 part -> ../../sdc
E, N2 r* j6 X( f, X9 @ [ { 3 H+ J0 f6 W+ P6 `, f( |" `
/dev/iscsi/data1:
: r& Q6 E6 l6 S7 G3 l5 e total 0
8 v7 {7 A0 _9 R" i lrwxrwxrwx 1 root root 9 Nov 3 18:13 part -> ../../sde. @- p: r3 w( o7 X7 G
7 S) U+ f" O" A4 @$ z6 [# q0 l6 k
/dev/iscsi/fra1:
2 A/ g! X9 D% C. b total 09 t& `6 B4 J$ D6 c4 J& v
lrwxrwxrwx 1 root root 9 Nov 3 18:13 part -> ../../sdd5 q2 D ?! d" u) y) h. F y
[root@racnode1 ~]# 9 u7 c* k+ N T5 S0 U' ~
ls -l /dev/iscsi/*
% E X2 u8 k+ x- i /dev/iscsi/crs1:
3 G$ r% A" y [% y& A total 0" z* I# L& m% o! t8 f% R6 x5 A) S
lrwxrwxrwx 1 root root 9 Nov 3 18:13 part -> ../../sdc& U# @8 x5 `# o* l5 y
- ~% E; R) j# p Z5 k
/dev/iscsi/data1:6 E: w0 |+ W" G5 q# }' E
total 0
6 `" R8 w) Q& P- b7 b, y+ J lrwxrwxrwx 1 root root 9 Nov 3 18:13 part -> ../../sde5 Z' A! B$ E, ]. Q( y% j
, c, j! u8 }; f% d, |9 z! \ w$ b /dev/iscsi/fra1:& r+ X) k& W) c8 `
total 0
$ [' i5 v" e' ~% ^/ m lrwxrwxrwx 1 root root 9 Nov 3 18:13 part -> ../../sdd
$ N" ]) x3 c6 T0 |4 K以上清单显示 udev 完成了其应当完成的工作!我们现在拥有了一组一致的本地设备名称,可用于引用 iSCSI 目标。例如,我们可以安全地假定设备名称 /dev/iscsi/crs1/part 将始终引用 iSCSI 目标 iqn.2006-01.com.openfiler:racdb.crs1。我们现在通过一致的 iSCSI 目标名称与本地设备名称相映射,如下表所述:
1 }$ b" [. `+ f- y3 ^, F5 K0 ciSCSI 目标名称到本地设备名称映射
- L4 l( [& ~- A; @: m) YiSCSI 目标名称 本地设备名称. n9 a* X0 u' Z3 I' Y8 [' u
iqn.2006-01.com.openfiler:racdb.crs1 /dev/iscsi/crs1/part
3 m+ {: w E4 r/ o! F# y0 Yiqn.2006-01.com.openfiler:racdb.data1 /dev/iscsi/data1/part) G. O% ~+ L' N
iqn.2006-01.com.openfiler:racdb.fra1 /dev/iscsi/fra1/part( @( e( b" {& v- ]
在 iSCSI 卷上创建分区! G* `5 _6 j, @; @
我们现在需要在跨整个卷大小的各个 iSCSI 卷上创建一个主分区。如前所述,我将使用自动存储管理 (ASM) 来存储 Oracle Clusterware 所需的共享文件、物理数据库文件(数据/索引文件、联机重做日志文件和控制文件)以及集群数据库的快速恢复区 (FRA)。
+ V( _6 a; i. O4 Q* q, b* N6 s" kOracle Clusterware 共享文件(OCR 和表决磁盘)将存储在名为 +CRS 的 ASM 磁盘组中,该磁盘组将配置为外部冗余。集群数据库的物理数据库文件将存储在名为 +RACDB_DATA 的 ASM 磁盘组中,该磁盘组也将配置为外部冗余。最后,快速恢复区(RMAN 备份和归档重做日志文件)将存储在名为 +FRA 的第三个 ASM 磁盘组中,该磁盘组也将配置为外部冗余。
$ e- I. M) g( x6 C/ E下表列出了将创建的三个 ASM 磁盘组以及它们将包含哪些 iSCSI 卷:
+ `5 v$ _$ p( Q0 i! w" ]6 POracle 共享驱动器配置
, c3 n9 b. E3 Y文件类型 ASM 磁盘组名称 iSCSI 目标(短)名称 ASM 冗余 大小 ASMLib 卷名
% T8 M' n9 y: x( [1 SOCR 和表决磁盘 +CRS crs1 外部 2GB ORCL:CRSVOL18 f5 X5 g3 D5 d/ O% ~4 `" X
Oracle 数据库文件 +RACDB_DATA data1 外部 32 GB ORCL:DATAVOL10 \& U! n( a: S0 J
Oracle 快速恢复区 +FRA fra1 外部 32 GB ORCL:FRAVOL1. n2 a( W3 [% u8 w \- O
如上表所示,我们需要在每一个 iSCSI 卷上都创建一个 Linux 主分区。fdisk 命令在 Linux 中用于创建(和删除)分区。对于每一个 iSCSI 卷,您都可以在创建主分区时使用默认值,因为默认操作是使用整个磁盘。您可以安全地忽略任何可能表明设备不包含有效 DOS 分区(或 Sun、SGI 或 OSF 磁盘标签)的警告。
& W* [) d& e0 R在本例中,我将从 racnode1 中运行 fdisk 命令,并使用 udev 在上一节中创建的本地设备名称在每一个 iSCSI 目标上创建单一主分区:
: H! T! h1 o: \8 ^" E% _% ~/dev/iscsi/crs1/part
1 }+ c% X) q3 G/dev/iscsi/data1/part
1 K" X0 A( p/ e% o; \. [/dev/iscsi/fra1/part# C$ j& H; e) f# p8 f5 D" ^
注意:在每一个 iSCSI 卷上创建单一分区时,只能从 Oracle RAC 集群中的一个节点运行!(即 racnode1)
2 ]% b, e' b+ u8 e- a+ k复制9 I. w& k+ s* ?
Copied to ClipboardError: Could not Copy
5 G/ X. [5 `! t. B" R1 ]# ---------------------------------------
; s# Z. y8 d) c' E4 Q& h y9 Z5 t* R* `! J: A& Q
[root@racnode1 ~]#
* ~; L# \8 F) H+ }" M fdisk /dev/iscsi/crs1/part2 d7 f e7 y5 r* V4 ~
Command (m for help):
& W5 e" l# |7 Z( q- [3 v" A n
6 d: O+ A5 P- g' N Command action
0 G' G1 }) `' Y e extended, }& N* a+ [) @
p primary partition (1-4)# q. T/ L- M9 X6 \9 N' ^7 M' W+ O* j
p
" k3 u5 c! f+ l) h: w7 j Partition number (1-4):
3 K9 B- e, @" E1 W/ }2 E. w6 I7 j 1
* F/ V6 R2 e$ C3 ] k2 ~8 q/ d First cylinder (1-1012, default 1): - [" n" E1 m9 B/ M4 ^9 A% C5 F
12 W- h3 v' ]0 |$ L$ J
Last cylinder or +size or +sizeM or +sizeK (1-1012, default 1012): 5 `! r a; H9 D) P. |; F( t B
1012
Z7 N" C0 m2 l, h! a
8 r% W3 O5 z0 V# W, P5 ^( t# z Command (m for help): ' R8 e: u" [% E1 V+ z7 L" |
p
, f$ e0 }! z' ]3 w' H/ s 8 z: i1 K/ U, P* T
Disk /dev/iscsi/crs1/part: 2315 MB, 2315255808 bytes
. `! \ L9 t& O2 L& d, z 72 heads, 62 sectors/track, 1012 cylinders9 g5 }; O, Z' g5 @1 [
Units = cylinders of 4464 * 512 = 2285568 bytes
# R! P7 g& m# P) I
4 ^& r& W, t/ O. _1 Y7 c% ]! f! T Device Boot Start End Blocks Id System
8 ^9 g$ F, a2 M/ Z- p% y, U" ^ /dev/iscsi/crs1/part1 1 1012 2258753 83 Linux
2 l& |8 Z$ A$ M, r; m 1 P; }$ J9 J4 b" {9 v- Y3 q
Command (m for help):
0 a* G% z& a, s( }6 o w
2 D" B+ v+ q L$ Q2 t The partition table has been altered!$ D) i3 V. |8 D& U, w: V( k9 b
9 |9 C1 u$ s3 z: G" w
Calling ioctl() to re-read partition table.
/ `8 ~. U: l6 W2 V Syncing disks.8 ~) C" F, F) _6 T; p
Z2 _) a) h m9 V
# ---------------------------------------
- k( y7 T5 G: y1 a' w! I v & `- I9 `/ \( M. V
[root@racnode1 ~]# # T1 v+ C+ B) y% y ^
fdisk /dev/iscsi/data1/part
# E* @# m' u& E- s2 b0 w. b Command (m for help): 7 j Y/ L$ k" x3 X. c
n; V) K. |" X! N/ I! U
Command action
, y9 n3 F5 f+ m! p* t4 | e extended3 Z% q" w. i1 p2 z3 z' Z, h4 D( [
p primary partition (1-4)
# `, s2 t! n$ T* D p
; [! d) b; O! X' A4 o* q' S# F Partition number (1-4):
: l/ ~4 H3 O& Y8 g" Y m5 W 1
3 \5 ?% d5 M! A! ~+ I a9 }! d5 f First cylinder (1-33888, default 1): 7 {) m% C3 }; C- C( m
1
, B: i2 Y1 A- H6 S5 M9 p& Y& e Last cylinder or +size or +sizeM or +sizeK (1-33888, default 33888): ! i5 E' t. l) ]. B- P, i
33888. z" l3 a' w D2 n
1 \+ B3 Q5 K& W* H* Q" { Command (m for help):
3 B5 f# B9 \' u5 P* o p
- q/ h' z( a3 H% y
: \! k+ H( d1 u2 M2 L Disk /dev/iscsi/data1/part: 35.5 GB, 35534143488 bytes
; Z1 s. N# u) c6 L% d& c1 J" k9 F 64 heads, 32 sectors/track, 33888 cylinders- p% X R7 Q3 i9 q/ m
Units = cylinders of 2048 * 512 = 1048576 bytes
1 _0 } m9 m0 h$ a
9 v' r. }4 q1 N. M Device Boot Start End Blocks Id System& l8 I& g7 F; d; B) [+ a! @ Z* Z
/dev/iscsi/data1/part1 1 33888 34701296 83 Linux
8 ~6 b1 ]5 g$ f, E( ]& u $ Q2 ]+ s+ s7 ?# d* L
Command (m for help): 8 Z% h# ^$ f7 X7 j" N& X) `
w3 H7 h/ D* W" o( N/ a: x
The partition table has been altered!
# S* f W3 _9 V" E! S; t
6 Q8 q& H$ a4 E Calling ioctl() to re-read partition table.& I x3 K' c# u2 d; O# P; t5 H0 i
Syncing disks.8 r) C3 J* l3 _. ~. r* s1 D: {
8 P, ` p7 ~$ _+ W8 \6 o. Y
, s& n; ~" i1 W, B # ---------------------------------------* L( A0 U! J4 W: Y' F- L! \
' C4 e) ]4 J/ m4 G
[root@racnode1 ~]# $ z; V4 H7 S3 C( y, }
fdisk /dev/iscsi/fra1/part) p! V. @) w8 g/ F' B& H$ ~5 N# r
Command (m for help): 4 ^ J3 U- C& v6 D) m
n
' y2 ^* j. O$ l5 S( i& @( y Command action; y( v4 B+ b9 ^7 F2 b
e extended0 m7 i& ]0 g U6 M; F/ |
p primary partition (1-4)
( e5 C: ?6 `" |6 b) f5 [" p p. e0 q6 | P+ Y0 c! j! k3 \
Partition number (1-4): * W m% ~& N# f: n$ O6 @4 ?
1! f$ E; U. \/ ~4 n/ B
First cylinder (1-33888, default 1): 5 M. Z4 _4 S/ I3 D" x6 Q
1) |$ B+ V2 d; ^% d
Last cylinder or +size or +sizeM or +sizeK (1-33888, default 33888):
. }% O6 B% h, P! O: l, U 33888
- P& Y/ z/ e6 e2 B9 F( A2 W 3 W0 I3 u7 w2 t# Y& O) w# [
Command (m for help):
$ m2 r: ~9 m/ Q& u: [; E2 ` p# |" ]4 @) U0 M8 ^1 B6 m* P4 a. b
' A% M- I' [% X+ w* t
Disk /dev/iscsi/fra1/part: 35.5 GB, 35534143488 bytes) B5 r! I5 u6 a7 L, N
64 heads, 32 sectors/track, 33888 cylinders4 g) r/ c" B; h9 V# i
Units = cylinders of 2048 * 512 = 1048576 bytes
: y0 ?7 J- ]' g% n, P
% A# h3 e9 ~' Q: Y4 V" i5 ~" H Device Boot Start End Blocks Id System8 I/ n, s5 f9 M( Q* v0 H7 t9 O
/dev/iscsi/fra1/part1 1 33888 34701296 83 Linux4 h+ C- b0 c4 P! r# Y
5 r1 k+ w( \* O/ y' _$ ^% e
Command (m for help): 0 x0 I" M' M0 R
w4 ~, z+ Q- Z: g9 a5 U, Y7 a& _
The partition table has been altered!3 K) o$ v# N: [/ c+ I
4 _; f' H L5 Y ?1 c
Calling ioctl() to re-read partition table.# ^- e9 P8 b: H, O f$ q- ?! y8 e
Syncing disks.
0 n8 L9 F$ M7 G$ _# ---------------------------------------
" Z: y( g2 ^! G P 0 {+ t) @2 Z1 d
[root@racnode1 ~]#
7 K* {' @) h: h- ^: Z fdisk /dev/iscsi/crs1/part6 f2 w6 h' I# \5 H$ k9 k6 D" }
Command (m for help): 4 D3 `! v' d1 R, w# v4 B
n7 ?# g% p9 Z& `
Command action' \8 G' Q) R$ n
e extended
1 T% l( X; r- R. k- J: h) ` p primary partition (1-4)
- Z# v/ F! ^( t9 k. z p
( p0 Q$ c9 N0 D5 m2 A* c0 d3 T Partition number (1-4): 9 g. j3 `+ X" \& o1 c: N4 a9 Q
1
8 Q. X2 y: W& G3 U1 Z, j( k First cylinder (1-1012, default 1): + a6 k: z/ }( W9 K& E$ y
19 K7 P! m# w% h2 a
Last cylinder or +size or +sizeM or +sizeK (1-1012, default 1012):
+ l, @% Q( l2 K6 i3 y 1012
- H E7 Z* E( O9 r2 [2 z4 c
/ p" Z3 q* F! K1 m Command (m for help): - E$ y" E* e$ ?# [; S
p: E9 j7 T4 S3 ~
( L% Q9 a% Z! Q4 z Disk /dev/iscsi/crs1/part: 2315 MB, 2315255808 bytes
9 T9 C7 E6 x6 e+ H2 p$ r 72 heads, 62 sectors/track, 1012 cylinders
$ }! C* `8 M* a3 `/ v% {) L6 G Units = cylinders of 4464 * 512 = 2285568 bytes
5 n* |; M$ }) C* K+ z 8 J" I$ v! l- b7 A5 m/ D% }0 L
Device Boot Start End Blocks Id System, h. X) w- c/ y, s$ \
/dev/iscsi/crs1/part1 1 1012 2258753 83 Linux# N; I8 O5 W) j2 g9 y
8 [. r4 c) i$ i: e# I, J) L6 M
Command (m for help):
0 z! Z& o! R* W; h( ~6 x w6 G# c; f! v9 d" n0 J/ `
The partition table has been altered!* v2 r. z' f: j
( ^6 P$ f' Z! L2 p; Z7 l
Calling ioctl() to re-read partition table.
l1 q. q: [2 n& c J( t& e Syncing disks.
. e% b: e7 L' \$ ] 5 }$ Y: y8 r9 t$ j
# ---------------------------------------% `8 h; Y/ h3 }1 V* W3 ^# S
; z5 l- C, }; [; ^ [root@racnode1 ~]#
2 d; a3 ]# D5 q# }9 `8 W fdisk /dev/iscsi/data1/part
, y, j4 W& U4 ?, a+ | Command (m for help): 5 I8 m, o* R! ]: F. P, f' S
n; R+ d. t% O7 _
Command action
' r& {3 T' L3 P% O; V' ^ e extended& b$ V8 b" n5 r5 Q8 m( V7 w& @
p primary partition (1-4)
$ m) V2 s5 ^' X9 j p0 t0 x, _) O7 r
Partition number (1-4):
7 }. |: a) t3 n) c1 G 1
! O# x8 l+ P% X% s; ]8 g0 H9 B4 d- V* ~ First cylinder (1-33888, default 1): * \( W" H) p9 X4 u M" r
1
. u. k; M# N$ A) x1 k% ` Last cylinder or +size or +sizeM or +sizeK (1-33888, default 33888): 6 T+ z) D1 j8 R. n/ y9 i7 w
338881 S1 N" A1 D, B. Y
) U; p( _# S3 n Command (m for help): : L4 T% ^) O6 g: @% f
p# Y* L6 X+ n. C d/ q
6 D- j% T6 q- w" u$ \) y Disk /dev/iscsi/data1/part: 35.5 GB, 35534143488 bytes
, s( G0 K! v3 u' ]# i: d3 R& }0 B' C) r 64 heads, 32 sectors/track, 33888 cylinders' Q6 c9 k% ^1 X/ ?% j0 O
Units = cylinders of 2048 * 512 = 1048576 bytes) i- p% I g. E2 X
" v I7 H# \( k8 \- l# U! Z4 [ Device Boot Start End Blocks Id System
& b1 x2 S- `7 k& Z8 E! ]/ e /dev/iscsi/data1/part1 1 33888 34701296 83 Linux
, P/ K. Y8 A* n3 f) J
+ L2 ?/ y) F: w Command (m for help): # Z# P/ ?/ X6 ?+ m, n
w0 k9 b8 Z* ?2 L
The partition table has been altered!% o0 p& h4 p; l
) E( a& w* j( Q1 e9 q- c, @% Z' I Calling ioctl() to re-read partition table.9 ]' U0 {6 n8 V6 B6 I# |
Syncing disks.
3 e( e2 p& i2 N
) d6 S6 e m5 D, D$ p/ D 8 x3 v8 l$ h8 F4 y! q
# ---------------------------------------
, V: U. `6 E. M1 J: L
# q3 z* {1 @3 Z2 f# ^7 p" @6 w [root@racnode1 ~]# 7 ^, Q7 N) g- N8 W2 W
fdisk /dev/iscsi/fra1/part
& p e1 o9 h5 y$ e" V! z2 A Command (m for help):
3 l) u, R* d4 e1 b# M: c8 Q8 o n! f- l7 f* @5 I
Command action& z8 t9 H5 l% ]; j9 D U4 b6 j
e extended9 n3 e* x" S7 ]2 M/ G5 f' Y( T, f! h
p primary partition (1-4)! m% t: b4 x$ N5 [( ?
p
( U+ g2 e' B6 d Partition number (1-4):
: W8 A! @, B. f4 o 1
v4 J! Y0 S( c T/ S. | First cylinder (1-33888, default 1):
5 C$ Q+ u& p7 A; _$ z `# j! C 1
6 s4 }1 d& s. d6 G1 @! M5 q6 J Last cylinder or +size or +sizeM or +sizeK (1-33888, default 33888): + |5 Y; n; p! K
33888
- K5 o: ]& _) ?+ W2 H8 o0 l+ j4 h $ V3 _. q i; K
Command (m for help): " R/ h0 V5 _- t7 l3 S" B% ~
p
0 n+ \. O) m" h8 v. N! _# S$ Z( ] ) h7 H. L0 N4 n7 Z% \1 ]; s+ Q1 D- K
Disk /dev/iscsi/fra1/part: 35.5 GB, 35534143488 bytes
, W0 z/ C, j5 s8 Z4 }* [ 64 heads, 32 sectors/track, 33888 cylinders
3 I# K# j7 [5 ]2 E. C l, g% E Units = cylinders of 2048 * 512 = 1048576 bytes
& t) V/ L! Y$ r $ @5 s9 `( e5 ]7 l3 U5 b
Device Boot Start End Blocks Id System
$ y3 L4 P7 g, p. v" H$ `: @/ I i /dev/iscsi/fra1/part1 1 33888 34701296 83 Linux
. V R% Y2 q" x& q8 R 3 g, u# K# O$ e& n* _' E
Command (m for help):
- \. W2 ~1 Z9 n7 L- O' e w
0 `" M% ^! k: `* F5 @! C The partition table has been altered!8 c. f4 x- g/ i/ P" ]- Q
: g. K+ q7 J3 d
Calling ioctl() to re-read partition table.
' G8 J5 s! i6 W. M9 ] Syncing disks.- d( e9 ~. n" ^( f/ y+ s
验证新分区
$ K" w4 a* n) R) N从 racnode1 创建所有必需的分区后,您现在应当使用以下命令作为 Oracle RAC 集群 (racnode2) 中所有其余节点的“root”用户帐户,以便于向内核通知分区更改。请注意,从 Openfiler 发现的 iSCSI 目标名称与本地 SCSI 设备名称的映射在两个 Oracle RAC 节点上将有所不同。这不是问题,也不会造成任何问题,因为我们不会使用本地 SCSI 设备名称,而是使用 udev 在上一节中创建的本地设备名称。
2 A2 a0 B# Z5 R1 Q8 e; y7 C0 i1 |从 racnode2 中,运行以下命令:
. p) W, r. u& A$ P0 L& T! s复制5 Y+ s/ c4 V. ~' \$ d
Copied to ClipboardError: Could not Copy
a( ?2 q- g5 ^* e- F/ c* g[root@racnode2 ~]#
& G( I6 E/ |* G$ y* J$ s partprobe
. A6 y# |8 O7 w+ m( |: C" W( _ ; b) z( M, v4 u# l
[root@racnode2 ~]# / _( w6 u" Q& F' K
fdisk -l
1 C# Q5 q1 l; L
; k2 `% J& b( O7 \' N2 n9 x, f Disk /dev/sda: 160.0 GB, 160000000000 bytes1 B% d8 O: A3 f9 p* b. d4 V
255 heads, 63 sectors/track, 19452 cylinders Z" D& M& M( l0 P! H/ L
Units = cylinders of 16065 * 512 = 8225280 bytes
# h- Y' q# j2 e7 M E
$ t# J" B; X" J/ K Device Boot Start End Blocks Id System1 ?6 b, ^# ~0 a; J4 l% G7 n
/dev/sda1 * 1 13 104391 83 Linux% V( H. O' ]2 s% Q. F' }
/dev/sda2 14 19452 156143767+ 8e Linux LVM
+ ~7 c- M) {, Q" y 0 v3 y2 @+ j5 x. r* p4 e+ x+ @- s
Disk /dev/sdb: 35.5 GB, 35534143488 bytes
. a8 x3 G. q) @8 |% }- ` 64 heads, 32 sectors/track, 33888 cylinders& J* K+ v* M7 U! Q3 D
Units = cylinders of 2048 * 512 = 1048576 bytes# H$ T; O3 C# E8 {8 j. D8 V
0 x3 S3 A& B6 p: Q' \5 Y, Q Device Boot Start End Blocks Id System
6 q& j5 t. I* D0 O& N) T+ S5 E/ I /dev/sdb1 1 33888 34701296 83 Linux! {4 I0 }8 D$ \( q
' _4 K& k7 ^" y4 B Disk /dev/sdc: 35.5 GB, 35534143488 bytes6 V; |# I$ | k u
64 heads, 32 sectors/track, 33888 cylinders
% r, i. E" R. N: u- P7 {& L Units = cylinders of 2048 * 512 = 1048576 bytes/ f0 O+ U" d; {4 C% }9 S
3 j& Y7 N2 a X/ Z; h" P Device Boot Start End Blocks Id System
- `" |0 ?5 B. @+ p /dev/sdc1 1 33888 34701296 83 Linux+ u6 V P& c3 \# X# a7 @0 v
! u' {6 e- j n" b* O8 p+ Z
Disk /dev/sdd: 2315 MB, 2315255808 bytes
7 y, ^; }$ M" I+ o/ `, }0 z 72 heads, 62 sectors/track, 1012 cylinders
) c. u/ ?) ?1 }* b6 L' M Units = cylinders of 4464 * 512 = 2285568 bytes5 f, ~0 `3 J7 W# y2 D
3 z8 | x! \. ~! i) L, j Device Boot Start End Blocks Id System, {. a! |# C) F9 x$ y
/dev/sdd1 1 1012 2258753 83 Linux
$ b' H# L0 @% V3 A3 T[root@racnode2 ~]#
7 ~6 K$ L$ A" i0 }! n partprobe
* O4 a5 M) O& Q7 C" D . S9 O: X: J, C1 C$ g4 F
[root@racnode2 ~]#
, p7 G9 B- @$ K1 B0 B3 X fdisk -l; v; x6 j; S0 I; c1 t3 a
: J5 [0 d- P/ ^( {9 m( R& p1 U Disk /dev/sda: 160.0 GB, 160000000000 bytes6 }- N. j7 h! }
255 heads, 63 sectors/track, 19452 cylinders
& \8 @* \' T$ i9 ^* q; j6 E Units = cylinders of 16065 * 512 = 8225280 bytes: y+ [- L7 w3 Q7 u% x! n
8 B/ e' V0 f7 \2 ]1 \
Device Boot Start End Blocks Id System
0 k3 t6 I% p* r b( o" r /dev/sda1 * 1 13 104391 83 Linux
7 ^0 c) {. z! _# X/ e /dev/sda2 14 19452 156143767+ 8e Linux LVM* J* g, T0 L3 v. Y9 \( m% {" k0 m, ^
7 U! R* A& j: v3 m
Disk /dev/sdb: 35.5 GB, 35534143488 bytes
5 {: j) \' B! y5 b S 64 heads, 32 sectors/track, 33888 cylinders% f' G- A4 }& M! i) |! \4 w' n
Units = cylinders of 2048 * 512 = 1048576 bytes
! O0 f" m+ ]) {% T8 M- u# H
/ O+ m C) M/ b) n2 r! F" k" J7 d5 n1 @7 x Device Boot Start End Blocks Id System) n# o& U( F, @- y" s
/dev/sdb1 1 33888 34701296 83 Linux
/ y4 r, P" ~, s t8 T( b4 m0 Z
8 |0 z- H$ S+ r$ k0 {. L3 }# i/ B, a Disk /dev/sdc: 35.5 GB, 35534143488 bytes7 B6 ~' m: \1 Q' _
64 heads, 32 sectors/track, 33888 cylinders
1 s# x G, n1 W, x Units = cylinders of 2048 * 512 = 1048576 bytes
) M( | t: h1 V) p s. R% y* G6 A8 y- q+ n6 s; [* y
Device Boot Start End Blocks Id System
. Q r0 T% z9 v, A% {% U /dev/sdc1 1 33888 34701296 83 Linux% f: P x# e8 v! e
3 I# _2 R# s" @
Disk /dev/sdd: 2315 MB, 2315255808 bytes, _# C" [, h1 C% P K
72 heads, 62 sectors/track, 1012 cylinders2 Y4 T) V' R, `( f" X* ~
Units = cylinders of 4464 * 512 = 2285568 bytes
7 L/ V6 d% Z: o3 M* J* L- x
6 F( q1 L/ H6 w% M% v Device Boot Start End Blocks Id System! O$ P" q d$ p* c1 V6 _. q- a$ v
/dev/sdd1 1 1012 2258753 83 Linux" M2 q7 m9 L$ [
最后一步,您应当在两个 Oracle RAC 节点上运行以下命令以验证 udev 是否为每个新分区创建了新的符号链接:* J! } [9 |0 e1 `0 c
复制' c- U2 D x% S7 X
Copied to ClipboardError: Could not Copy
; x. u% z; g5 M S" [$ v[root@racnode2 ~]#
* Q9 F* j, J; g3 y. y0 b5 s& F (cd /dev/disk/by-path; ls -l *openfiler* | awk '{FS=" "; print $9 " " $10 " " $11}') ^& l/ z! b J7 I) T& ~- d
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0 -> ../../sdd) h6 C; U3 v* h7 Y) H7 E# c e
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0-part1 -> ../../sdd1
! F6 ^" G/ u* @1 s$ P0 t4 O ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0 -> ../../sdc# D/ B- L4 e) X) `9 I: _. G
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0-part1 -> ../../sdc10 s4 z2 G# Y' R- g, @4 C$ Y2 T
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0 -> ../../sdb
) @: d3 b2 v2 Z- Z ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0-part1 -> ../../sdb1
- F- J- B f$ X- z8 p3 {[root@racnode2 ~]# 1 {% G1 a( X2 n Q
(cd /dev/disk/by-path; ls -l *openfiler* | awk '{FS=" "; print $9 " " $10 " " $11}')/ G+ \9 t8 S; l9 S1 i# E0 w) p6 }
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0 -> ../../sdd- E4 C! W4 N! k/ d9 ^2 c' I4 [
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0-part1 -> ../../sdd1
" k% O* l2 a8 o; l5 |5 O$ q ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0 -> ../../sdc
" \- J' }$ a, D* x) P4 S9 G ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0-part1 -> ../../sdc1
! e+ T4 f2 O# I ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0 -> ../../sdb% d3 f, |- {9 U" z; A1 x a
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0-part1 -> ../../sdb1
u* V6 ^4 w2 A# C/ k; q: L+ s% D以上清单显示 udev 确实为每一个新分区创建了新的设备名称。在本指南稍后为 ASMlib 配置卷时,我们将使用这些新设备名称:
/ _* x' c7 Y4 s) I K7 F# W3 t+ Z. w1 N
/dev/iscsi/crs1/part1
* v* X% r6 T! d, w% L* B/dev/iscsi/data1/part1; N; r5 `8 C3 M9 ] H
/dev/iscsi/fra1/part1
0 z7 U% j, U* _5 V# L' X |
|