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 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 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.
To create an anonymouse clone resource, first create a primitive resource and then refer to it with the clone command. Do the following:
Run the crm command as system administrator. The
prompt changes to crm(live).
Configure the primitive, for example:
crm(live)# configure crm(live)configure# primitive Apache lsb:apache
Clone the primitive:
crm(live)configure# clone apache-clone Apache \ meta globally-unique=false
To create an stateful clone resource, first create a primitive resource and then the master-slave resource.
Run the crm command as system administrator. The
prompt changes to crm(live).
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
Create the master slave resource:
crm(live)configure# clone apache-clone Apache \
meta globally-unique=false