CTDB IP takeover/failover tunables - do you use them?

Martin Schwenke martin at meltin.net
Thu Apr 20 09:50:38 UTC 2017


On Thu, 20 Apr 2017 09:27:25 +0200, hvjunk <hvjunk at gmail.com> wrote:

> > On 20 Apr 2017, at 07:16 , Martin Schwenke <martin at meltin.net> wrote:

> > Right. So, in that case, you just set the public addresses list on
> > NodeC to be empty.  You can even set
> > CTDB_PUBLIC_ADDRESSES=/dev/null on NodeC - that's what our test suite
> > does when it is running against "local daemons”.  

> Okay… the documentation I’ve read up till now, states something like:
>  “the CTDB_PUBLIC_ADDRESSES file should be the exact same on all the
> nodes”, at least that’s how I interpreted it, so this just needs to
> be documented more explicitly ;)

In recent versions this has been clarified in the ctdb(7) man page.

I updated the wiki a couple of months ago and it is now clear there too:

  https://wiki.samba.org/index.php/Adding_public_IP_addresses

If you see it wrong anywhere else then please yell and we'll fix
it.  :-)

> >> Here my "use case" is that I want that to have ClientA1 & ClientA2 talk to
> >> NodeA, and ClientB1 & ClientB2 talk to NodeB. The data is mostly reads, just
> >> we need/want the uploads to be "stable", so I could point ClientB1 &
> >> ClientB2 to 10.0.2.2 and ClientA1 & clientA2 to 10.0.1.1 and have the best
> >> network performances.
> >> 
> >> I'm still looking/reading-docs as to how "deterministically" know that
> >> 10.0.2.2 should be on NodeB & 10.0.1.1. should be on NodeA in the
> >> normal/stable case?  
> > 
> > You want to test deterministic IPs, which is now IPAllocAlgorithm=0 from
> > Samba >= 4.6.0.
> > 
> > However, deterministics IPs do not (necessary) behave well when some
> > nodes do not define public addresses.  The algorithm:
> > 
> > 1. Assigns addresses across all nodes in a modulo manner
> > 
> > 2. Drops addresses from unhealthy node
> > 
> > 3. Assigns unassigned addresses in a balanced manner
> > 
> > If you only have 2 public addresses and NodeA is node 0, NodeB is node
> > 1 then it should work fine.  :-)  

> So, will the first public IP in the list be used, or the sorted list
> and that first IP to be deployed? What will happen if the order of
> the public IPs differ on the nodes?

The order of the public IPs in the files doesn't matter.  The IP
takeover process gathers the IPs from all nodes and (effectively) sorts
them before allocating them.  However, a detail of the implementation
means that the list ends up *reversed* before the IPs are allocated. So,
if NodeA is node 0 and NodeB is node 1 with addresses 10.0.1.1 and
10.0.2.2 then the allocation should look like:

  10.0.1.1  1   # NodeB
  10.0.2.2  0   # NodeA

It is easy enough to test.  Hopefully you can work with that.

The IP failover part of CTDB will mostly like undergo some large
changes before Samba 4.8.  I don't think we'll lose any
functionality... but we might un-reverse the sort order...  ;-)

peace & happiness,
martin



More information about the samba-technical mailing list