- 论坛徽章:
- 0
|
第四部分 ASM配置共享磁盘
配置共享磁盘的方法有三种:
1. Oracle 集群文件系统 (OCFS)
2. 自动存储管理器 (ASM)
3. 原始设备
从可扩展性和可管理性方面考虑,我们使用的是用ASM Library Driver配置ASM的共享磁盘。其他两种配置共享磁盘的方法将在最后面的附录部分介绍。
4.1安装ASM软件
从http://www.oracle.com/technology ... x/asmlib/rhel4.html找到要下载的三个RPM 软件包,注意,一定要与内核版本和系统平台相符。
用root权限执行:
# rpm -Uvh oracleasm-support-version.arch.rpm \
oracleasm-kernel-version.arch.rpm \
oracleasmlib-version.arch.rpm
在我们系统中,为:
#rpm –Uvh oracleasm-support-2.0.3-1.x86_64.rpm \
oracleasm-2.6.9-22.ELsmp-2.0.3-1.x86_64.rpm \
oracleasmlib-2.0.2-1.x86_64.rpm
1.Preparing... #################################### [100%]
2:oracleasm-support ############################## [ 33%]
3:oracleasm-2.6.9-22.ELsmp ########################## [ 66%]
Linking module oracleasm.o into the module path [ OK ]
3:oracleasmlib #################################### [100%]
对ASM进行配置:
# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.
这将配置 Oracle ASM 库驱动程序的启动时属性。以下问题将确定在启动时是否加载驱动程序以及它将拥有的权限。当前值将显示在方括号(“[]”)中。按 <ENTER> 而不键入回应将保留该当前值。按 Ctrl-C 将终止。
Default user to own the driver interface []:oracle
Default group to own the driver interface []:dba
Start Oracle ASM library driver on boot (y/n) [n]:y
Fix permissions of Oracle ASM disks on boot (y/n) [y]:y
Writing Oracle ASM library driver configuration done
Creating /dev/oracleasm mount point done
Loading module "oracleasm" done
Mounting ASMlib driver filesystem done
Scanning system for ASM disks done
AMS的命令如下所示:[email=oracle@DBRAC1]oracle@DBRAC1[/email]:~> /etc/init.d/oracleasm
Usage: /etc/init.d/oracleasm
{start|stop|restart|enable|disable|configure|createdisk|deletedisk|querydisk|listdisks|scandisks|status}
现在,如下所示启用 ASMLib 驱动程序。
# /etc/init.d/oracleasm enable
Writing Oracle ASM library driver configuration [ OK ]
Scanning system for ASM disks [ OK ]
ASM的安装和配置是要在集群中的每个节点上执行的
4.2用ASM Library Driver配置ASM的共享磁盘
注意:4.2.1和4.2.2部分只需在一个节点上完成
4.2.1磁盘分区(fdisk)
按本次存储的分法,提供了一个15TB的RAID光纤盘阵并只划了一个卷给数据库用(当然以后空间不够可以再加),对操作系统来说就是认到一个设备。本次安装中它认成/dev/sdb,进行fdisk操作,
划3个分区,sdb1和sdb2都为1个G,剩下空间全部给sdb3。
sdb1和sdb2是用来做Oracle Cluster Registry (OCR) 和 Voting Disk。
sdb3是给ASM用的
(下面例子中数值可能不同,命令是相同的)
#fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel.Changes will remain in memory only,
until you decide to write them.After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 4427.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help):p
Disk /dev/sdb:255 heads, 63 sectors, 4427 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
Command (m for help):n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-4427, default 1):1
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-4427, default 4427):1000
Using value 1000
Command (m for help):n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (1-4427, default 1001):1001
Using value 1001
Last cylinder or +size or +sizeM or +sizeK (1-4427, default 4427):2000
Using value 2000
Command (m for help):n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (1-4427, default 1001):3001
Using value 3001
Last cylinder or +size or +sizeM or +sizeK (1-4427, default 4427):4427
Using default value 4427
Command (m for help):w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING:If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.
4.2.2创建ASM磁盘
通过以 root 用户身份运行以下命令来标记由 ASMLib 使用的磁盘。 仅从一个集群主机节点上执行此操作。提示: 以大写字母输入 DISK_NAME。当前版本中有一个错误,即如果使用小写字母,ASM 实例将无法识别磁盘。
# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb3
Marking disk "/dev/sdb" as an ASM disk [ OK ]
……
TIP:根据我们的安装经验,创建ASM disk时只能绑定一个分区(/dev/sdb3),而不能是一个设备(/dev/sdb)
以下示例演示了如何列出标记为由 ASMLib 使用的所有磁盘。
# /etc/init.d/oracleasm listdisks
VOL1
……
4.2.2在各个节点重新扫描ASM磁盘
一定在集群的其他节点上,以 root 用户身份运行以下命令,扫描所配置的ASMLib磁盘:
# /etc/init.d/oracleasm scandisks
这样其他节点上的ASM Disk才有效。 |
|