offsetof(struct ctdb_tunable_list, rerecovery_timeout) },
{ "EnableBans", 1, false,
offsetof(struct ctdb_tunable_list, enable_bans) },
- { "DeterministicIPs", 0, false,
+ { "DeterministicIPs", 0, true,
offsetof(struct ctdb_tunable_list, deterministic_public_ips) },
- { "LCP2PublicIPs", 1, false,
+ { "LCP2PublicIPs", 1, true,
offsetof(struct ctdb_tunable_list, lcp2_public_ip_assignment) },
{ "ReclockPingPeriod", 60, true,
offsetof(struct ctdb_tunable_list, reclock_ping_period) },
offsetof(struct ctdb_tunable_list, rec_buffer_size_limit) },
{ "QueueBufferSize", 1024, false,
offsetof(struct ctdb_tunable_list, queue_buffer_size) },
+ { "IPAllocAlgorithm", 2, false,
+ offsetof(struct ctdb_tunable_list, ip_alloc_algorithm) },
{ NULL, 0, true, }
};
</para>
</refsect2>
- <refsect2>
- <title>DeterministicIPs</title>
- <para>Default: 0</para>
- <para>
- When set to 1, ctdb will try to keep public IP addresses locked
- to specific nodes as far as possible. This makes it easier
- for debugging since you can know that as long as all nodes are
- healthy public IP X will always be hosted by node Y.
- </para>
- <para>
- The cost of using deterministic IP address assignment is that it
- disables part of the logic where ctdb tries to reduce the number
- of public IP assignment changes in the cluster. This tunable may
- increase the number of IP failover/failbacks that are performed
- on the cluster by a small margin.
- </para>
- </refsect2>
-
<refsect2>
<title>DisableIPFailover</title>
<para>Default: 0</para>
</para>
</refsect2>
+ <refsect2>
+ <title>IPAllocAlgorithm</title>
+ <para>Default: 2</para>
+ <para>
+ Selects the algorithm that CTDB should use when doing public
+ IP address allocation. Meaningful values are:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>0</term>
+ <listitem>
+ <para>
+ Deterministic IP address allocation.
+ </para>
+ <para>
+ This is a simple and fast option. However, it can cause
+ unnecessary address movement during fail-over because
+ each address has a "home" node. Works badly when some
+ nodes do not have any addresses defined. Should be used
+ with care when addresses are defined across multiple
+ networks.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>1</term>
+ <listitem>
+ <para>
+ Non-deterministic IP address allocation.
+ </para>
+ <para>
+ This is a relatively fast option that attempts to do a
+ minimise unnecessary address movements. Addresses do
+ not have a "home" node. Rebalancing is limited but it
+ usually adequate. Works badly when addresses are
+ defined across multiple networks.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>2</term>
+ <listitem>
+ <para>
+ LCP2 IP address allocation.
+ </para>
+ <para>
+ Uses a heuristic to assign addresses defined across
+ multiple networks, usually balancing addresses on each
+ network evenly across nodes. Addresses do not have a
+ "home" node. Minimises unnecessary address movements.
+ The algorithm is complex, so is slower than other
+ choices for a large number of addresses. However, it
+ can calculate an optimal assignment of 900 addresses in
+ under 10 seconds on modern hardware.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <para>
+ If the specified value is not one of these then the default
+ will be used.
+ </para>
+ </refsect2>
+
<refsect2>
<title>KeepaliveInterval</title>
<para>Default: 5</para>
</para>
</refsect2>
- <refsect2>
- <title>LCP2PublicIPs</title>
- <para>Default: 1</para>
- <para>
- When set to 1, ctdb uses the LCP2 ip allocation algorithm.
- </para>
- </refsect2>
-
<refsect2>
<title>LockProcessesPerDB</title>
<para>Default: 200</para>
DatabaseMaxDead = 5
RerecoveryTimeout = 10
EnableBans = 1
-DeterministicIPs = 0
-LCP2PublicIPs = 1
NoIPFailback = 0
DisableIPFailover = 0
VerboseMemoryNames = 0
DBSizeWarn = 100000000
PullDBPreallocation = 10485760
NoIPHostOnAllDisabled = 0
-Samba3AvoidDeadlocks = 0
TDBMutexEnabled = 0
LockProcessesPerDB = 200
+RecBufferSizeLimit = 1000000
+QueueBufferSize = 1024
+IPAllocAlgorithm = 2
</screen>
</refsect3>
</refsect2>
when you have changed the tunables for the daemon to:
</para>
<para>
- DeterministicIPs = 0
+ IPAllocAlgorithm != 0
</para>
<para>
NoIPFailback = 1
uint32_t lock_processes_per_db;
uint32_t rec_buffer_size_limit;
uint32_t queue_buffer_size;
+ uint32_t ip_alloc_algorithm;
};
struct ctdb_tickle_list {
static enum ipalloc_algorithm
determine_algorithm(const struct ctdb_tunable_list *tunables)
{
- if (1 == tunables->lcp2_public_ip_assignment) {
- return IPALLOC_LCP2;
- } else if (1 == tunables->deterministic_public_ips) {
+ switch (tunables->ip_alloc_algorithm) {
+ case 0:
return IPALLOC_DETERMINISTIC;
- } else {
+ case 1:
return IPALLOC_NONDETERMINISTIC;
- }
+ case 2:
+ return IPALLOC_LCP2;
+ default:
+ return IPALLOC_LCP2;
+ };
}
struct takeover_callback_data {
* back IPs to their "home" node.
*/
if (ipalloc_state->no_ip_failback) {
- DEBUG(DEBUG_WARNING, ("WARNING: 'NoIPFailback' set but ignored - incompatible with 'DeterministicIPs\n"));
+ D_WARNING("WARNING: 'NoIPFailback' set but ignored - "
+ "incompatible with 'Deterministic IPs\n");
}
unassign_unsuitable_ips(ipalloc_state);
1. Verify that the status on all of the ctdb nodes is 'OK'.
2. Get a list of all the ctdb tunable variables, using the 'ctdb
listvars' command.
-3. Set the value of one of the variables using the 'setvar' control on
- one of the nodes. E.g. 'ctdb setvar DeterministicIPs 0'.
+3. Increment the value of one of the variables using the 'setvar' control on
+ one of the nodes. E.g. 'ctdb setvar RecoverTimeout 31'.
4. Verify that the 'listvars' control now shows the new value for the
variable.
This test does not do any network level checks to make sure IP
addresses are actually on interfaces. It just consults "ctdb ip".
-To work, this test unsets DeterministicIPs and sets NoIPFailback.
+To work, this test ensures that IPAllocAlgorithm is not set to 0
+(Deterministic IPs) and sets NoIPFailback.
EOF
}
echo "Target node is ${to_node}"
-echo "Turning off DeterministicIPs..."
-try_command_on_node -q all $CTDB setvar DeterministicIPs 0
+echo "Setting IPAllocAlgorithm=2 to avoid Deterministic IPs..."
+try_command_on_node -q all $CTDB setvar IPAllocAlgorithm 2
echo "Turning on NoIPFailback..."
try_command_on_node -q all $CTDB setvar NoIPFailback 1
DatabaseMaxDead = 5
RerecoveryTimeout = 10
EnableBans = 1
-DeterministicIPs = 0
-LCP2PublicIPs = 1
NoIPFailback = 0
DisableIPFailover = 0
VerboseMemoryNames = 0
LockProcessesPerDB = 200
RecBufferSizeLimit = 1000000
QueueBufferSize = 1024
+IPAllocAlgorithm = 2
EOF
simple_test