Product SiteDocumentation Site

5.7. Operaţiile Resurselor

5.7.1. Monitorizarea Resurselor pentru Defecţiuni

By default, the cluster will not ensure your resources are still healthy. To instruct the cluster to do this, you need to add a monitor operation to the resource’s definition.

Exemplu 5.6. O resursă OCF cu o verificare recurentă a sănătăţii

<primitive id="Public-IP" class="ocf" type="IPaddr" provider="heartbeat">
  <operations>
     <op id="public-ip-check" name="monitor" interval="60s"/>
  </operations>
  <instance_attributes id="params-public-ip">
     <nvpair id="public-ip-addr" name="ip" value="1.2.3.4"/>
  </instance_attributes>
</primitive>

Tabel 5.3. Proprietăţile unei Operaţii

Câmp Descriere
id
Your name for the action. Must be unique.
name
The action to perform. Common values: monitor, start, stop
interval
How frequently (in seconds) to perform the operation. Default value: 0, meaning never.
timeout
How long to wait before declaring the action has failed.
on-fail
Acţiunea pe care să o execute dacă vreodată această acţiune eşuează. Valori permise:
* ignore - Pretend the resource did not fail
* block - Don’t perform any further operations on the resource
* stop - Stop the resource and do not start it elsewhere
* restart - Stop the resource and start it again (possibly on a different node)
* fence - STONITH the node on which the resource failed
* standby - Move all resources away from the node on which the resource failed
The default for the stop operation is fence when STONITH is enabled and block otherwise. All other operations default to stop.
enabled
If false, the operation is treated as if it does not exist. Allowed values: true, false