*/
all_ips = create_merged_ip_list(ctdb, tmp_ctx);
+ /* If we want deterministic ip allocations, i.e. that the ip addresses
+ will always be allocated the same way for a specific set of
+ available/unavailable nodes.
+ */
+ if (1 == ctdb->tunable.deterministic_public_ips) {
+ DEBUG(0,("Deterministic IPs enabled. Resetting all ip allocations\n"));
+ for (i=0,tmp_ip=all_ips;tmp_ip;tmp_ip=tmp_ip->next,i++) {
+ tmp_ip->pnn = i%nodemap->num;
+ }
+ }
+
/* mark all public addresses with a masked node as being served by
node -1
continue;
}
+ /* If we want deterministic IPs then dont try to reallocate
+ them to spread out the load.
+ */
+ if (1 == ctdb->tunable.deterministic_public_ips) {
+ continue;
+ }
+
/* if the spread between the smallest and largest coverage by
a node is >=2 we steal one of the ips from the node with
most coverage to even things out a bit.
{ "DatabaseHashSize", 10000, offsetof(struct ctdb_tunable, database_hash_size) },
{ "RerecoveryTimeout", 10, offsetof(struct ctdb_tunable, rerecovery_timeout) },
{ "EnableBans", 1, offsetof(struct ctdb_tunable, enable_bans) },
+ { "DeterministicIPs", 0, offsetof(struct ctdb_tunable, deterministic_public_ips) },
};
/*