Manual Configuration of a Resource

Resources are any type of service that a computer provides. Resources are known to High Availability when they may be controlled by RAs (Resource Agents), which are LSB scripts, OCF scripts, or legacy Heartbeat 1 resources. All resources can be configured with the crm command or as XML in the CIB (Cluster Information Base) in the resources section. For an overview of available resources, look at Chapter 15, HA OCF Agents.

To add an IP address 10.10.0.1 as a resource to the current configuration, use the crm command:

Procedure 6.3. Creating an IP Address Cluster Resource

  1. Run the crm command as system administrator. The prompt changes to crm(live).

  2. Switch to the configure subcommand:

    crm(live)# configure
  3. Create an IP address resource:

    crm(live)configure# resource
    primitive myIP ocf:heartbeat:IPaddr params ip=10.10.0.1
[Note]

When configuring a resource with High Availability, the same resource should not be initialized by init. High availability is be responsible for all service start or stop actions.

If the configuration was successful, a new resource appears in crm_mon that is started on a random node of your cluster.

To migrate a resource to another node, do the following:

Procedure 6.4. Migrating Resources to Another Node

  1. Start a shell and become the user root.

  2. Migrate your resource myip to node saturn:

    crm resource migrate myIP saturn