The software described in this documentation is either in Extended Support or Sustaining Support. See https://www.oracle.com/us/support/library/enterprise-linux-support-policies-069172.pdf for more information.
Oracle recommends that you upgrade the software described by this documentation as soon as possible.
You can create the configuration file by using the o2cb command or a text editor.
Configure the cluster stack by using the o2cb command:
Use the following command to create a cluster definition.
#
o2cb add-clustercluster_nameFor example, you would define a cluster named
myclusterwith four nodes as follows:#
o2cb add-cluster myclusterThe command creates the configuration file
/etc/ocfs2/cluster.confif it does not already exist.For each node, use the following command to define the node.
#
o2cb add-nodecluster_namenode_name--ipip_addressThe name of the node must be same as the value of system's
HOSTNAMEthat is configured in/etc/sysconfig/network. The IP address is the one that the node will use for private communication in the cluster.For example, to define a node named
node0with the IP address 10.1.0.100 in the clustermycluster:#
o2cb add-node mycluster node0 --ip 10.1.0.100If you want the cluster to use global heartbeat devices, use the following commands.
#
o2cb add-heartbeat. . . #cluster_namedevice1o2cb heartbeat-modecluster_nameglobalNoteYou must configure global heartbeat to use whole disk devices. You cannot configure a global heartbeat device on a disk partition.
For example, to use
/dev/sdd,/dev/sdg, and/dev/sdjas global heartbeat devices:#
o2cb add-heartbeat mycluster /dev/sdd#o2cb add-heartbeat mycluster /dev/sdg#o2cb add-heartbeat mycluster /dev/sdj#o2cb heartbeat-mode mycluster globalCopy the cluster configuration file
/etc/ocfs2/cluster.confto each node in the cluster.NoteAny changes that you make to the cluster configuration file do not take effect until you restart the cluster stack.
The following sample configuration file
/etc/ocfs2/cluster.conf defines a 4-node
cluster named mycluster with a local
heartbeat.
node:
name = node0
cluster = mycluster
number = 0
ip_address = 10.1.0.100
ip_port = 7777
node:
name = node1
cluster = mycluster
number = 1
ip_address = 10.1.0.101
ip_port = 7777
node:
name = node2
cluster = mycluster
number = 2
ip_address = 10.1.0.102
ip_port = 7777
node:
name = node3
cluster = mycluster
number = 3
ip_address = 10.1.0.103
ip_port = 7777
cluster:
name = mycluster
heartbeat_mode = local
node_count = 4
If you configure your cluster to use a global heartbeat, the file also include entries for the global heartbeat devices.
node:
name = node0
cluster = mycluster
number = 0
ip_address = 10.1.0.100
ip_port = 7777
node:
name = node1
cluster = mycluster
number = 1
ip_address = 10.1.0.101
ip_port = 7777
node:
name = node2
cluster = mycluster
number = 2
ip_address = 10.1.0.102
ip_port = 7777
node:
name = node3
cluster = mycluster
number = 3
ip_address = 10.1.0.103
ip_port = 7777
cluster:
name = mycluster
heartbeat_mode = global
node_count = 4
heartbeat:
cluster = mycluster
region = 7DA5015346C245E6A41AA85E2E7EA3CF
heartbeat:
cluster = mycluster
region = 4F9FBB0D9B6341729F21A8891B9A05BD
heartbeat:
cluster = mycluster
region = B423C7EEE9FC426790FC411972C91CC3
The cluster heartbeat mode is now shown as
global, and the heartbeat regions are
represented by the UUIDs of their block devices.
If you edit the configuration file manually, ensure that you use the following layout:
The
cluster:,heartbeat:, andnode:headings must start in the first column.Each parameter entry must be indented by one tab space.
A blank line must separate each section that defines the cluster, a heartbeat device, or a node.

