Showing posts with label storage. Show all posts
Showing posts with label storage. Show all posts

Tuesday, February 23, 2010

Oracle Database 11gr2 - MEMORY_TARGET e /dev/shm

Olá,

Continuando os testes com o Oracle Database 11gr2 conforme o tempo livre que tenho,fiz alguns testes diminuindo a quantidade de memória RAM da VM .Como estava com o Oracle Restart habilitado,após subir o servidor de banco de dados logo teria os serviços disponíveis para uso.

[oracle@marte ~]$
[oracle@marte ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1
[oracle@marte ~]$ echo $ORACLE_SID
dbpost
[oracle@marte ~]$ ps -ef|grep pmon
oracle    2997     1  0 08:42 ?        00:00:00 asm_pmon_+ASM
oracle    3118     1  0 08:43 ?        00:00:00 ora_pmon_dbpost
oracle    4083  3444  0 09:58 pts/2    00:00:00 grep pmon
[oracle@marte ~]$ ps -ef|grep tns
oracle    2908     1  0 08:41 ?        00:00:00 /u01/app/oracle/product/11.2.0/grid/bin/tnslsnr LISTENER -inherit
oracle    4086  3444  0 09:59 pts/2    00:00:00 grep tns
[oracle@marte ~]$


Bom parece que o banco de dados está disponível

[oracle@marte ~]$
[oracle@marte ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 23 10:02:19 2010

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

idle on 23-FEB-10 >
idle on 23-FEB-10 >select * from v$instance;
select * from v$instance
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0

Elapsed: 00:00:00.17
idle on 23-FEB-10 >


Há algo errado.

Vamos ao alert log

[oracle@marte /]$ cd /u01/app/oracle/diag/rdbms/dbpost/dbpost/alert/
[oracle@marte alert]$ ls -ltrh
total 6.6M
-rw-r----- 1 oracle dba 6.6M Feb 23 09:36 log.xml
[oracle@marte alert]$
[oracle@marte alert]$ tail -20f log.xml
</msg>
<msg time='2010-02-23T09:36:06.048-02:00' org_id='oracle' comp_id='rdbms'
 msg_id='opistr_real:935:3971575317' type='NOTIFICATION' group='startup'
 level='16' host_id='marte' host_addr='127.0.0.1'
 pid='3479'>
 <txt>Starting ORACLE instance (normal)
 </txt>
</msg>
<msg time='2010-02-23T09:36:06.075-02:00' org_id='oracle' comp_id='rdbms'
 type='UNKNOWN' level='16' host_id='marte'
 host_addr='127.0.0.1' pid='3479'>
 <txt>WARNING: You are trying to use the MEMORY_TARGET feature. This feature requires the /dev/shm file system to be mounted for at least 536870912 bytes. /dev/shm is either not mounted or is mounted with available space less than this size. Please fix this so that MEMORY_TARGET can work as expected. Current available is 322220032 and used is 474198016 bytes. Ensure that the mount point is /dev/shm for this directory.
 </txt>
</msg>
<msg time='2010-02-23T09:36:06.092-02:00' org_id='oracle' comp_id='rdbms'
 type='UNKNOWN' level='16' host_id='marte'
 host_addr='127.0.0.1' pid='3479'>
 <txt>memory_target needs larger /dev/shm
 </txt>
</msg>


Analisando o erro acima vamos ver o filesystem /dev/shm

[root@marte /]# df -Ph
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              23G   15G  6.7G  70% /
tmpfs                 760M  453M  308M  60% /dev/shm

[root@marte /]# cat /proc/meminfo
MemTotal:      1555508 kB
MemFree:        315880 kB
Buffers:         64700 kB
Cached:         968316 kB
SwapCached:          0 kB
Active:         423800 kB
Inactive:       769132 kB
HighTotal:      655296 kB
HighFree:         1168 kB
LowTotal:       900212 kB
LowFree:        314712 kB
SwapTotal:     1574360 kB
SwapFree:      1574360 kB
Dirty:             468 kB
Writeback:           0 kB
AnonPages:      159928 kB
Mapped:          91568 kB
Slab:            29760 kB
PageTables:       9068 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
CommitLimit:   2352112 kB
Committed_AS:  1866740 kB
VmallocTotal:   114680 kB
VmallocUsed:      3280 kB
VmallocChunk:   111252 kB
HugePages_Total:     0
HugePages_Free:      0
HugePages_Rsvd:      0
Hugepagesize:     4096 kB
[root@marte /]#


Vamos ver o tamanho alocado no paramtreo MEMORY_TARGET :

[oracle@marte /]$ cd $ORACLE_HOME/dbs
[oracle@marte dbs]$ vi initdbpost.ora
...

*.memory_target=512m
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'


Ok.

O erro está ocorrendo porque não temos 512MB disponíveis no /dev/shm .Isto ocorre porque como não configurei o /dev/shm e tenho somente 1536MB de RAM alocado para esta VM.

Vou retirar totalmente o banco de dados dbpost do Oracle Restart :

[oracle@marte dbs]$ cd /
[oracle@marte /]$ srvctl disable database -d dbpost
[oracle@marte /]$

[root@marte /]# ps -ef|grep pmon
oracle    2997     1  0 08:42 ?        00:00:00 asm_pmon_+ASM
root      4774  4362  0 11:39 pts/2    00:00:00 grep pmon
[root@marte /]#

Para efeito de testes não quero alterar o tamanho da memória RAM.Vamos alterar o /dev/shm  que ainda está com valores default no meu SO.

Pode-se fazer via comando direto no shell/terminal,mas no caso para ficar definitivo após o boot vou colocá-lo no /etc/fstab .

root@marte /]# cat /etc/fstab
LABEL=/                 /                       ext3    defaults        1 1
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
LABEL=SWAP-sda2         swap                    swap    defaults        0 0
[root@marte /]#

Fazendo o remount do /dev/shm

[root@marte /]# mount -o remount,size=1G /dev/shm
[root@marte /]#

Alocando o espaço para ficar disponível na inicialização do sistema :

[root@marte /]# vi /etc/fstab

[root@marte /]# cat /etc/fstab
LABEL=/                 /                       ext3    defaults        1 1
tmpfs                   /dev/shm                tmpfs   defaults,size=1024m,auto        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
LABEL=SWAP-sda2         swap                    swap    defaults        0 0
[root@marte /]#

 reboot :

[root@marte /]# shutdown -r now


Broadcast message from root (pts/2) (Tue Feb 23 11:50:40 2010):


The system is going down for reboot NOW!
[root@marte /]#

Curiosidade  - Oracle Restart em ação
[root@marte ~]# tail -f /var/log/messages
Feb 23 11:52:34 localhost smartd[2568]: Device: /dev/sde, IE (SMART) not enabled, skip device Try 'smartctl -s on /dev/sde' to turn on SMART features
Feb 23 11:52:34 localhost smartd[2568]: Unable to register SCSI device /dev/sde at line 36 of file /etc/smartd.conf
...
Feb 23 11:52:37 localhost pcscd: winscard.c:219:SCardConnect() Reader E-Gate 0 0 Not Found
Feb 23 11:52:37 localhost last message repeated 3 times
Feb 23 11:52:38 localhost /u01/app/oracle/product/11.2.0/grid/bin/crswrapexece.pl[2552]: executing "/u01/app/oracle/product/11.2.0/grid/bin/ohasd.bin reboot"

Após o boot total,vamos tentar subir a instance dbpost.

Abaixo podemos ver que o /dev/shm está com a tamanho que foi colocado no /etc/fstab

[root@marte ~]# df -Ph
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              23G   15G  6.7G  70% /
tmpfs                 1.0G  154M  871M  16% /dev/shm
[root@marte ~]#

Startup no dbpost :

[oracle@marte dbs]$ ps -ef|grep pmon
oracle    2994     1  0 11:53 ?        00:00:00 asm_pmon_+ASM
oracle    3124  2948  0 12:00 pts/2    00:00:00 grep pmon
[oracle@marte dbs]$ strings spfiledbpost.ora |grep memory
*.memory_target=512m
[oracle@marte dbs]$ srvctl start database -d dbpost -o open
PRCR-1079 : Failed to start resource ora.dbpost.db
CRS-2501: Resource 'ora.dbpost.db' is disabled
[oracle@marte dbs]$
[oracle@marte dbs]$
[oracle@marte dbs]$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1
[oracle@marte dbs]$ echo $ORACLE_SID
dbpost
[oracle@marte dbs]$ sqlplus "/ as sysdba"


SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 23 12:03:58 2010


Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to an idle instance.


idle on 23-FEB-10 >startup nomount ;
ORACLE instance started.


Total System Global Area  535662592 bytes
Fixed Size                  1337720 bytes
Variable Size             364906120 bytes
Database Buffers          163577856 bytes
Redo Buffers                5840896 bytes
idle on 23-FEB-10 >alter database mount ;


Database altered.


Elapsed: 00:00:05.45
idle on 23-FEB-10 >alter database open;


Database altered.


Elapsed: 00:00:22.07
idle on 23-FEB-10 >exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@marte dbs]$ sqlplus "/ as sysdba"


SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 23 12:05:57 2010


Copyright (c) 1982, 2009, Oracle.  All rights reserved.



Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options


sys@DBPOST on 23-FEB-10 >select open_mode from v$database ;


OPEN_MODE
--------------------
READ WRITE


Elapsed: 00:00:00.03
sys@DBPOST on 23-FEB-10 >exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
[oracle@marte dbs]$


Links para maiores informações :


http://www.oracle-base.com/articles/linux/LargeSGAOnLinux.php


metalink.oracle.com/ - Note ID 260152.1


Abs,

Júlio César Corrêa



Tuesday, February 02, 2010

Openfiler Storage Control Center – Gerenciandor de NAS/SAN – Part 2



Local de download de software/arquivos  do posts  :

http://rpm.pbone.net


IMPORTANTE :
Devido a falta de tempo hábil para testar o Openfiler e elaborar o post há alguns passos em que a data de execução são diferentes .Porém os passos seguidos estão na ordem correta.

Configuração do host cliente do Openfiler


Foi usado uma vm com  OEL 5 com kernel 2.6.18-53.el5 .

Subindo instance ASM no host jamaica :



No outro terminal acessando como root :

Acima vemos que existe 4 volumes na instance ASM.Ao final do post teremos o 5º volume chamado VOL5 disponível para o ASM.

