I have test databases which are running into Oracle 11gR2 RAC Linux 5.5 x86-64 bit.
TEST database is running first node and KLON database is running on the second node.
[oracle@ds-dm01db01 backup]$ srvctl status database -d TEST
Instance TEST is running on node ds-dm01db01
[oracle@ds-dm01db02 ~]$ srvctl status database -d KLON
Instance KLON is running on node ds-dm01db02
I need to backup these databases to disk using RMAN but I have only one backup disk for all of the backupset files. The first choice and simple solution is using nfs in order to mount backup disk from first node to second node .However, I decided to use OCFS2 Cluster Filesystem to present backup disk to both nodes just for test purpose as an alternative to NFS.
I followed these steps by using OCFS2 on the test environment:
1. Check the kernel version using the “uname -a” command.
[root@ocfsrv1 tmp]# uname -a
Linux ocfsrv1.home.com 2.6.18-194.el5 #1 SMP Mon Mar 29 22:10:29 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
2. Download the appropriate version of the OCFS2 kernel module and tools from the following locations
http://oss.oracle.com/projects/ocfs2/files/
http://oss.oracle.com/projects/ocfs2-tools/files/
3. Install these rpm files on the both nodes.
rpm -Uvh ocfs2-tools-1.6.3-2.el5.x86_64.rpm
rpm -Uvh ocfs2-2.6.18-194.el5-1.4.7-1.el5.x86_64.rpm
rpm -Uvh ocfs2console-1.6.3-2.el5.x86_64.rpm
rpm -Uvh ocfs2-tools-debuginfo-1.6.3-2.el5.x86_64.rpm
4. Before configuration, check for a free port on the cluster nodes.
Port 7777 is not free thus I will use port 7780 during the configuration.
[root@ds-dm01db01 ~]# telnet localhost 7777
Trying 127.0.0.1…
Connected to localhost.localdomain (127.0.0.1).
Escape character is ‘^]’.
5. Enable o2cb by using these commands.
[root@ds-dm01db01 ~]# chkconfig o2cb on
[root@ds-dm01db01 ~]# /etc/init.d/o2cb enable
Writing O2CB configuration: OK
Starting O2CB cluster ocfs2: Failed
Cluster ocfs2 created
o2cb_ctl: Configuration error discovered while populating cluster ocfs2. None of its nodes were considered local. A node is considered local when its node name in the configuration matches this machine’s host name.
Stopping O2CB cluster ocfs2: OK
If you get a message “cluster not known”. This is normal for now.
6. Start the OCFS2 Console and configure nodes by issuing the following command as the root user.
[root@ds-dm01db01 ~]#ocfs2console
Click Choose Cluster->Configure Nodes…

We can ignore this warning message about o2cb service.
7. Configure Nodes:
Write the cluster nodes in with their local host names (what the command “hostname” returns).

If you get this error message:”o2cb_ctl: Unable to access cluster service while creating node”
Follow these steps and then try again.
[root@ds-dm01db01 ~]# /etc/init.d/ocfs2 stop
Stopping Oracle Cluster File System (OCFS2) [ OK ]
[root@ds-dm01db01 ~]# /etc/init.d/o2cb offline ocfs2
[root@ds-dm01db01 ~]# /etc/init.d/o2cb unload
Unmounting ocfs2_dlmfs filesystem: OK
Unloading module “ocfs2_dlmfs”: OK
Unmounting configfs filesystem: OK
Unloading module “configfs”: OK
[root@ds-dm01db01 ~]# rm -f /etc/ocfs2/cluster.conf
[root@ds-dm01db01 ~]# ocfs2console
8. Propagate Configuration
Choose Cluster->Propagate Configuration…

