- 积分
- 16841
在线时间 小时
最后登录1970-1-1
|

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