Verificando a versão do kernel do Linux para poder instalar o pacote iscsi-initiator-utils :

[root@jamaica ~]# uname -r
2.6.18-53.el5
[root@jamaica ~]#


Para vermos se o pacote está instalado usamos :
[root@jamaica ~]#  rpm -qa | grep iscsi
[root@jamaica ~]#

No caso acima o pacote não está instalado.Então vamos instalá-lo .

Levei o pacote cia WinSCP para o diretorio /root do servidor jamaica.


[root@jamaica ~]# pwd
/root
[root@jamaica ~]# ls -l |grep iscsi
-rw-r--r-- 1 root root 791713 Jan 28  2010 iscsi-initiator-utils-6.2.0.871-0.10.el5.i386.rpm
[root@jamaica ~]#


Instalando o pacote :

[root@jamaica ~]# rpm -ivh iscsi-initiator-utils-6.2.0.871-0.10.el5.i386.rpm
warning: iscsi-initiator-utils-6.2.0.871-0.10.el5.i386.rpm: Header V3 DSA signat
Preparing...                ########################################### [100%]
   1:iscsi-initiator-utils  ########################################### [100%]
[root@jamaica ~]#

Vamos subir o serviço :

[root@jamaica ~]# service iscsid start
Turning off network shutdown. Starting iSCSI daemon:       [  OK  ]
                                                           [  OK  ]
[root@jamaica ~]#

Vamos desabilitar o SELinux para o daemon do iscsi ativar as transações para ficar pendentes após os reboot.


[root@jamaica ~]# setsebool -P iscsid_disable_trans=1
setsebool:  SELinux is disabled.
[root@jamaica ~]#

No meu caso o SELinux está desabilitado como mostra a mensagem acima.

Editei o /etc/hosts do servidor jamaica para enchergar o servidor do openfiler já que não estou usando servidor de DNS. :

[root@jamaica ~]# vi /etc/hosts
[root@jamaica ~]# ping netuno
PING netuno.riversideti.com.br (192.168.79.140) 56(84) bytes of data.
64 bytes from netuno.riversideti.com.br (192.168.79.140): icmp_seq=1 ttl=64 time=2.83 ms
64 bytes from netuno.riversideti.com.br (192.168.79.140): icmp_seq=2 ttl=64 time=0.170 ms

--- netuno.riversideti.com.br ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.170/1.504/2.838/1.334 ms

Aproveitando fiz o mesmo no servidor do openfiler :

[root@netuno ~]# ping 192.168.79.130
PING 192.168.79.130 (192.168.79.130) 56(84) bytes of data.
64 bytes from 192.168.79.130: icmp_seq=0 ttl=64 time=1.08 ms
64 bytes from 192.168.79.130: icmp_seq=1 ttl=64 time=0.236 ms
^C
--- 192.168.79.130 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1004ms
rtt min/avg/max/mdev = 0.236/0.658/1.081/0.423 ms, pipe 2
[root@netuno ~]#


