Choose the preferred IDO active endpoint

This is to continue the previous archived topic:

I had the same problem: I wanted to decide which of the 2 masters is the “preferred IDO master”.
This is for optimization purposes.
My DB cluster is located in Northern Europe.
I have 2 Icinga masters: one in Eastern Europe, and one next to Northern Europe.

When both masters are UP, it was sad to see the Eastern Europe master was automatically chosen as the IDO master.

I succeeded to influence which node is the preferred IDO master.

As mentioned in the link above, Icinga currently uses a modulo computation, so that each master can locally make a computation without communicating with the other master in order to determine if it should or not handle the object.

This is valid for all HA objects, and this is the same mechanism for the IDO object.

But what was not clear to me: I found out that the computation is based on a modulo of object_name AND the position of your endpoints in the endpoints list

The IDO object is usually called “ido-pgsql” or “ido-mysql”.
Depending on the masters endpoint order you choose, you will or you will not be lucky: maybe the master your prefer will be chosen, maybe not.

If you are not lucky, you have 2 solutions to influence the system to change the preferred IDO master:

  • either you change the endpoint order in the list (zones.conf)
  • you rename the IDO object

My solution was to do this:
In file /etc/icinga2/features-available/ido-mysql.conf

I replaced
object IdoMysqlConnection "ido-mysql" {
object IdoMysqlConnection "idomysql" {

And it did the trick. :slight_smile:

Of course, if one day I upgrade my Icinga master cores and the internal algo has changed, I might need to retry by changing the object name again.

Just wanted to share this in case it helps some people!

I would like to add 2 things: