http://pandarabbit.blog.163.com/blog/static/209284144201292293642857/
centos6.5桌面2.6.32
yum install kmod-oracleasm其实就是安装三个包,内核驱动也就是上面的包是基础,在官方网站可以下载oracleasm-support、oracleasmlib这两个包。
http://www.oracle.com/technetwork/server-storage/linux/downloads/index.html这个页面最下面For Database Administrators ASMLib: Linux Drivers for Automatic Storage Managementhttp://www.oracle.com/technetwork/server-storage/linux/asmlib/index-101839.html
http://oss.oracle.com/projects/oracleasm-support/dist/files/RPMS/rhel6/amd64/2.1.8/oracleasm-support-2.1.8-1.el6.x86_64.rpmhttp://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.4-1.el6.x86_64.rpm
点开页面的上方可以看到Library and Tools
这里可以下载oracleasm-support、oracleasmlib下面接着是Drivers for kernel N多版本的oracleasm安装包
使用uname -a判断系统内核的版本号使用root用户安装,这三个包之间有依赖关系,安装顺序如下:
rpm -ivh oracleasm-supportrpm -ivh oracleasmrpm -ivh oracleasmlibroot用户使用以下命令配置ASM:
/etc/init.d/oracleasm configure注意:直接使用oracleasm configure是不能配置ASM的!
[root@oracle ~]# /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 isloaded on boot and what permissions it will have. The current valueswill be shown in brackets ('[]'). Hitting <ENTER> without typing ananswer will keep that current value. Ctrl-C will abort.Default user to own the driver interface []: oracle
Default group to own the driver interface []: dbaStart Oracle ASM library driver on boot (y/n) [y]: yScan for Oracle ASM disks on boot (y/n) [y]: yWriting Oracle ASM library driver configuration: doneInitializing the Oracle ASMLib driver: [ OK ]Scanning the system for Oracle ASMLib disks: [ OK ] [root@oracle ~]# lsmod |grep asmoracleasm 54265 1[root@oracle ~]# oracleasm configure
ORACLEASM_ENABLED=trueORACLEASM_UID=oracleORACLEASM_GID=dbaORACLEASM_SCANBOOT=trueORACLEASM_SCANORDER=""ORACLEASM_SCANEXCLUDE=""ORACLEASM_USE_LOGICAL_BLOCK_SIZE="false"
[root@oracle log]# useradd oracle
[root@oracle log]# groupadd dba
[root@oracle log]# usermod -G dba oracle[root@oracle log]# id oracleuid=500(oracle) gid=500(oracle) groups=500(oracle),501(dba)事先还要准备空分区或磁盘供oracleasm调用。只有先创建相关用户后,下面的创建磁盘才会ok
[root@oracle log]# /etc/init.d/oracleasm createdisk hh /dev/sdb1
Marking disk "hh" as an ASM disk: [ OK ]报错日志可以看下面这个文件。
[root@oracle log]# cat /var/log/oracleasm
准备空盘或分区
fdisk /dev/sdb,分两个区
Device Boot Start End Blocks Id System
/dev/sdb1 1 262 2104483+ 83 Linux/dev/sdb2 263 524 2104515 83 Linux创建asm磁盘
[root@oracle log]# oracleasm createdisk aa /dev/sdb1Writing disk header: doneInstantiating disk: done[root@oracle log]# /etc/init.d/oracleasm createdisk bb /dev/sdb2Marking disk "bb" as an ASM disk: [ OK ]
==============================================================
20171030书写
[root@rac01 ~]# rpm -qa|grep oracleasmoracleasm-support-2.1.8-1.el6.x86_64oracleasmlib-2.0.4-1.el6.x86_64kmod-oracleasm-2.0.8-13.el6_8.x86_64=================================[root@rac01 ~]# rpm -ql kmod-oracleasm/etc/depmod.d/oracleasm.conf/lib/modules/2.6.32-642.el6.x86_64/lib/modules/2.6.32-642.el6.x86_64/extra/lib/modules/2.6.32-642.el6.x86_64/extra/oracleasm/lib/modules/2.6.32-642.el6.x86_64/extra/oracleasm/oracleasm.ko/usr/share/doc/kmod-oracleasm/greylist.txt===================================[root@rac01 ~]# rpm -ql oracleasmlib/opt/oracle/extapi/opt/oracle/extapi/64/opt/oracle/extapi/64/asm/opt/oracle/extapi/64/asm/orcl/opt/oracle/extapi/64/asm/orcl/1/opt/oracle/extapi/64/asm/orcl/1/libasm.so/usr/sbin/oracleasm-discover===========================[root@rac01 ~]# oracleasm-discoverUsing ASMLib from /opt/oracle/extapi/64/asm/orcl/1/libasm.so[ASM Library - Generic Linux, version 2.0.4 (KABI_V2)]Discovered disk: ORCL:ARCH [104853504 blocks (53684994048 bytes), maxio 512]Discovered disk: ORCL:DATA2 [188743680 blocks (96636764160 bytes), maxio 512]Discovered disk: ORCL:FLASH [209715200 blocks (107374182400 bytes), maxio 512]Discovered disk: ORCL:RACALL [167768064 blocks (85897248768 bytes), maxio 512][root@oracle grid]# oracleasm-discoverUsing ASMLib from /opt/oracle/extapi/64/asm/orcl/1/libasm.so[ASM Library - Generic Linux, version 2.0.4 (KABI_V2)]Discovered disk: ORCL:AA [4208967 blocks (2154991104 bytes), maxio 512]Discovered disk: ORCL:BB [4209030 blocks (2155023360 bytes), maxio 512]=============================[root@rac01 ~]# rpm -ql oracleasm-support/etc/init.d/oracleasm/etc/sysconfig/oracleasm/usr/lib/oracleasm/usr/lib/oracleasm/oracleasm-Xshlib/usr/lib/oracleasm/oracleasm-candidate-p/usr/lib/oracleasm/oracleasm_debug_link/usr/sbin/asmscan/usr/sbin/asmtool/usr/sbin/oracleasm/usr/share/doc/oracleasm-support-2.1.8/usr/share/doc/oracleasm-support-2.1.8/ReleaseNotes/usr/share/man/usr/share/man/man8/usr/share/man/man8/oracleasm-configure.8.gz==================================[root@rac01 ~]# man oracleasm-querydisk[root@rac01 ~]# oracleasm listdisks | xargs oracleasm querydisk -pDisk "ARCH" is a valid ASM disk/dev/mapper/mpathcp1: LABEL="ARCH" TYPE="oracleasm"Disk "DATA2" is a valid ASM disk/dev/mapper/mpathe: LABEL="DATA2" TYPE="oracleasm"Disk "FLASH" is a valid ASM disk/dev/mapper/mpathd: LABEL="FLASH" TYPE="oracleasm"Disk "RACALL" is a valid ASM disk/dev/mapper/mpathbp1: LABEL="RACALL" TYPE="oracleasm"[root@rac01 ~]# blkid/dev/mapper/vg_rac01-LogVol02: UUID="1c92cb5a-af5e-46e3-858b-944474c60499" TYPE="ext4"/dev/sda1: UUID="CDBD-4AB1" TYPE="vfat"/dev/sda2: UUID="6182f6de-645d-4674-a6b4-b4de256a6638" TYPE="ext4"/dev/sda3: UUID="4iYwsa-z301-oX2a-tfgC-Mtz2-ur8i-dlhK9l" TYPE="LVM2_member"/dev/mapper/vg_rac01-LogVol00: UUID="8d86f85f-e0e4-4aeb-b803-ee0438b88988" TYPE="swap"/dev/mapper/vg_rac01-LogVol01: UUID="e2bc7558-f88e-412c-8675-a277dd6a03d8" TYPE="ext4"/dev/mapper/mpathbp1: LABEL="RACALL" TYPE="oracleasm"/dev/mapper/mpathcp1: LABEL="ARCH" TYPE="oracleasm"/dev/mapper/mpathd: LABEL="FLASH" TYPE="oracleasm"/dev/mapper/mpathe: LABEL="DATA2" TYPE="oracleasm"/etc/init.d/oracleasm createdisk data1 /dev/mapper/mpathfiscsiadm -m node -R===============================存储层看到的卷名 data2卷标识 10容量 1.00 TiB卷唯一标识 6005076300810DF6F800000000000012操作系统层看到的[root@rac01 ~]# multipath -ll[root@rac01 ~]# multipath -llmpathe (36005076300810df6f800000000000009) dm-8 IBM,2145size=90G features='0' hwhandler='0' wp=rw|-+- policy='round-robin 0' prio=50 status=active| |- 7:0:0:3 sdk 8:160 active ready running| `- 8:0:0:3 sdm 8:192 active ready running`-+- policy='round-robin 0' prio=10 status=enabled |- 10:0:0:3 sdq 65:0 active ready running `- 9:0:0:3 sdp 8:240 active ready runningmpathd (36005076300810df6f80000000000000a) dm-7 IBM,2145size=100G features='0' hwhandler='0' wp=rw|-+- policy='round-robin 0' prio=50 status=active| |- 10:0:0:2 sdo 8:224 active ready running| `- 9:0:0:2 sdn 8:208 active ready running`-+- policy='round-robin 0' prio=10 status=enabled |- 7:0:0:2 sdj 8:144 active ready running `- 8:0:0:2 sdl 8:176 active ready runningmpathc (36005076300810df6f800000000000008) dm-4 IBM,2145size=50G features='0' hwhandler='0' wp=rw|-+- policy='round-robin 0' prio=50 status=active| |- 9:0:0:1 sdg 8:96 active ready running| `- 10:0:0:1 sdi 8:128 active ready running`-+- policy='round-robin 0' prio=10 status=enabled |- 7:0:0:1 sdf 8:80 active ready running `- 8:0:0:1 sdh 8:112 active ready runningmpathb (36005076300810df6f800000000000005) dm-3 IBM,2145size=80G features='0' hwhandler='0' wp=rw|-+- policy='round-robin 0' prio=50 status=active| |- 7:0:0:0 sdb 8:16 active ready running| `- 8:0:0:0 sdc 8:32 active ready running`-+- policy='round-robin 0' prio=10 status=enabled |- 9:0:0:0 sdd 8:48 active ready running `- 10:0:0:0 sde 8:64 active ready runningmpathf (36005076300810df6f800000000000012) dm-9 IBM,2145size=1.0T features='0' hwhandler='0' wp=rw|-+- policy='round-robin 0' prio=50 status=active| |- 7:0:0:4 sdr 65:16 active ready running| `- 8:0:0:4 sds 65:32 active ready running`-+- policy='round-robin 0' prio=10 status=enabled |- 9:0:0:4 sdt 65:48 active ready running `- 10:0:0:4 sdu 65:64 active ready running