Configuração do storage via Openfiler Storage Control Center 


No Openfiler você pode gerenciar vários tipos de dispositivos.
No nosso caso iremos habilitar o serviço iSCSI .

Na aba SERVICES do Storage Control Center podemos habilitar o serviço.



Certifique-se que o serviço iSCISI initiator está ativo como na imagem acima.

Pelo terminal também é possível ver se o serviço está ativo.Com o usuário root :

[root@netuno ~]# service iscsi-target status
ietd (pid 3214) is running...
[root@netuno ~]#


Configurando o acesso ao Openfiler  

Nesta seção podemos configurar os hosts que irão acessar o Storage.

Navegando na aba System no final da página tem a opção :

Network Access Configuration


É uma interface simples de configurar.Entre com o o nome do  host,IP,mascara de sub-redee  tipo de acesso.Após preencher a informação clique em "update" para gravar.

Obs. Se errou em algo selecione na check box o host a ser alterado troque a informação nos campos em branco abaixo e clique em update novamente.

No caso deixei o meu desta forma :

Physical Storage :

Lembro-me que falei ter adicionado dois discos a minha vmware e no caso posso enchergá-los por meio da aba Volumes  e depois na barra lateral direita em Block Devices  :




Particionamento dos discos físicos 


Faremos a mesma coisa que usar o fdisk /dev/sd* no Linux porém usando a interface de gerenciamento do Openfiler.

Na mesma aba Volumes > Block Devices  selecionaremos o disco a ser particionado .



No final da pagina temos a opção de criar uma partição tradicional primária ou uma partição para o RAID.



No caso vamos criar particões tradicionais .O RAID fica pra outra oportunidade.Mas com certeza iremos fazer RAID 1 e depois um RAID 0.Nada de RAID 5!


É só clicar em create :



Vamos fazer o mesmo para o disco /dev/sdb*  :



Acima podemos ver que os dispositivos /dev/sd* aparecem com uma partição cada.


Gerenciamento de Volume Group


Há termos que fica esquisito traduzir.Então para gerenciar Volume Groups vamos até a aba Volumes do Control Center.



Acima podemos ver que as nossas partições já aparecem disponíveis para fazer parte de um novo Volume Group.


Para criar um volume selecionamos as partições e e efetivamos no botão "Add volume group" .

Vou criar com o nome de VOL_OCADB01 que é o nome da instância que mais a frente irá utilizar este volume.



Aqui o volume já criado :



No link View member PV's você pode verificar quais Physical Volume faz parte do Volume Group em questão,no meu caso o vol_ocadb01 .


Logical Volumes 


Este conceito mostra que dentro do nosso Volume Group vol_ocadb01 podemos por exemplo criar vários volumes lógicos como OCR disks ,Voting Disks (ambos raw devices) e discos de formato padrão ( Block Devices) para o ASM por exemplo  em um ambiente RAC .

No caso irei criar discos  para utilizar na minha instância ASM .Como no host jamaica onde se encontra a instance ASM usamos ASMLib não precisarei criar do tipo  Raw .

Na aba Volumes temos uma tela estranha informando "No existing volumes were found in this volume group" .Está informando que não temos volume lógicos criados em cima deste volume group .Na verdade o volume group funciona como um RAID 0.


Na mesma aba porém na barra lateral direita entre em "Add Volume" .Irá aparecer a tela abaixo :








Os detalhes da tela de  criação :




Temos disponíveis 10176 MB em nosso Volume Group e no caso vamos  criar dois Logical Volumes de 3 GB do tipo iSCSI.E deixar os 6GB restantes no Volume Group para outros fins .




Ao termino a nossa tela de controle ficou assim :






Na mesma aba Volume siga até a  barra lateral direita e clique em  iSCSI Targets :




Esta é a area de gerenciamento dos Target IQN's .

O Target IQN é muito importante.Ele funciona como um identificador de recursos no nosso caso discos entregues aos clients(hosts como um servidor de banco de dados).Porém você pode ter multiplos Target IQN's e associá-los  a LUN's específicas,Network ACL e CHAP Autentication.

Exemplo:


O Target IQN " iqn.2006-01.com.openfiler:tsn.6b5a9bb26b3f" da imagem acima  está associado a outros itens com as LUN's da aba ao lado LUN Mapping .

