Configuring and Starting the O2CB Cluster Stack

The following steps configure and start the O2CB cluster stack and must be run on every node in the cluster.

  1. Configure the node.

    Run the following command to configure the node:

    sudo /sbin/o2cb.init configure

    The configuration process prompts you for extra information. You need to specify the following:

    • Load the O2CB driver on boot: Specify y or n, which is the default setting.

    • Cluster to start at boot: Specify the name of the cluster. The name must match that in the /etc/ocfs2/cluster.conf file.

    • For the remaining parameters, the default values are typically adequate.

  2. Check the status of the cluster stack.

    Verify the settings for the cluster stack:

    sudo /sbin/o2cb.init status

    A cluster that uses local heartbeat mode displays information similar to the following:

    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 "mycluster": Online
      Heartbeat dead threshold: 61
      Network idle timeout: 30000
      Network keepalive delay: 2000
      Network reconnect delay: 2000
      Heartbeat mode: Local
    Checking O2CB heartbeat: Active

    A cluster that uses global heartbeat mode displays information similar to the following:

    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 "mycluster": Online
      Heartbeat dead threshold: 61
      Network idle timeout: 30000
      Network keepalive delay: 2000
      Network reconnect delay: 2000
      Heartbeat mode: Global
    Checking O2CB heartbeat: Active
      7DA5015346C245E6A41AA85E2E7EA3CF /dev/sdd
      4F9FBB0D9B6341729F21A8891B9A05BD /dev/sdg
      B423C7EEE9FC426790FC411972C91CC3 /dev/sdj
  3. Enable the o2cb and ocfs2 services.

    Enable the o2cb and ocfs2 services so that they start on boot after networking is enabled.

    sudo systemctl enable o2cb
    sudo systemctl enable ocfs2
  4. Configure the sysctlkernel parameters.

    Edit the /etc/sysctl.d/99-sysctl.conf file to configure the following kernel settings for cluster operations:

    • kernel.panic = 30

      This setting specifies the number of seconds after a panic before a system reboots. The default value is zero. If you want a memory image to be created before the system reboots, assign a larger value.

    • kernel.panic_on_oops = 1

      This setting causes the system to panic if a kernel oops occurs. So, if a kernel thread required for cluster operation fails, the system reboots. Otherwise, a node might not know whether another node is slow to respond or unavailable, which eventually causes all cluster operations to suspend.

  5. Save the changes to the sysctl configuration.

    Apply the configuration by running the following command:

    sudo sysctl -p

The o2cb.init command accepts other subcommands which let you administer the cluster, such as the following:

  • /sbin/o2cb.init status: Check the status of the cluster stack.

  • /sbin/o2cb.init online: Bring the cluster stack online.

  • /sbin/o2cb.init offline: Take the cluster stack offline.

  • /sbin/o2cb.init unload: Unload the cluster stack.

To view other available subcommands, run the command o2cb.init by itself.