In this scenario, an administrator wants to approximate random application pinning using load balancing rules. In order to accomplish this, they will need to use the MATCHES operator since it allows the use of regular expressions.
Since applications have unique GUIDs assigned upon app creation, a crafted load balancing rule which matches approximately half the app GUIDs would effectively pin half of the apps to a particular node.
From a relatively large Qlik Sense deployment, we can see the distribution of app GUIDs is relatively evenly distributed:
FirstLetter Count % of total Cumilative Percent
0 382 5.86% 5.86%
1 401 6.16% 12.02%
2 435 6.68% 18.70%
3 389 5.97% 24.67%
4 413 6.34% 31.01%
5 392 6.02% 37.03%
6 429 6.59% 43.61%
7 393 6.03% 49.65%
8 387 5.94%
9 444 6.82%
a 384 5.89%
b 435 6.68%
c 412 6.32%
d 391 6.00%
e 422 6.48%
f 405 6.22%
The use of a regular expression allows the administrator to pattern match by app GUID in a programmatic way.
Resolution
Example Rule:
- Resource Filter: App_*
- Actions: Load Balancing
- Conditions: ((node.name="Scheduler1" and (resource.id matches "[0-7]{1}[a-z0-9]{7}-([a-z0-9]{4}-){3}[a-z0-9]{12}")) or (node.name="Scheduler2" and (resource.id matches "[a-z8-9]{1}[a-z0-9]{7}-([a-z0-9]{4}-){3}[a-z0-9]{12}")))
- Context: Both in Hub and QMC
The logic behind this rule is that the node named Scheduler1 will have all apps which have GUIDs starting with 0-7 and the node named Scheduler2 will receive the rest.