Note que nesta aba você tem o LUN Path o modo de Leitura e Escrita R/W Mode ,o Transfer Mode e o local de Map e Unmap .

Em networking ACL temos a opção de associar os hosts clientes ao nosso Target IQN e finalmente as LUN's .Podendo especificar o acesso "Allow" ou "Deny" .Para poder ter acesso deixe em Allow !!



Em CHAP Authentication você pode especificar o usuário e senha que fará acesso ao Storage.



No meu caso configurei o usuário jamaica com o mesmo nome para senha.

Agora posso disponibilizar estes discos para o host jamaica onde está o ASM.


No host jamaica vamos fazer os devidos acertos para ter acesso aos novos discos :

Editar o arquivo /etc/iscsi/iscsid.conf e localize o trecho abaixo.Tomar cuidado pois os parâmetros são muito parecidos.

# To enable CHAP authentication set node.session.auth.authmethod
# to CHAP. The default is None.
node.session.auth.authmethod = CHAP
# To set a CHAP username and password for initiator
# authentication by the target(s), uncomment the following lines:
node.session.auth.username = coloque_a_senha_definida_no_CHAP_Authentication
node.session.auth.password = tcoloque_o_usuario_definido_no_CHAP_Authentication

# To enable CHAP authentication for a discovery session to the target
# set discovery.sendtargets.auth.authmethod to CHAP. The default is None.
discovery.sendtargets.auth.authmethod = CHAP
# To set a discovery session CHAP username and password for the initiator
# authentication by the target(s), uncomment the following lines:
discovery.sendtargets.auth.username = coloque_a_senha_definida_no_CHAP_Authentication
discovery.sendtargets.auth.password = coloque_o_usuario_definido_no_CHAP_Authentication

Salve o arquivo.

Outro detalhe :

Na pasta  /etc/iscsi existe um outro arquivo  initiatorname.iscsi com o ID do cliente que mais a frente será visualizado ao final do post.

Após isto execute os comandos abaixo e observe se a saída exibida é semelhante a esta :

Obs. netuno é o hostname e 192.168.79.140 é o IP .


 chkconfig iscsid on


 chkconfig iscsi on


[root@jamaica iscsi]# service iscsi restart
Stopping iSCSI daemon:
iscsid dead but pid file exists                            [  OK  ]
Turning off network shutdown. Starting iSCSI daemon:       [  OK  ]
                                                           [  OK  ]
Setting up iSCSI targets: iscsiadm: No records found!
                                                           [  OK  ]


[root@jamaica iscsi]# iscsiadm -m discovery -t sendtargets -p 192.168.79.140
192.168.79.140:3260,1 iqn.2006-01.com.openfiler:tsn.6b5a9bb26b3f
[root@jamaica iscsi]# service iscsi restart
Stopping iSCSI daemon:
iscsid dead but pid file exists                            [  OK  ]
Turning off network shutdown. Starting iSCSI daemon:       [  OK  ]
                                                           [  OK  ]
Setting up iSCSI targets: Logging in to [iface: default, target: iqn.2006-01.com.openfiler:tsn.6b5a9bb26b3f, por                                              tal: 192.168.79.140,3260]
Login to [iface: default, target: iqn.2006-01.com.openfiler:tsn.6b5a9bb26b3f, portal: 192.168.79.140,3260]: succ                                              essful
                                                           [  OK  ]
[root@jamaica iscsi]# fdisk -l

Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3067    24635646   83  Linux
/dev/sda2            3068        3263     1574370   82  Linux swap / Solaris

Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1305    10482381   83  Linux

Disk /dev/sdc: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        1305    10482381   83  Linux

Disk /dev/sdd: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1        1305    10482381   83  Linux

Disk /dev/sde: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1        1305    10482381   83  Linux

Disk /dev/sdf: 3221 MB, 3221225472 bytes
100 heads, 62 sectors/track, 1014 cylinders
Units = cylinders of 6200 * 512 = 3174400 bytes

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

Disk /dev/sdg: 3221 MB, 3221225472 bytes
100 heads, 62 sectors/track, 1014 cylinders
Units = cylinders of 6200 * 512 = 3174400 bytes

Disk /dev/sdg doesn't contain a valid partition table
[root@jamaica iscsi]#
[root@jamaica iscsi]#


Problemas encontrados durante a instalação e configuração


 Openfiler Stoage Control Center

- Tive alguns problemas para acessar a interface do Control Center mas fui verificar e era o meu navegador,o Chrome.No Firefox funcionava parcial e o que consegui que funcionasse melhor foi no IE.


