19 December 2010

RAC Install on Linux Part3

Install OCFS2 as root

[root@node1 ocf]# rpm -ivh ocfs2console-1.2.7-1.el4.i386.rpm \
> ocfs2-2.6.9-78.ELsmp-1.2.9-1.el4.i686.rpm \
> ocfs2-tools-1.2.7-1.el4.i386.rpm
Preparing... ########################################### [100%]
1:ocfs2-tools ########################################### [ 33%]
2:ocfs2console ########################################### [ 67%]
3:ocfs2-2.6.9-78.ELsmp ########################################### [100%]
[root@node1 ocf]#




Enable OCFS2 at startup:

[root@node1 ~]# /etc/init.d/o2cb enable
Writing O2CB configuration: OK
Loading module "configfs": OK
Creating directory '/config': OK
Mounting configfs filesystem at /config: OK
Loading module "ocfs2_nodemanager": OK
Loading module "ocfs2_dlm": OK
Loading module "ocfs2_dlmfs": OK
Creating directory '/dlm': OK
Mounting ocfs2_dlmfs filesystem at /dlm: OK


Create OCFS2 filesystem for OCR and Votingdisk:

[root@node1 /]# mkdir /u03
[root@node1 /]# mkdir /u04
[root@node1 /]# ls
bin dev home lost+found mnt root srv tmp u03 var
boot dlm initrd media opt sbin sys u01 u04
config etc lib misc proc selinux tftpboot u02 usr
[root@node1 /]# mkfs.ocfs2 -b 4k -C 32k -N 4 -L /u03 /dev/sdc1
mkfs.ocfs2 1.2.7
Filesystem label=/u03
Block size=4096 (bits=12)
Cluster size=32768 (bits=15)
Volume size=2146762752 (65514 clusters) (524112 blocks)
3 cluster groups (tail covers 1002 clusters, rest cover 32256 clusters)
Journal size=67108864
Initial number of node slots: 4
Creating bitmaps: done
Initializing superblock: done
Writing system files: done
Writing superblock: done
Writing backup superblock: 1 block(s)
Formatting Journals: done
Writing lost+found: done
mkfs.ocfs2 successful

[root@node1 /]# mkfs.ocfs2 -b 4k -C 32k -N 4 -L /u04 /dev/sdd1
mkfs.ocfs2 1.2.7
Filesystem label=/u04
Block size=4096 (bits=12)
Cluster size=32768 (bits=15)
Volume size=3216048128 (98146 clusters) (785168 blocks)
4 cluster groups (tail covers 1378 clusters, rest cover 32256 clusters)
Journal size=67108864
Initial number of node slots: 4
Creating bitmaps: done
Initializing superblock: done
Writing system files: done
Writing superblock: done
Writing backup superblock: 1 block(s)
Formatting Journals: done
Writing lost+found: done
mkfs.ocfs2 successful

[root@node1 /]#


Mount OCFS2 Filesystem:

[root@node1 ~]# mount -t ocfs2 -L /u03 -o datavolume /u03
[root@node1 ~]# mount -t ocfs2 -L /u04 -o datavolume /u04
[root@node1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
9.0G 6.9G 1.7G 82% /
/dev/sda1 99M 14M 81M 15% /boot
none 506M 0 506M 0% /dev/shm
/dev/mapper/VolGroup00-LogVol02
9.9G 55M 9.3G 1% /u01
.host:/ 299G 195G 104G 66% /mnt/hgfs
/dev/sdb1 12G 63M 12G 1% /u02
/dev/sdc1 2.0G 263M 1.8G 13% /u03
/dev/sdd1 3.0G 263M 2.8G 9% /u04
[root@node1 ~]#

Add to /etc/fstab

LABEL=/u03 /u03 ocfs2 _netdev,datavolume,nointr 0 0
LABEL=/u04 /u04 ocfs2 _netdev,datavolume,nointr 0 0




Create Directories for OCR and VD an set permissions:

[root@node1 /]# mkdir /u03/ocacrs
[root@node1 /]# mkdir /u04/votingdisk
[root@node1 /]# chown oracle:oinstall /u03/ocacrs/
[root@node1 /]# chown oracle:oinstall /u04/votingdisk/
[root@node1 /]# chmod 775 /u03/ocacrs/
[root@node1 /]# chmod 775 /u04/votingdisk/


10.
Download and Configure ASM libraries and DISK:
[root@node1 asm]# rpm -Uvh oracleasm-2.6.9-78.ELsmp-2.0.5-1.el4.i686.rpm #
[root@node1 asm]# rpm -Uvh oracleasm-2.6.9-78.ELsmp-2.0.5-1.el4.i686.rpm \
> oracleasmlib-2.0.4-1.el4.i386.rpm \
> oracleasm-support-2.1.3-1.el4.i386.rpm
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [ 33%]
2:oracleasm-2.6.9-78.ELsm########################################### [ 67%]
3:oracleasmlib ########################################### [100%]
[root@node1 asm]#


Configure ASM:

[root@node1 asm]# /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
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]
[root@node1 asm]#



