10.3.9. Multi-state Resource Agent Requirements
Since multi-state resources are an extension of cloned resources, all the requirements of Clones are also requirements of multi-state resources. Additionally, multi-state resources require two extra actions: demote
and promote
; these actions are responsible for changing the state of the resource. Like start
and stop
, they should return OCF_SUCCESS
if they completed successfully or a relevant error code if they did not.
The states can mean whatever you wish, but when the resource is started, it must come up in the mode called Slave
. From there the cluster will then decide which instances to promote to Master
.
In aggiunta ai requisiti per le azioni di monitor relativi alle risorse clone, gli agent devono anche riportare accuratamente in quale stato essi si trovano. Il cluster si affida all'agent per riportare il proprio stato (incluso il ruolo) accuratamente e non indica all'agente in quale ruolo ritiene che la risorsa si trovi.
Tabella 10.8. Implicazioni dei ruoli nei return code OCF
Return code del monitor
|
Descrizione
|
---|
OCF_NOT_RUNNING
|
|
OCF_SUCCESS
|
|
OCF_RUNNING_MASTER
|
|
OCF_FAILED_MASTER
|
|
Atro
|
Fallito (Slave)
|