时间:2021-07-01 10:21:17 帮助过:28人阅读
1.添加6块硬盘,每块100g。无论是热加还是冷加,无论是加硬盘,用san存储划lun,或者再加上多路径,都是可以这么做的。 在操作系统层,能识别这样的lun,下面的sdb就是一个刚划分的300g的lun(也就是硬盘,或者裸块设备)。[root@pri ~]# cd /dev[root@pri de
1.添加6块硬盘,每块100g。无论是热加还是冷加,无论是加硬盘,用san存储划lun,或者再加上多路径,都是可以这么做的。结果最后只能装上这三个。
-rw-r--r-- 1 root root 25460 Apr 11 18:34 Z喎?http://www.2cto.com/kf/ware/vc/" target="_blank" class="keylink">vcmFjbGVhc20tMi42LjE4LTMwOC4yNC4xLmVsNS0yLjAuNS0xLmVsNS54ODZfNjQucnBtPC9wPgo8cD4tcnctci0tci0tIDEgcm9vdCByb290IDkwMjI1IEFwciAxMSAxODozNiBvcmFjbGVhc20tc3VwcG9ydC0yLjEuOC0xLmVsNS54ODZfNjQucnBtPC9wPgo8cD4tcnctci0tci0tIDEgcm9vdCByb290IDE0MTc2IEFwciAxMSAxODozNiBvcmFjbGVhc21saWItMi4wLjQtMS5lbDUueDg2XzY0LnJwbTwvcD4KCjxicj4KCjxicj4KCrbU09pkamm1pcr9vt2/4tPDu6fAtNewo6y+zbK708O31mdyaWTTw7un0+tvcmFjbGXTw7unwcuhowq+3cu1sru9qGFzbWFkbWlutci1yLXE1+mjrMTHw7S+zb/J0tTTw8bVzai1xG9yYWNsZdPDu6fSstO109Bhc21kYmHIqM/eoaMKCsztvNPDv7j2vdq147XEL2V0Yy9zZWN1cml0eS9saW1pdHMuY29uZgpvcmFjbGUgc29mdCBucHJvYyAyMDQ3Cm9yYWNsZSBoYXJkIG5wcm9jIDE2Mzg0Cm9yYWNsZSBzb2Z0IG5vZmlsZSAxMDI0Cm9yYWNsZSBoYXJkIG5vZmlsZSA2NTUzNgpvcmFjbGUgc29mdCBjb3JlIHVubGltaXRlZApvcmFjbGUgc29mdCBjb3JlIHVubGltaXRlZAoKzO2808O/uPa92rXjtcQvZXRjL3BhbS5kL2xvZ2luzsS8/gpzZXNzaW9uIHJlcXVpcmVkIHBhbV9saW1pdHMuc28KCrbU09pCb3VybmWhokJhc2i78ktvcm4gc2hlbGyjrL2r0tTPwsTayN2807W9w7+49r3ateO1xC9ldGMvcHJvZmlsZc7EvP7W0KGjCmlmIFsgJFVTRVIgPSAmcXVvdDtvcmFjbGUmcXVvdDtdIA=="| [ $USER = "grid" ];then
if [ $SHELL = "/bin/ksh" ];then
ulimit -u 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
[root@erpdb mapper]# /usr/sbin/oracleasm createdisk data1 /dev/mapper/mpath0p7
Writing disk header: done
Instantiating disk: done
配置ASMLib,不加-i就是显示当前配置,然后执行oracleasm init就等同于之前-i的指令。
/usr/sbin/oracleasm configure -i
配置之前:
[root@pri asmlib]# /usr/sbin/oracleasm configure
ORACLEASM_ENABLED=false
ORACLEASM_UID=
ORACLEASM_GID=
ORACLEASM_SCANBOOT=true
ORACLEASM_SCANORDER=""
ORACLEASM_SCANEXCLUDE=""
ORACLEASM_USE_LOGICAL_BLOCK_SIZE="false"
配置:
[root@pri asmlib]# /usr/sbin/oracleasm configure -i
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
配置之后:
[root@pri asmlib]# /usr/sbin/oracleasm configure
ORACLEASM_ENABLED=true
ORACLEASM_UID=oracle
ORACLEASM_GID=dba
ORACLEASM_SCANBOOT=true
ORACLEASM_SCANORDER=""
ORACLEASM_SCANEXCLUDE=""
ORACLEASM_USE_LOGICAL_BLOCK_SIZE="false"
为asm添加asm磁盘
此时/dev/sdb1只是操作系统认识的分区,我要将其设为让ASM也认识。
/usr/sbin/oracleasm createdisk data1 /dev/sdb1
每个节点以root输入,ASM磁盘对每个节点可用。
/usr/sbin/oracleasm scandisks
/usr/sbin/oracleasm listdisks(检验一下)
[root@pri asmlib]# /usr/sbin/oracleasm createdisk data1 /dev/sdb1
Writing disk header: done
Instantiating disk: failed
Clearing disk header: done
[root@pri asmlib]#
[root@pri asmlib]# /usr/sbin/oracleasm createdisk data1 /dev/sdb2
Writing disk header: done
Instantiating disk: failed
Clearing disk header: done
[root@pri asmlib]# /usr/sbin/oracleasm createdisk data1 /dev/sdb3
Writing disk header: done
Instantiating disk: failed
Clearing disk header: done
[root@pri asmlib]# /usr/sbin/oracleasm createdisk data1 /dev/sdb4
Writing disk header: failed
Unable to label device "/dev/sdb4"
[root@pri asmlib]# cd /dev
[root@pri dev]# ls | grep sd
sda
sda1
sda2
sdb
sdb1
sdb2
sdb3
sdb4
sdb5
sdb6
不知道为什么,我虽然有sdb4,但是这样会失败,是不是扩产分区就不能用来做asm盘的。
每个节点以root输入,ASM磁盘对每个节点可用。
[root@pri dev]# /usr/sbin/oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
下面这个必须配置上,不然不能装GI,这个要跟vip在同一个网段上,并且不能是本机ip,也不能使已经使用的。
/etc/hosts
10.60.17.150 pri-scan
如果出现[ins-40724] no locally defined network interface matches the scan subnet.报错,重启下主机就好。
后来又发现有报错,在如下这个界面。好像要再再/etc/hosts中,弄一个pri-vip,随便弄一个跟公网不同一个网段,但地址不一样的ip才能通过。
[root@pri ~]# /usr/sbin/oracleasm createdisk data1 /dev/sdb1
Writing disk header: done
Instantiating disk: failed
Clearing disk header: done
[root@pri ~]# vi /var/log/oracleasm
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": failed
Unable to load module "oracleasm"
Cleaning any stale ASM disks...
Loading module "oracleasm": failed
Unable to load module "oracleasm"
最后发现,官网上给下载的是oracle linux的asm包。
那redhat 的怎么办呢?原来redhat的光碟自带有iso文件。
[root@erpp1 Server]# ls " grep oracleasm
oracleasm-2.6.18-274.el5-2.0.5-1.el5.x86_64.rpm
oracleasm-2.6.18-274.el5debug-2.0.5-1.el5.x86_64.rpm
oracleasm-2.6.18-274.el5xen-2.0.5-1.el5.x86_64.rpm
oracleasm-support-2.1.7-1.el5.x86_64.rpm
我就是下载了如下两个,rpm -ivh ,其余两个安装不了。
oracleasm-support-2.1.7-1.el5.x86_64.rpm
oracleasm-2.6.18-274.el5-2.0.5-1.el5.x86_64.rpm
[root@pri mnt]# cd /mnt
[root@pri mnt]# mkdir cdrom
[root@pri mnt]# mount /dev/cdrom /mnt/cdrom
mount: block device /dev/cdrom is write-protected, mounting read-only
发现还是不行。
将之前下载的64bit的oracleasmlib-2.0.4-1.el5.x86_64.rpm也上传上去,安装上。
也不行。尝试重启一下。
[root@erpp1 ~]# /usr/sbin/oracleasm createdisk data1 /dev/sdc1
Writing disk header: done
Instantiating disk: done
成功了。可能刚才直接重启也可以,不用加一个rpm包,也可能要。反正重启是必须的。
[root@erpp1 ~]# /usr/sbin/oracleasm createdisk data1 /dev/sdc1
Writing disk header: done
Instantiating disk: done
[root@erpp1 ~]# /usr/sbin/oracleasm createdisk data2 /dev/sdb1
Writing disk header: done
Instantiating disk: done
[root@erpp1 ~]# /usr/sbin/oracleasm createdisk data3 /dev/sdd1
Writing disk header: done
Instantiating disk: done
[root@erpp1 ~]# /usr/sbin/oracleasm createdisk data4 /dev/sde1
Writing disk header: done
Instantiating disk: done
[root@erpp1 ~]# /usr/sbin/oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@erpp1 ~]#
[root@erpp1 ~]# /usr/sbin/oracleasm listdisks 或者service oracleasm listdisks
DATA1
DATA2
DATA3
DATA4
有了这4个ASM盘后,开始装GI。
如果要删除 ASM磁盘可通过以下命令:
[root@node1 ~]#/etc/init.d/oracleasm deletedisk ASMDISK5