[root@node1 asm]# /etc/init.d/oracleasm createdisk VOL1 /dev/sde1
Marking disk "VOL1" as an ASM disk: [ OK ]
[root@node1 asm]# /etc/init.d/oracleasm createdisk VOL2 /dev/sdf1
Marking disk "VOL2" as an ASM disk: [ OK ]
[root@node1 asm]#


[root@node1 asm]# /etc/init.d/oracleasm listdisks
VOL1
VOL2




10. Clone RAC Node1 to RAC Node 2

Copy and Change settings .vmx file of VMWARE in both the nodes.

disk.locking = "FALSE"
diskLib.dataCacheMaxSize = "0"
diskLib.dataCacheMaxReadAheadSize = "0"
diskLib.dataCacheMinReadAheadSize = "0"
diskLib.dataCachePageSize = "0"
scsi1.sharedBus = "virtual"
scsi0:1.deviceType = “disk”
scsi0:1.deviceType = “disk”
scsi0:2.deviceType = “disk”
scsi0:3.deviceType = “disk”
scsi0:4.deviceType = “disk”
scsi0:5.deviceType = “disk”




Change Ip address, Host name in /etc/sysconfig/network and enable both Ethernet adaptors.


11. Setup Oracle User equivalency – This is needed for clusterware daemons to communicate with each other without password prompt


[oracle@node1 ~]$ chmod 755 .ssh
[oracle@node1 ~]$ cd /home/oracle/.ssh/
[oracle@node1 .ssh]$ ls
[oracle@node1 .ssh]$ chmod 755 /home/oracle/.ssh/
[oracle@node1 .ssh]$


Change the X11Forwarding to no in order to avoid a WARNING: no xauth data; using fake authtication data for x11 forwarding

[root@node1 ]$ vi /etc/ssh/ssh_config



[oracle@node1 .ssh]$ /usr/bin/ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_rsa.
Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
c2:35:d6:bf:e6:32:25:09:20:9f:22:e6:4e:68:3e:71 oracle@node1
[oracle@node1 .ssh]$ /usr/bin/ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_dsa.
Your public key has been saved in /home/oracle/.ssh/id_dsa.pub.
The key fingerprint is:
c9:19:6f:c4:7c:60:3e:d6:9a:c5:f1:ff:b6:03:e0:9c oracle@node1
[oracle@node1 .ssh]$ ls
id_dsa id_dsa.pub id_rsa id_rsa.pub
[oracle@node1 .ssh]$ cat id_rsa.pub id_dsa.pub > node1.pub
[oracle@node2 .ssh]$ /usr/bin/ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_rsa.
Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
45:25:46:49:0c:b6:29:78:74:3a:4a:e6:84:29:e8:6d oracle@node2
[oracle@node2 .ssh]$ /usr/bin/ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_dsa.
Your public key has been saved in /home/oracle/.ssh/id_dsa.pub.
The key fingerprint is:
41:f7:6f:12:68:e7:ce:b2:d1:43:70:e3:fd:27:b7:e6 oracle@node2
[oracle@node2 .ssh]$ ls
id_dsa id_dsa.pub id_rsa id_rsa.pub node1.pub
[oracle@node2 .ssh]$ cat id_rsa.pub id_dsa.pub > node2.pub
[oracle@node2 .ssh]$ ls
id_dsa id_dsa.pub id_rsa id_rsa.pub node1.pub node2.pub


[oracle@node2 .ssh]$ cat node1.pub node2.pub > authorized_keys
[oracle@node2 .ssh]$ chmod 644 authorized_keys
[oracle@node2 .ssh]$

[oracle@node2 .ssh]$ scp authorized_keys node1:/home/oracle/.ssh
The authenticity of host 'node1 (192.168.200.71)' can't be established.
RSA key fingerprint is 97:74:ed:c9:7c:5a:c7:c5:f3:b8:a7:5f:7f:5b:6e:3f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'node1,192.168.200.71' (RSA) to the list of known hosts.
oracle@node1's password:
authorized_keys 100% 1648 1.6KB/s 00:00

[oracle@node2 .ssh]$ ssh node1 date
Fri Feb 5 23:01:33 IST 2010
[oracle@node2 .ssh]$ ssh node2 date
The authenticity of host 'node2 (192.168.200.72)' can't be established.
RSA key fingerprint is 97:74:ed:c9:7c:5a:c7:c5:f3:b8:a7:5f:7f:5b:6e:3f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'node2,192.168.200.72' (RSA) to the list of known hosts.
Fri Feb 5 23:01:39 IST 2010
[oracle@node2 .ssh]$

No comments:

Post a Comment