9. make sure that the o2cb service is running on all nodes
/etc/init.d/o2cb start
[root@ds-dm01db01 ~]# /etc/init.d/o2cb start
Cluster ocfs2 already online
[root@ds-dm01db02 tmp]# /etc/init.d/o2cb start
Starting O2CB cluster ocfs2: OK
[root@ds-dm01db02 tmp]# /etc/init.d/o2cb start
Cluster ocfs2 already online
10. Reregister the o2cb service using the following commands.
[root@ds-dm01db01 ~]# chkconfig –del o2cb
[root@ds-dm01db01 ~]# chkconfig –add o2cb
[root@ds-dm01db01 ~]# chkconfig –list o2cb
o2cb 0:off 1:off 2:on 3:on 4:on 5:on 6:off
Configure the o2cb service using the following commands.
[root@ds-dm01db01 ~]# /etc/init.d/o2cb offline ocfs2
Stopping O2CB cluster ocfs2: OK
[root@ds-dm01db01 ~]# /etc/init.d/o2cb unload
Unmounting ocfs2_dlmfs filesystem: OK
Unloading module “ocfs2_dlmfs”: OK
Unmounting configfs filesystem: OK
Unloading module “configfs”: OK
[root@ds-dm01db01 ~]# /etc/init.d/o2cb configure
Configuring the O2CB driver.
This will configure the on-boot properties of the O2CB driver.
The following questions will determine whether the driver is loaded on
boot. The current values will be shown in brackets (‘[]‘). Hitting
<ENTER> without typing an answer will keep that current value. Ctrl-C
will abort.
Load O2CB driver on boot (y/n) [y]:
Cluster stack backing O2CB [o2cb]:
Cluster to start on boot (Enter “none” to clear) [ocfs2]:
Specify heartbeat dead threshold (>=7) [31]:
Specify network idle timeout in ms (>=5000) [30000]:
Specify network keepalive delay in ms (>=1000) [2000]:
Specify network reconnect delay in ms (>=2000) [2000]:
Writing O2CB configuration: OK
Loading filesystem “configfs”: OK
Mounting configfs filesystem at /sys/kernel/config: OK
Loading filesystem “ocfs2_dlmfs”: OK
Mounting ocfs2_dlmfs filesystem at /dlm: OK
Starting O2CB cluster ocfs2: OK
11. Create partition using fdisk
[root@ds-dm01db01 ~]# fdisk /dev/mapper/mpath41
The number of cylinders for this disk is set to 173750.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-173750, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-173750, default 173750):
Using default value 173750
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@ds-dm01db01 ~]# fdisk -l /dev/mapper/mpath41
Disk /dev/mapper/mpath41: 1429.1 GB, 1429150367744 bytes
255 heads, 63 sectors/track, 173750 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/mapper/mpath41p1 1 173750 1395646843+ 83 Linux
12. Format partitioned disk using ocfs2console
Start the OCFS2 Console on the first node, using the following command.
# ocfs2console
On the Console screen, select the “Tasks > Format” menu option. Select the appropriate partition and click the “OK” button and confirm the operation by clicking the “Yes” button on the subsequent screen.


- Mount formatted disk using ocfs2console


Apply this step and mount /backup disk on the both nodes. Then check the backup disk is mounted on the both nodes
[root@ds-dm01db01 /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-VGExaDb_LVDbSys1
39G 18G 20G 47% /
/dev/mapper/VolGroup00-VGExaDb_LVDbOra1
161G 57G 96G 38% /u01
/dev/sda1 99M 13M 81M 14% /boot
tmpfs 32G 950M 32G 3% /dev/shm
/ISO/Enterprise-R5-U5-Server-x86_64-dvd.iso
3.4G 3.4G 0 100% /var/repo
zoomrecorder:/nfs/calls
12T 313G 12T 3% /archivecalls
/dev/dm-33 1.3T 2.4G 1.3T 1% /backup
[root@ds-dm01db02 tmp]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-VGExaDb_LVDbSys1
39G 8.2G 29G 23% /
/dev/mapper/VolGroup00-VGExaDb_LVDbOra1
30G 19G 9.9G 66% /u01
/dev/sda1 99M 13M 81M 14% /boot
tmpfs 32G 238M 32G 1% /dev/shm
/ISO/Enterprise-R5-U5-Server-x86_64-dvd.iso
3.4G 3.4G 0 100% /var/repo
dsbergama:/zonekapadokya/root/data05
402G 221G 181G 55% /data05
/dev/dm-32 1.3T 2.4G 1.3T 1% /backup
13. Add backup disk to /etc/fstab to automount the filesystem.
For node1:
/dev/dm-33 /backup ocfs2 _netdev,datavolume 0 0
For node2:
/dev/dm-32 /backup ocfs2 _netdev,datavolume 0 0
References:
http://en.wikipedia.org/wiki/OCFS2
http://www.oracle-base.com/articles/linux/ocfs2-on-linux.php
http://linux.dell.com/wiki/index.php/Set_up_an_OCFS2_cluster_filesystem
http://d-h-n.de/blog/ocfs2console-o2cb_ctl-unable-to-access-cluster-service-while-creating-node