ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 10gRAC+RHEL5U2+ASM+iscsi(1)

10gRAC+RHEL5U2+ASM+iscsi(1)

原创 Linux操作系统 作者:ilsyx 时间:2010-01-10 14:37:23 0 删除 编辑

一 实验规划:


主机名

软件

sl410

gentoo + sys-block/iscsitarget-0.4.17

rac1

VMware-Workstation-Full-7.0.0-203739.i386.bundle

RedHat.Enterprise.Linux.5.Update.2-XiSO.iso

10201_clusterware_linux32.iso

10201_database_linux32.iso

iscsi-initiator-utils-6.2.0.868-0.7.el5.i386.rpm

oracleasm-2.6.18-92.el5-2.0.5-1.el5.i686.rpm

oracleasmlib-2.0.4-1.el5.i386.rpm

oracleasm-support-2.1.3-1.el5.i386.rpm

rac2

VMware-Workstation-Full-7.0.0-203739.i386.bundle

RedHat.Enterprise.Linux.5.Update.2-XiSO.iso

10201_clusterware_linux32.iso

10201_database_linux32.iso

iscsi-initiator-utils-6.2.0.868-0.7.el5.i386.rpm

oracleasm-2.6.18-92.el5-2.0.5-1.el5.i686.rpm

oracleasmlib-2.0.4-1.el5.i386.rpm

oracleasm-support-2.1.3-1.el5.i386.rpm


主机名

设备

IP 地址

子网掩码

默认网关地址


rac1

eth0

192.168.0.44

255.255.255.0

192.168.0.1

eth1

10.0.0.44

255.0.0.0

10.0.0.1


rac2

eth0

192.168.0.45

255.255.255.0

192.168.0.1

eth1

10.0.0.45

255.0.0.0

10.0.0.1

sl410

eth0:1

10.0.0.1

255.0.0.0

-


ASM管理

设备名

大小(M)

描述

/dev/sdb1

100(at least)

Ocr

/dev/sdb2

100

Votingdisk

/dev/sdb3

5000

ASM1

/dev/sdb4

5000

ASM2

二 存储准备

由于rac1与rac2运行在vmware-workstation平台,而vmware-workstation没有vmware-server的共享存储功能.因此在sl410主机用iscsitarget发布共享硬盘设备.

下面命令存储发布一块10GB共享设备。其余磁盘划分的任务就让rac1与rac2去完成吧:)


sl410 oracle # dd if=/dev/zero f=/home/storage.volume count=200 bs=50M

sl410 oracle # /etc/init.d/ietd start

sl410 oracle # ietadm --op new --tid=1 --params Name=storage

sl410 oracle # ietadm --op new --tid=1 --lun=1 --params Path=/data/storage.volume


可以查看发布情况

storage oracle # ietadm --op show --tid=1

Wthreads=8

Type=0

QueuedCommands=32


SL410 ~ # cat /proc/net/iet/volume

tid:1 name:storage

lun:1 state:0 iotype:fileio iomode:wt path:/data/storage.volume


SL410 ~ # netstat -a |grep 3260

tcp 0 0 *:3260 *:* LISTEN

tcp6 0 0 [::]:3260 [::]:* LISTEN

三 rac1与rac2存储配置

1.rac1与rac2发现共享存储

[root@rac1 ~]# /etc/init.d/iscsid start

Turning off network shutdown. Starting iSCSI daemon:

[ OK ]

[root@rac1 ~]# iscsiadm --mode discovery --type sendtargets --portal 192.168.0.29 --login

192.168.0.29:3260,1 storage

Logging in to [iface: default, target: storage, portal: 192.168.0.29,3260]

Login to [iface: default, target: storage, portal: 192.168.0.29,3260]: successful

[root@rac1 ~]# fdisk -l


Disk /dev/sda: 21.4 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


Device Boot Start End Blocks Id System

/dev/sda1 * 1 13 104391 83 Linux

/dev/sda2 14 2610 20860402+ 8e Linux LVM


Disk /dev/sdb: 10.4 GB, 10485760000 bytes

64 heads, 32 sectors/track, 10000 cylinders

Units = cylinders of 2048 * 512 = 1048576 bytes


Disk /dev/sdb doesn't contain a valid partition table

[root@rac1 ~]#


[root@rac2 ~]# /etc/init.d/iscsid start

Turning off network shutdown. Starting iSCSI daemon:

[ OK ]

[root@rac2 ~]# iscsiadm --mode discovery --type sendtargets --portal 192.168.0.29 --login

192.168.0.29:3260,1 storage

Logging in to [iface: default, target: storage, portal: 192.168.0.29,3260]

Login to [iface: default, target: storage, portal: 192.168.0.29,3260]: successful

[root@rac2 ~]# fdisk -l


Disk /dev/sda: 21.4 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


Device Boot Start End Blocks Id System

/dev/sda1 * 1 13 104391 83 Linux

/dev/sda2 14 2610 20860402+ 8e Linux LVM


Disk /dev/sdb: 10.4 GB, 10485760000 bytes

64 heads, 32 sectors/track, 10000 cylinders

Units = cylinders of 2048 * 512 = 1048576 bytes


Disk /dev/sdb doesn't contain a valid partition table


2 对共享存储分区

[root@rac1 ~]# fdisk -l


Disk /dev/sda: 21.4 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


Device Boot Start End Blocks Id System

/dev/sda1 * 1 13 104391 83 Linux

/dev/sda2 14 2610 20860402+ 8e Linux LVM


Disk /dev/sdb: 10.4 GB, 10485760000 bytes

64 heads, 32 sectors/track, 10000 cylinders

Units = cylinders of 2048 * 512 = 1048576 bytes


Device Boot Start End Blocks Id System

/dev/sdb1 1 500 511984 83 Linux

/dev/sdb2 501 1000 512000 83 Linux

/dev/sdb3 1001 5500 4608000 83 Linux

/dev/sdb4 5501 10000 4608000 83 Linux


3 映射sdb1 sdb2为raw

rac1配置

[root@rac1 ~]# raw /dev/raw/raw1 /dev/sdb1

/dev/raw/raw1: bound to major 8, minor 17

[root@rac1 ~]# raw /dev/raw/raw2 /dev/sdb2

/dev/raw/raw2: bound to major 8, minor 18

rac2配置

[root@rac2 ~]# raw /dev/raw/raw1 /dev/sdb1

/dev/raw/raw1: bound to major 8, minor 17

[root@rac2 ~]# raw /dev/raw/raw2 /dev/sdb2

/dev/raw/raw2: bound to major 8, minor 18


将raw命令写入rc.local以便系统重启后能自动映射:)

[root@rac1 ~]# cat /etc/rc.local

#!/bin/sh

#

# This script. will be executed *after* all the other init scripts.

# You can put your own initialization stuff in here if you don't

# want to do the full Sys V style. init stuff.


raw /dev/raw/raw1 /dev/sdb1

raw /dev/raw/raw2 /dev/sdb2

sleep 5

chown -R oracle:oinstall /dev/raw


touch /var/lock/subsys/local

[root@rac1 ~]#


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/11780477/viewspace-624756/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 晓宇的DBA之路
请登录后发表评论 登录
全部评论

注册时间:2009-06-12

  • 博文量
    203
  • 访问量
    662412