Configuring a Clone Resource

Clones were initially conceived as a convenient way to start N instances of an IP resource and have them distributed throughout the cluster for load balancing. They have turned out to quite useful for a number of purposes including integrating with DLM, the fencing subsystem and OCFS2. You can clone any resouce provided the resource agent supports it.

These types of cloned resources exist:

Anonymous Resources

Anonymous clones are the simplest type. These resources behave completely identical everywhere they are running. Because of this, there can only be one copy of an anonymous clone active per machine.

Multi-State Resources

Multi-state resources are a specialization of clones. They allow the instances to be in on of two operating modes. These modes are called “master” and “slave” but can mean whatever you wish them to mean. The only limitation is that when an instance is started, it must come up in a slave state.

Creating Anonymous Clone Resources

To create an anonymouse clone resource, first create a primitive resource and then refer to it with the clone command. Do the following:

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

  2. Configure the primitive, for example:

    crm(live)# configure
    crm(live)configure# primitive Apache lsb:apache
  3. Clone the primitive:

    crm(live)configure# clone apache-clone Apache \
       meta globally-unique=false

Creating Stateful/Multi-State Clone Resources

To create an stateful clone resource, first create a primitive resource and then the master-slave resource.

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

  2. Configure the primitive. Change the intervals if needed:

    crm(live)# configure
    crm(live)configure# primitive myRSC ocf:myCorp:myAppl \
      operations foo \
        op monitor interval=60 \
        op monitor interval=61 role=Master
  3. Create the master slave resource:

    crm(live)configure# clone apache-clone Apache \
       meta globally-unique=false