Affinities

Set controller and instance affinities in the CCR file to determine which nodes a project can run on.

Affinities limit where a project runs or does not run in a cluster. There are two types of affinities:
  • Controller – for active-active and non-active-active configurations. Controller affinities let you establish rules and preferences as to which controller nodes your project can run on. A project can have affinities for more than one controller, but it can have a strong positive affinity for only one controller.
  • Instance – only for active-active configurations. The two instances of an active-active project can have affinities for each other. For example, if you want such instances never to run on the same node, set strong negative instance affinities. If you want them to avoid running on the same node if possible, set weak negative instance affinities.
Define these parameters for each affinity:
Field Description
Name Enter the name of the object of the affinity, that is, the controller name or instance name that the affinity is set for. For instance affinities, the affinity for one instance must refer to the second instance.
Strength Specify Strong or weak. Strong requires the project to run on a specific controller, and no others. If you have strong positive affinity set for a controller node, and that node fails, the failover process tries to restart the project on that node. If the node has not recoverd, the project restart fails and you must restart manually.

If the affinity is weak, the project preferentially starts on the defined controller, but if that controller is unavailable, it may start on another available controller.

Charge Specify Positive or negative. If positive, the project runs on the controller. If negative, the project does not run on the controller.

When failover is enabled for a project, affinities can affect restarts. Suppose your project has a strong positive affinity for controller node A—that is, the project can run only on controller A. Suppose further that controller A crashes while your project is running. When your project tries to restart, controller A is still down. A project cannot attempt more than one restart if no appropriate controller is available for the project to run on. Because of its strong positive affinity for controller A, there is at most one appropriate controller to try, so your project can try to restart only once. You must restart the project manually when controller A returns to service or reconfigure the affinities.

Related reference
Project Deployment Options
Active-Active Deployments
Project Instances
Failover
Sample Project Configuration File