RedHat/CentOS发行版本号及内核版本号对照表 :
CENTOS 5.5/RHEL 5 Update 5——————2.6.18-194
CENTOS 5.6/RHEL 5 Update 6——————2.6.18-238
CENTOS 5.7/RHEL 5 Update 7——————2.6.18-274
CENTOS 5.8/RHEL 5 Update 8——————2.6.18-308
CENTOS 6.0/RHEL 6 Update 0——————2.6.32-71
CENTOS 6.1/RHEL 6 Update 1——————2.6.32-131
CENTOS 6.2/RHEL 6 Update 2——————2.6.32-220
1.检查内核版本
[root@vasm ~]# uname -a
Linux vasm 2.6.32-200.13.1.el5uek #1 SMP Wed Jul 27 21:02:33 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
2.下载ASMLib驱动
3.安装asmlib驱动
[root@vasm ~]# rpm -Uvh oracleasm-support-2.1.8-1.el5.x86_64.rpm oracleasmlib-2.0.4-1.el5.x86_64.rpm oracleasm-2.6.18-274.el5-2.0.5-1.el5.x86_64.rpm
warning: oracleasm-support-2.1.8-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [ 33%]
2:oracleasm-2.6.18-274.el########################################### [ 67%]
3:oracleasmlib ########################################### [100%]
4.磁盘分区
[root@node1 ~]# fdisk /dev/sdb
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-102, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-102, default 102):
Using default value 102
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@node1 ~]# fdisk -l
/dev/sda1 251 1958 13719510 83 Linux
/dev/sda2 1 250 2008093+ 82 Linux swap / Solaris
/dev/sdb1 1 101 103408 83 Linux
/dev/sdb2 102 200 101376 83 Linux
/dev/sdc1 1 99 101360 83 Linux
/dev/sdc2 100 198 101376 83 Linux
/dev/sdc3 199 300 104448 83 Linux
/dev/sdd1 1 1217 9775521 83 Linux
/dev/sdd2 1218 1912 5582587+ 83 Linux
5.配置ASMLIB
ASMLib configure command
[root@vasm ~]# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface []: oracle
Default group to own the driver interface []: oinstall
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]
[root@node1 linux-patch]# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks: [ OK ]
6.检查asm状态
[root@vasm ~]# /etc/init.d/oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yes
7.创建共享磁盘
We have a set of 16 LUN’s ready, we will create 4 ASM disks on LUN’s sdb1,sdc1,sdd1 and sde1
[root@vasm ~]# /etc/init.d/oracleasm createdisk vol1 /dev/sdb1
Marking disk "vol1" as an ASM disk: [ OK ]
[root@vasm ~]# /etc/init.d/oracleasm createdisk vol2 /dev/sdc1
Marking disk "vol2" as an ASM disk: [ OK ]
[root@vasm ~]# /etc/init.d/oracleasm createdisk vol3 /dev/sdd1
Marking disk "vol3" as an ASM disk: [ OK ]
[root@vasm ~]# /etc/init.d/oracleasm createdisk vol4 /dev/sde1
Marking disk "vol4" as an ASM disk: [ OK ]
8.检查磁盘状态
[root@vasm ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
VOL4
root和oracle用户运行都得到改结果,并且在rac2上运行也得到,说明配置成功。
补充:如果是10g的要配置裸设备,第四部结束后进行下面操作
在2个节点上做如下操作:
1.修改/etc/udev/rules.d/60-raw.rules 文件
添加如下内容:
ACTION=="add", KERNEL=="sdb1",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sdb2",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sdc1",RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", KERNEL=="sdc2",RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add", KERNEL=="sdc3",RUN+="/bin/raw /dev/raw/raw5 %N"
ACTION=="add",KERNEL=="raw[1-5]", OWNER="oracle", GROUP="oinstall", MODE="660"
2.重启服务:
[root@rac1 ~]# start_udev
Starting udev: [ OK ]
3.查看raw设备:
[root@rac1 ~]# ls -lrt /dev/raw
total 0
crw-rw---- 1 oracle oinstall 162, 5 Sep 8 03:18 raw5
crw-rw---- 1 oracle oinstall 162, 4 Sep 8 03:18 raw4
crw-rw---- 1 oracle oinstall 162, 1 Sep 8 03:18 raw1
crw-rw---- 1 oracle oinstall 162, 3 Sep 8 03:18 raw3
crw-rw---- 1 oracle oinstall 162, 2 Sep 8 03:18 raw2
本文出自 “无双城” 博客,请务必保留此出处http://929044991.blog.51cto.com/1758347/1252460