.comment-link {margin-left:.6em;}

Tuesday, October 03, 2006

Setup de Linux para ASM (ASMLibs)

Instalação ASMLib

Vou até o /mnt/xp, onde já estão as bibliotecas do ASMLib e vou instalar de lá os rpms. Tenho que instalar como root.

[root@yoda mnt]# cd xp
[root@yoda xp]# rpm -Uvh \
> oracleasm-2.6.9-34.ELsmp-2.0.1-1.i686.rpm \
> oracleasmlib-2.0.1-1.i386.rpm \
> oracleasm-support-2.0.1-1.i386.rpm
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [ 33%]
2:oracleasm-2.6.9-34.ELsm########################################### [ 67%]
3:oracleasmlib ########################################### [100%]
[root@yoda xp]#
Configurando a biblioteca.
[root@yoda xp]# /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 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 []: 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: [ OK ]
Creating /dev/oracleasm mount point: [ OK ]
Loading module "oracleasm": [ OK ]
Mounting ASMlib driver filesystem: [ OK ]
Scanning system for ASM disks: [ OK ]
[root@yoda xp]#

Próximo passo é investigar quais serão os discos para serem criados no ASM, para isso vou usar o fdisk. No meu caso, eu deixei para plugar 2 discos depois da instalação por isso que no output abaixo, não encontramos os discos. Terei que ir ao VMWare e criar 2 novos discos, deixá-los sem formatação e agregá-los ao ASM.

[root@yoda ~]# fdisk -l

Disk /dev/sda: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 19 152586 83 Linux
/dev/sda2 20 522 4040347+ 8e Linux LVM

Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 261 2096451 82 Linux swap

Disk /dev/sdc: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdc1 * 1 522 4192933+ 8e Linux LVM

Disk /dev/sdd: 4939 MB, 4939212288 bytes
255 heads, 63 sectors/track, 600 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdd doesn't contain a valid partition table

Disk /dev/sde: 4939 MB, 4939212288 bytes
255 heads, 63 sectors/track, 600 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sde doesn't contain a valid partition table

Estou interessado nos dois últimos, veja que não existe partição, portanto vamos criar uma partição do disco inteiro para depois entregar o gerenciamento desses discos ao ASMLib, plugando discos na biblioteca. Vou criar dois volumes (VOL1 e VOL2), (*quando a instalação houver terminado, vou fazer testes deletando um dos discos no VMWare, isso simula um crash físico, ou seja, vamos testar o +ASM pra valer).
Com o fdisk, vamos criar uma partição por disco, toando o espaço todo e depois reboot.

[root@yoda ~]# fdisk /dev/sdd
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.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): p

Disk /dev/sdd: 4939 MB, 4939212288 bytes
255 heads, 63 sectors/track, 600 cylinders
Units = cylinders of 16065 * 512 = 8225280 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-600, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-600, default 600):
Using default value 600

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@yoda ~]# fdisk /dev/sde
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.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): p

Disk /dev/sde: 4939 MB, 4939212288 bytes
255 heads, 63 sectors/track, 600 cylinders
Units = cylinders of 16065 * 512 = 8225280 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-600, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-600, default 600):
Using default value 600

Command (m for help): p

Disk /dev/sde: 4939 MB, 4939212288 bytes
255 heads, 63 sectors/track, 600 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sde1 1 600 4819468+ 83 Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
Syncing disks.
[root@yoda ~]# shutdown -r 0
Criando os volumes.

[root@yoda ~]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdd1
Marking disk "/dev/sdd1" as an ASM disk: [ OK ]
[root@yoda ~]# /etc/init.d/oracleasm createdisk VOL2 /dev/sde1
Marking disk "/dev/sde1" as an ASM disk: [ OK ]
[root@yoda ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2

Tudo pronto e certo para instalação do ASM com Oracle 10g.

Labels:


Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?