Product SiteDocumentation Site

10.2.5. Clone Constraints

In most cases, a clone will have a single copy on each active cluster node. If this is not the case, you can indicate which nodes the cluster should preferentially assign copies to with resource location constraints. These constraints are written no differently to those for regular resources except that the clone’s id is used.
Restricţiile de ordonare se comportă uşor diferit în cazul clonelor. În exemplele de mai jos, apache-stats va aştepta până ce toate copiile clonelor care trebuie să fie pornite au făcut acest lucru înainte ca aceasta să fie pornită la rândul ei. Doar dacă nici o copie nu poate fi pornită va fi împiedicată apache-stats din a fi activă. În plus, clona va aştepta ca apache-stats să fie oprită înainte de a opri clona.
Colocation of a regular (or group) resource with a clone means that the resource can run on any machine with an active copy of the clone. The cluster will choose a copy based on where the clone is running and the resource’s own location preferences.
Colocarea între clone este posibilă de asemenea. În astfel de cazuri, setul de locaţii permise pentru clonă este limitat la nodurile pe care clona alături de care va fi colocată este (sau va fi) activă. Alocarea este mai apoi efectuată în mod normal.

Exemplu 10.5. Exemple de restricţii implicând clone

<constraints>
    <rsc_location id="clone-prefers-node1" rsc="apache-clone" node="node1" score="500"/>
    <rsc_colocation id="stats-with-clone" rsc="apache-stats" with="apache-clone"/>
    <rsc_order id="start-clone-then-stats" first="apache-clone" then="apache-stats"/>
</constraints>