Configure Oracle Cluster File System (OCFS2) Part – 5
$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.
IP Address: 192.168.2.131
IP Port: 7777
IP Address: 192.168.2.132
IP Port: 7777
# more /etc/ocfs2/cluster.conf
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
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.
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
# ocfs2console
Format:
Available devices: /dev/sdb1
Volume label: oracle
Cluster size: Auto
Number of node slots: 4
Block size: Auto
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.
good post on OCFS2.