- Há telas/abas que são mostradas no Administration Guide do Openfiler 2.3 que sinceramente ainda não encontrei na minha instalação.


- Deu trabalho para alterar a senha de Administrador.O usuário Administrador default  é "Openfiler" e sua senha é "Password" .

Target IQN



- Problemas na hora de criar o Target IQN .De inicio ele não funcionou.Tive que excluir e criar novamente.Então funcionou Ok.


- O client não conseguia mapear automaticamente o Target IQN quando no Storage só existia um Target IQN assoaciado ao Host.Depois de criar o segundo Target IQN ele começa a mapear.Na documentação do Openfiler não fala nada disso,aliás a documentação é uma apresentação da interface gráfica e não uma explicação de como funciona cada item dentro do sistema

Processos 


- Processos iscsid presos no Linux.Lembra o oc4j

Outros comandos :

- Add um target manualmente

iscsiadm -m node -p 192.168.79.140:3260 -T iqn.2006-01.com.openfiler:tsn.f4c81f9a34dd -o new

- Del um target manualmente

iscsiadm -m node -p 192.168.79.140:3260 -T iqn.2006-01.com.openfiler:tsn.f4c81f9a34dd -o delete



Outros testes executados 


Realizei um teste sem utilizar autenticação via CHAP.

[root@jamaica nodes]# service iscsi restart
Stopping iSCSI daemon:
iscsid dead but pid file exists                            [  OK  ]
Turning off network shutdown. Starting iSCSI daemon:       [  OK  ]
                                                           [  OK  ]
Setting up iSCSI targets: iscsiadm: No records found!
                                                           [  OK  ]
[root@jamaica nodes]# iscsiadm --mode discovery --type sendtargets --portal 192.168.79.140:3260
192.168.79.140:3260,1 iqn.2006-01.com.openfiler:tsn.552ec603e663
[root@jamaica nodes]# service iscsi restart
Stopping iSCSI daemon:
iscsid dead but pid file exists                            [  OK  ]
Turning off network shutdown. Starting iSCSI daemon:       [  OK  ]
                                                           [  OK  ]
Setting up iSCSI targets: Logging in to [iface: default, target: iqn.2006-01.com.openfiler:tsn.552ec603e663, portal: 192.168.                                79.140,3260]
Login to [iface: default, target: iqn.2006-01.com.openfiler:tsn.552ec603e663, portal: 192.168.79.140,3260]: successful
                                                           [  OK  ]
[root@jamaica nodes]# fdisk -l

Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3067    24635646   83  Linux
/dev/sda2            3068        3263     1574370   82  Linux swap / Solaris

Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1305    10482381   83  Linux

Disk /dev/sdc: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        1305    10482381   83  Linux

Disk /dev/sdd: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1        1305    10482381   83  Linux

Disk /dev/sde: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1        1305    10482381   83  Linux

Disk /dev/sdf: 3221 MB, 3221225472 bytes
100 heads, 62 sectors/track, 1014 cylinders
Units = cylinders of 6200 * 512 = 3174400 bytes

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

Disk /dev/sdg: 3221 MB, 3221225472 bytes
100 heads, 62 sectors/track, 1014 cylinders
Units = cylinders of 6200 * 512 = 3174400 bytes

Disk /dev/sdg doesn't contain a valid partition table
[root@jamaica nodes]#


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


Fiz vários testes adicionando Targets IQN's e retirando para testar o initiator do host client.
O que realmente ajuda é monitorar o /var/log/messages :

