Product SiteDocumentation Site

10.2.7. Clone Resource Agent Requirements

Orice resursă poate fi utilizată ca o clonă anonimă deoarece nu necesită vreun suport adiţional din partea agentului de resursă. Dacă are logică să facă acest lucru depinde de resursa voastră şi de agentul de resursă aferent.
Globally unique clones do require some additional support in the resource agent. In particular, it must only respond with other probes for instances of the clone should result in they should return one of the other OCF error codes.
Copiile unei clone sunt identificate prin sufixarea a două puncte şi a unui delimitator numeric. Ex. apache:2
Resource agents can find out how many copies there are by examining the OCF_RESKEY_CRM_meta_clone_max environment variable and which copy it is by examining OCF_RESKEY_CRM_meta_clone.
You should not make any assumptions (based on OCF_RESKEY_CRM_meta_clone) about which copies are active. In particular, the list of active copies will not always be an unbroken sequence, nor always start at 0.

10.2.7.1. Clone Notifications

Suportarea notificărilor necesită acţiunea notify să fie implementată. Odată ce este suportată, acţiunii de notificare îi vor fi trimise un număr de variabile suplimentare care, atunci când sunt combinate cu un context adiţional, pot fi folosite pentru a calcula starea curentă a clusterului şi ceea ce urmează să i se întâmple.

Tabel 10.4. Variabile de mediu furnizate împreună cu acţiunile de notificare ale Clonei

Variabilă Descriere
OCF_RESKEY_CRM_meta_notify_type
Allowed values: pre, post
OCF_RESKEY_CRM_meta_notify_operation
Allowed values: start, stop
OCF_RESKEY_CRM_meta_notify_start_resource
Resources to be started
OCF_RESKEY_CRM_meta_notify_stop_resource
Resources to be stopped
OCF_RESKEY_CRM_meta_notify_active_resource
Resources that are running
OCF_RESKEY_CRM_meta_notify_inactive_resource
Resources that are not running
OCF_RESKEY_CRM_meta_notify_start_uname
Nodes on which resources will be started
OCF_RESKEY_CRM_meta_notify_stop_uname
Nodes on which resources will be stopped
OCF_RESKEY_CRM_meta_notify_active_uname
Nodes on which resources are running
OCF_RESKEY_CRM_meta_notify_inactive_uname
Nodes on which resources are not running

The variables come in pairs, such as OCF_RESKEY_CRM_meta_notify_start_resource and OCF_RESKEY_CRM_meta_notify_start_uname and should be treated as an array of whitespace separated elements.
Drept urmare pentru a indica faptul că, clone:0 va fi pornită pe sles-1, clone:2 va fi pornită pe sles-3 şi clone:3 va fi pornită pe sles-2, clusterul va seta

Exemplu 10.6. Exemple de variabile de notificare

OCF_RESKEY_CRM_meta_notify_start_resource="clone:0 clone:2 clone:3"
OCF_RESKEY_CRM_meta_notify_start_uname="sles-1 sles-3 sles-2"