HOME > > Configure Oracle Cluster File System (OCFS2) Part - 5

Configure Oracle Cluster File System (OCFS2) Part - 5

Anup - Wednesday, December 17, 2008
Now we install and Configure OCFS2, OCFS2 is a general-purpose cluster file system. It enables all nodes to share files concurrently via the standard file system interface. We house the OCR and Voting Disk in the OCFS2 file system.


We should already have the OCFS2 RPM installed during the RHEL4 installation.


Verify that the RPMs have been installed on both nodes.

$rpm -qa grep ocfs
$ocfs2-tools-1.2.2-2
$ocfs2console-1.2.2-2
$ocfs2-2.6.9-42.0.0.0.1.ELsmp-1.2.3-2

Create the OCFS2 configuration file.

Log in as the root user on RAC1, and execute

# ocfs2console

1. OCFS2 Console: Select Cluster, Configure Nodes.

2. “The cluster stack has been started”: Click on Close.

3. Node Configuration: Click on Add.

4. Add Node: Add the following nodes and then click on Apply.

Name: rac1
IP Address: 192.168.2.131
IP Port: 7777

Name: rac2
IP Address: 192.168.2.132
IP Port: 7777

5. Verify the generated configuration file.

# more /etc/ocfs2/cluster.conf

node:
ip_port = 7777
ip_address = 192.168.2.131
number = 0
name = rac1
cluster = ocfs2

node:
ip_port = 7777
ip_address = 192.168.2.132
number = 1
name = rac2
cluster = ocfs2

cluster:
node_count = 2
name = ocfs2

6. Propagate the configuration file to rac2. You can rerun the steps above on rac2 to generate the configuration file or select Cluster, Propagate Configuration on the OCFS2 Console on rac1 to propagate the configuration file to rac2.

Configure the O2CB driver

O2CB is a set of clustering services that manages the communication between the nodes and the cluster file system.

Now perform the procedure below on both nodes to configure O2CB to start on boot.

When prompted for a value for the heartbeat dead threshold, you have to specify a value higher than 7 to prevent the nodes from crashing due to the slow IDE disk drive. The heartbeat dead threshold is a variable used to calculate the fence time.

Fence time (seconds) = (heartbeat dead threshold -1) * 2

A fence time of 120 seconds works well in our environment. The value of heartbeat dead threshold should be the same on both nodes.

As the root user, execute

# /etc/init.d/o2cb unload

Stopping O2CB cluster ocfs2: OK
Unmounting ocfs2_dlmfs filesystem: OK
Unloading module "ocfs2_dlmfs": OK
Unmounting configfs filesystem: OK
Unloading module "configfs": OK

# /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 without typing an answer will keep that current value. Ctrl-C will abort.

Load O2CB driver on boot (y/n) [y]: y
Cluster to start on boot (Enter "none" to clear) [ocfs2]:
Specify heartbeat dead threshold (>=7) [7]: 61
Writing O2CB configuration: OK
Loading module "configfs": OK
Mounting configfs filesystem at /config: OK
Loading module "ocfs2_nodemanager": OK
Loading module "ocfs2_dlm": OK
Loading module "ocfs2_dlmfs": OK
Mounting ocfs2_dlmfs filesystem at /dlm: OK
Starting O2CB cluster ocfs2: OK

Format the file system

Before proceeding with formatting and mounting the file system, verify that O2CB is online on both nodes; O2CB heartbeat is currently inactive because the file system is not mounted.

# /etc/init.d/o2cb status

Module "configfs": Loaded
Filesystem "configfs": Mounted
Module "ocfs2_nodemanager": Loaded
Module "ocfs2_dlm": Loaded
Module "ocfs2_dlmfs": Loaded
Filesystem "ocfs2_dlmfs": Mounted
Checking O2CB cluster ocfs2: Online
Checking O2CB heartbeat: Not active

You are only required to format the file system on one node. As the root user on rac1, execute

# ocfs2console

1. OCFS2 Console: Select Tasks, Format.
Format:
Available devices: /dev/sdb1
Volume label: oracle
Cluster size: Auto
Number of node slots: 4
Block size: Auto

2. OCFS2 Console: CTRL-Q to quit. 3.

Mount the file system

To mount the file system, execute the command below on both nodes.

# mount -t ocfs2 -o datavolume,nointr /dev/sdb1 /ocfs

To mount the file system on boot, add the following line in /etc/fstab on both nodes.

/etc/fstab

/dev/sdb1 /ocfs ocfs2 _netdev,datavolume,nointr 0 0

Create Oracle Clusterware directory. Create the directory in OCFS2 file system where the OCR and Voting Disk will reside. On rac1,

# mkdir /ocfs/clusterware

# chown -R oracle:dba /ocfs

You have completed the set up of OCFS2. Verify that you can read and write files on the shared cluster file system from both nodes.
rachit said...

good post on OCFS2.

Contact me

Get in Touch

Need to get touch with me? Please fill out the form with your enquiry.

Name
Anup Srivastav
Address
Lucknow - Utter Pradesh
Email
myindiandba@gmail.com
Message me