Jan 31 06:13:51 jamaica iscsid: iscsid shutting down.
Jan 31 06:13:51 jamaica kernel: Loading iSCSI transport class v2.0-724.
Jan 31 06:13:51 jamaica kernel: iscsi: registered transport (tcp)
Jan 31 06:13:51 jamaica kernel: iscsi: registered transport (iser)
Jan 31 06:13:51 jamaica iscsid: iSCSI logger with pid=15584 started!
Jan 31 06:13:51 jamaica kernel: scsi22 : iSCSI Initiator over TCP/IP
Jan 31 06:13:52 jamaica kernel:   Vendor: OPNFILER  Model: VIRTUAL-DISK      Rev: 0
Jan 31 06:13:52 jamaica kernel:   Type:   Direct-Access                      ANSI SCSI revision: 04
Jan 31 06:13:52 jamaica kernel: SCSI device sdf: 6291456 512-byte hdwr sectors (3221 MB)
Jan 31 06:13:52 jamaica kernel: sdf: Write Protect is off
Jan 31 06:13:52 jamaica kernel: SCSI device sdf: drive cache: none
Jan 31 06:13:52 jamaica kernel: SCSI device sdf: 6291456 512-byte hdwr sectors (3221 MB)
Jan 31 06:13:52 jamaica kernel: sdf: Write Protect is off
Jan 31 06:13:52 jamaica kernel: SCSI device sdf: drive cache: none
Jan 31 06:13:52 jamaica kernel:  sdf: unknown partition table
Jan 31 06:13:52 jamaica kernel: sd 22:0:0:0: Attached scsi disk sdf
Jan 31 06:13:52 jamaica kernel: sd 22:0:0:0: Attached scsi generic sg5 type 0
Jan 31 06:13:52 jamaica kernel:   Vendor: OPNFILER  Model: VIRTUAL-DISK      Rev: 0
Jan 31 06:13:52 jamaica kernel:   Type:   Direct-Access                      ANSI SCSI revision: 04
Jan 31 06:13:52 jamaica kernel: SCSI device sdg: 6291456 512-byte hdwr sectors (3221 MB)
Jan 31 06:13:52 jamaica kernel: sdg: Write Protect is off
Jan 31 06:13:52 jamaica kernel: SCSI device sdg: drive cache: none
Jan 31 06:13:52 jamaica kernel: SCSI device sdg: 6291456 512-byte hdwr sectors (3221 MB)
Jan 31 06:13:52 jamaica kernel: sdg: Write Protect is off
Jan 31 06:13:52 jamaica kernel: SCSI device sdg: drive cache: none
Jan 31 06:13:52 jamaica kernel:  sdg: unknown partition table
Jan 31 06:13:52 jamaica kernel: sd 22:0:0:1: Attached scsi disk sdg
Jan 31 06:13:52 jamaica kernel: sd 22:0:0:1: Attached scsi generic sg6 type 0
Jan 31 06:13:52 jamaica iscsid: transport class version 2.0-724. iscsid version 2.0-871
Jan 31 06:13:52 jamaica iscsid: iSCSI daemon with pid=15585 started!
Jan 31 06:13:52 jamaica iscsid: connection1:0 is operational now

Finalização

Agora para finalizar o post vou fazer um fdisk no discos mapeados e criar um diskgroup no ASM .

Para quem não conhece observe a seqüencia de comandos :

Particionamento dos discos

[root@jamaica nodes]# fdisk /dev/sdf
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): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): d
No partition is defined yet!

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1014, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1014, default 1014):
Using default value 1014

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

Calling ioctl() to re-read partition table.
Syncing disks.
[root@jamaica nodes]# fdisk /dev/sdg
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): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1014, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1014, default 1014):
Using default value 1014

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

Calling ioctl() to re-read partition table.
Syncing disks.
[root@jamaica nodes]# fdisk -l

Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3067    24635646   83  Linux
/dev/sda2            3068        3263     1574370   82  Linux swap / Solaris

Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1305    10482381   83  Linux

Disk /dev/sdc: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        1305    10482381   83  Linux

Disk /dev/sdd: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1        1305    10482381   83  Linux

Disk /dev/sde: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1        1305    10482381   83  Linux

Disk /dev/sdf: 3221 MB, 3221225472 bytes
100 heads, 62 sectors/track, 1014 cylinders
Units = cylinders of 6200 * 512 = 3174400 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1               1        1014     3143369   83  Linux

Disk /dev/sdg: 3221 MB, 3221225472 bytes
100 heads, 62 sectors/track, 1014 cylinders
Units = cylinders of 6200 * 512 = 3174400 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdg1               1        1014     3143369   83  Linux
[root@jamaica nodes]#






Criação dos discos para a instance  ASM


[root@jamaica nodes]#
[root@jamaica nodes]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
VOL4
[root@jamaica nodes]# /etc/init.d/oracleasm createdisk VOL5 /dev/sdf
Marking disk "VOL5" as an ASM disk:                        [FAILED]
[root@jamaica nodes]#
[root@jamaica nodes]#
[root@jamaica nodes]#
[root@jamaica nodes]#
[root@jamaica nodes]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
VOL4
[root@jamaica nodes]# /etc/init.d/oracleasm createdisk VOL5 /dev/sdf1
Marking disk "VOL5" as an ASM disk:                        [  OK  ]
[root@jamaica nodes]#
[root@jamaica nodes]# /etc/init.d/oracleasm createdisk VOL6 /dev/sdg1
Marking disk "VOL6" as an ASM disk:                        [  OK  ]
[root@jamaica nodes]#
[root@jamaica nodes]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
VOL4
VOL5
VOL6
[root@jamaica nodes]#

