OCFS2 Setup

This note is about OCFS2 setup on OL7.

All instructions must be done on all participating nodes.

Create a cluster configuration

Create a configuration file in /etc/ocfs2/cluster.conf

cluster:
        heartbeat_mode = local
        node_count = 2
        name = emdev

node:
        number = 0
        cluster = emdev
        ip_port = 7777
        ip_address = 192.168.69.186
        name = emdev13c01u

node:
        number = 1
        cluster = emdev
        ip_port = 7777
        ip_address = 192.168.69.191
        name = emdev13c02u

heartbeat:
        cluster = emdev
        region = global
Run the configuration
#  /sbin/o2cb.init 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) []: emdev
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
checking debugfs...
Setting cluster stack "o2cb": OK
Registering O2CB cluster "emdev": OK
Setting O2CB cluster timeouts : OK
Enable the configuration
# o2cb.init status
Driver for "configfs": Loaded
Filesystem "configfs": Mounted
Stack glue driver: Loaded
Stack plugin "o2cb": Loaded
Driver for "ocfs2_dlmfs": Loaded
Filesystem "ocfs2_dlmfs": Mounted
Checking O2CB cluster "emdev": Online
  Heartbeat dead threshold: 31
  Network idle timeout: 30000
  Network keepalive delay: 2000
  Network reconnect delay: 2000
  Heartbeat mode: Local
Checking O2CB heartbeat: Not active
Debug file system at /sys/kernel/debug: mounted 
Start the service
# systemctl enable o2cb
# systemctl enable ocfs2
Update sysctl.conf

Update /etc/sysctl.d/99-sysctl.conf to add the following parameters:

kernel.panic = 30
kernel.panic_on_oops = 1
Reload sysctl
# sysctl -p
Mount the filesystem

Add the filesystem to be mounted in /etc/fstab and run the mountall command.

LABEL=library           /library                ocfs2   _netdev,defaults 1 2