Friday, July 10, 2015

How To Setup ASM & ASMLIB On Native Linux Multipath Mapper disks

How To Setup ASM & ASMLIB On Native Linux Multipath Mapper disks

After installed and configured the Multipath, follow bellow:
 We installed proper oracleasm rpms
2. Check the disks :
[root@linux01 ~]#ls -l /dev/mapper
brw-rw---- 1 root disk 253, 46 Jul 27 17:19 Mpatha01
brw-rw---- 1 root disk 253, 67 Jul 27 17:59 Mpatha02
brw-rw---- 1 root disk 253, 36 Jul 27 17:19 Mpatha03
brw-rw---- 1 root disk 253, 58 Jul 27 18:00 Mpatha04
 Note: above disks are partitioned from Luns.
3. Create the ASMLIB disks on mapper partitions as follow:
[root@linux01 ~]# /etc/init.d/oracleasm createdisk DSKORA1  /dev/mapper/Mpatha01
[root@linux01 ~]# /etc/init.d/oracleasm createdisk DSKORA2  /dev/mapper/Mpatha02
After create the disks, the ASM put a mark on the disks to know which are your own.
 4. If this is a RAC configuration, then from each node execute:
[root@linux01 ~]# /etc/init.d/oracleasm scandisks
[root@linux01 ~]# /etc/init.d/oracleasm listdisks

5. Configure ASMLIB to use multipath  (from each node on RAC environments):
[root@linux01 grid]# /usr/sbin/oracleasm configure
ORACLEASM_ENABLED=true
ORACLEASM_UID=grid
ORACLEASM_GID=asmadmin
ORACLEASM_SCANBOOT=true
ORACLEASM_SCANORDER=" "
ORACLEASM_SCANEXCLUDE=" "
ORACLEASM_USE_LOGICAL_BLOCK_SIZE="false"

Note:  Now we have to update above two bold character parameters else ASM diskgroup creation or next ASM startup will not work properly for Disk Group.


Option1:
Modify in /etc/sysconfig/oracleasm :
ORACLEASM_SCANORDER=”dm”
ORACLEASM_SCANEXCLUDE=”sd”

Restart ASMLIB (from each node on RAC environments):
/etc/init.d/oracleasm stop
/etc/init.d/oracleasm start

Option2:
[root@linux01 grid]# /usr/sbin/oracleasm configure -i -e -u grid -g asmadmin -o "dm"  -x "sd"
[root@linux01 grid]# /usr/sbin/oracleasm exit
[root@linux01 grid]# /usr/sbin/oracleasm init
[root@linux01 grid]# /usr/sbin/oracleasm scandisks
[root@linux01 grid]# /usr/sbin/oracleasm configure
ORACLEASM_ENABLED=true
ORACLEASM_UID=grid
ORACLEASM_GID=asmadmin
ORACLEASM_SCANBOOT=true
ORACLEASM_SCANORDER="dm"
ORACLEASM_SCANEXCLUDE="sd"
ORACLEASM_USE_LOGICAL_BLOCK_SIZE="false"

6. Verify if the configuration is correct:
6.1 During the disk discovery, ASMLIB uses file /proc/partitions, see :
[root@linux01 grid]#  cat /proc/partitions
   8     0  877264896 sda
   8     1     104391 sda1
   8     2  877157032 sda2
   8    16  209715200 sdb
   8    32  382730240 sdc
   8    48  379596800 sdd
   8    64    2097152 sde
   8    80    2097152 sdf
   8    96 1169776640 sdg
 253     6  209715200 dm-6
 253     7  382730240 dm-7
 253     8  379596800 dm-8
 253     9    2097152 dm-9
 253    10    2097152 dm-10
6.2 The ASMLIB mount disks at /dev/oracleasm/disks, see:
# ls -la /dev/oracleasm/disks
brw-rw---- 1 grid asmadmin 2536 Ago 16 16:33 DSKORA1
brw-rw---- 1 grid asmadmin 2537 Ago 16 16:33 DSKORA2

6.3 Check if major and minor of disks “dm” not “sd”, is the same in /proc/partitions  and /dev/oracleasm/disks , see “253″ and “6″ bellow:
[root@linux01 grid]# cat /proc/partitions
253     6  209715200 dm-6
[root@linux01 grid]# ll /dev/oracleasm/disks
brw-rw---- 1 grid asmadmin 2536 Ago 16 16:33 DSKORA1

You can check using querydisk too :
[root@linux01 grid]#  /etc/init.d/oracleasm querydisk -d DSKORA1
Disk "DSKORA1" is valid ASM disk on device [253, 6]


No comments:

Post a Comment

Share your knowledge it really improves, don't show off...