Finalizo por aqui.Espero poder ajudar na introdução ao Openfiler.
Vou continuar testando este produto e quando tiver mais algumas novidades volto a postar aqui.

Já estou pensando em posts sobre RAID usando Openfiler!O que seria bem interessante!

Att,

Julio Cesar Correa


Monday, January 25, 2010

Instalação e overview do Openfiler – Gerenciador de NAS/SAN – Part 1

O objetivo deste post é mostrar a instalação do Openfiler em uma máquina virtual.
Nos próximos posts irei colocar como funciona o gerenciamento do storage através da sua interface web .

Abaixo os locais de download do software usado neste post.

Download  em :

http://sourceforge.net/projects/openfiler/

Site oficial:

http://www.openfiler.com/

Wiki:

http://en.wikipedia.org/wiki/Openfiler


Introdução ao Openfiler

O Openfiler é na verdade um sistema operacional baseado na distribuição rPath Linux .Outra coisa interessante é o fato de ele ser open source e licenciado via licença GPL.
O Openfiler desempenha a função de um gerenciador de Storage NAS/SAN que é pode ser muito útil principalmente para os nossos testes com o Oracle.
Ele suporta NFS, SMB/CIFS, HTTP/WebDAV, FTP and iSCSI (initiator and target).Mais informações sobre suporte no site oficial do produto.
Para podermos fazer uso deste storage em nossos hosts servidores de banco de dados devemos ter configurado o pacote iSCSI.Para Red Hat ou similar temos o pacote iscsi-initiator-utils
e para Solaris temos os pacotes SUNWiscsi e SUNWiscsiu.


Criação da máquina virtual

Crie uma máquina virtual e aponte o CD-ROM para a imagem ISO do Openfiler .

clip_image002


Iniciando a instalação




clip_image004

Como podemos ver o Openfiler também roda em cima de um Linux:

clip_image006

Vamos fazer o test da mídia:

clip_image008

clip_image010

clip_image012

clip_image014

Obs.
Se aparecer algum erro dizendo que o CD-ROM não está montado ,verique se ele está com status conectado a vm.

clip_image016

clip_image018

clip_image020

clip_image022

clip_image024

clip_image026
Obs.O partionamento manual é opcional.
clip_image028

Ativando o swap .Clique em Yes.

clip_image030



Configuração de rede 

Edite a sua interface de rede.

clip_image032

clip_image034

clip_image036

clip_image038

clip_image040

clip_image042

Dependendo da quantidade de memória do host onde a instalação está sendo feita ou caso deseje usar como servidor virtualizado como no meu caso a instalação pode demorar um pouco.

clip_image044

clip_image046

clip_image048

Este foi o post sobre instalação do Openfiler.

No próximo post vamos acessar a interface de gerenciamento , criar os VG's e LV's e conceder permissão de acesso aos hosts que irão usar os LV's .

Este era para ser o segundo post...



Depois de instalar o Openfiler podemos tanto gerenciar através da sua interface gráfica via web(HTTPS) .
Há várias opções de linha de comandos no sistema do Openfiler ao longo dos posts vou deixar mais informações.
Iniciando a interface web : https://192.168.79.140:446/

clip_image002

Credenciais


O usuário default é openfiler e a senha é password.Você também consegue logar como root,mas não terá acesso ao Openfile Storage Control Center .
Após iniciar com o usuário padrão você pode trocar a senha e gerenciar os privilégios .

clip_image004

Abaixo o acesso ao sistema gerenciador do storage.

clip_image006

De cara vamos alterar a senha do usuário openfiler .
Visualizando a imagem acima siga até a aba Accounts,depois procure na barra lateral direita a opção Admin Password :













Prestar bastante atenção na barra de status do navegados pois ele não informa nenhuma mensagem de "senha alterada com sucesso".Pelo menos eu não achei!

Eu adicionei 2 discos a minha VM do Openfiler .No caso quero disponibilizar estes discos para uma instancia ASM de um dos meus servidores com Red Hat.Temos um trabalho a fazer que é instalar os pacotes iscsi no Red Hat.

Vou dividir em outro posts a configuração do pacote iscsi-initiator-utils Red Hat e depois voltamos a segunda  parte do gerenciamento do Openfiler.