Linux OS Service ‘o2cb’

O2CB is a set of clustering services required for OCFS2 clustered operation. OCFS2 comes bundled with its own cluster stack, O2CB. The stack includes:

Component Description
NM Node Manager that keep track of all the nodes in the /etc/ocfs2/cluster.conf
HB Heart beat service that issues up/down notifications when nodes join or leave the cluster
TCP Handles communication between the nodes
DLM Distributed lock manager that keeps track of all locks, its owners and status
CONFIGFS User space driven configuration file system mounted at /config
DLMFS User space interface to the kernel space DLM

All the cluster services have been packaged in the o2cb system service. OCFS2 operations, such as format, mount, etc., require the O2CB cluster service to be at least started in the node that the operation will be performed. The ocfs2-tools RPM package provides the o2cb configuration files.

Service Control

To manage the o2cb service on demand, use the service tool or run the /etc/init.d/o2cb script directly:

# /sbin/service o2cb help
Usage: /etc/init.d/o2cb {start|stop|restart|force-reload|enable|disable|configure|load|unload|online|offline|force-offline|status}
# /etc/init.d/o2cb help
Usage: /etc/init.d/o2cb {start|stop|restart|force-reload|enable|disable|configure|load|unload|online|offline|force-offline|status}

The available commands are:

Command Description
start If you have configured the cluster to load on boot, it is equivalent to a load and then a online command sequence.
stop If you have configured the cluster to load on boot, it is equivalent to a offline and then a unload command sequence.
restart Equivalent to a stop and then a start command sequence.
force-reload This is the same as a restart command.
enable Enable the cluster to load on boot, then run a start command.
disable Disable the cluster to load on boot, then run a stop command.
configure Configure o2cb to load on boot, if you have configured the cluster to load on boot, then run start command, else run stop command.
load Load the modules used by o2cb.
unload Unload the modules used by o2cb.
online Online the o2cb cluster.
offline Offline the o2cb cluster.
force-offline Force offline the o2cb cluster.
status Check the status of the o2cb cluster.

Configuration

To have the o2cb service started at boot time, run the “/etc/init.d/o2cb configure” command:

# /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) [n]: 

The “o2cb configure” will save changes into file /etc/sysconfig/o2cb. Example of such a file:

# cat /etc/sysconfig/o2cb
# This is a configuration file for automatic startup of the O2CB
# driver.  It is generated by running /etc/init.d/o2cb configure.
# Please use that method to modify this file
#

# O2CB_ENABELED: 'true' means to load the driver on boot.
O2CB_ENABLED=true

# O2CB_BOOTCLUSTER: If not empty, the name of a cluster to start.
O2CB_BOOTCLUSTER=ocfs2

# O2CB_HEARTBEAT_THRESHOLD: Iterations before a node is considered dead.
O2CB_HEARTBEAT_THRESHOLD=

# O2CB_IDLE_TIMEOUT_MS: Time in ms before a network connection is considered dead.
O2CB_IDLE_TIMEOUT_MS=

# O2CB_KEEPALIVE_DELAY_MS: Max time in ms before a keepalive packet is sent
O2CB_KEEPALIVE_DELAY_MS=

# O2CB_RECONNECT_DELAY_MS: Min time in ms between connection attempts
O2CB_RECONNECT_DELAY_MS=
Related Post