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

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