|
|
楼主 |
发表于 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. ?
|
|