Questions about HA Master Setup

Hey there,

I’m setting up a secondary Master through the HA-feature provided by Icinga2 with the guide provided here: Distributed Monitoring - Icinga 2 and I have some questions regarding that (technical and general). In case I missunderstand something about the HA-feature, please let me now.

My zones.conf on the Master1 (srvv33):
zones-conf-master1

My zones.conf on the Master2 (srvp32):

What I did until now:

  1. Setting up both Icinga 2 Masters: The first one as Master, the second one as Satellite/Agent like defined in the guide.

  2. I added the enable_ha = false line to the ido-mysql conf (both master write to their own db)

  3. Both servers have the same features enabled and the rest of the config is similar.

  4. I used the kickstart wizard on both servers after doing the changes and the icinga2 node wizard
    command.

I’m a little bit confused now, how am I able to see if the sync is working as intened? The only thing installed right now on both servers are the director and the only changes I made are the one diplayed above. Is it functional like that?

What do I need to configure to be certain, that the Master 2 will manage things when the Master 1 happens to be down?

I only need to configure everything on the Master 1 and the second Master will receive it and write it to his DB, right? I don’t need the second master to actively execute checks, I only need him as backup in case Master 1 fails. He needs to be up-to-date with Master 1 the whole time.

Then I made some wrong definitions on my second master with the node wizard, when running it more than once. I now have some zones in my director that are no longer visible on my zones.conf file and therefore not used. How can I remove them?

I already checked the topics Icinga2 director configuration in HA Master Setup and Implementing HA Master-Master setup

Hope to hear from you guys soon
Greetings

Use the icinga cluster checks

If both are in the master zone, also here the cluster checks give you the information

That’s not how the icinga2 cluster works. If both agents execute checks actively, they split these to each other and only if one is down, the other one does all the work. And so they both write there results into their own DB as you have disabled the ha feature, which should end in inconsistent data. I recommend to configure a master-master replication for the DB (or use a DB cluster) and enable the ha feature, that all DBs will stay in sync and only one Ido instance is writing to them.

So if I just get that right, both Masters need to actively do checks right? Or in other words, I can create all the checks on master 1, but master 2 needs to use some of them as well? I just got my orders to have like a backup-server with Icinga2 on it, like a master-slave relationship.

Can you maybe confirm if my setup (as my screenshots show) is configured correct? I thought if I create checks on Master 1, they will be synced to Master 2 (which is not the case).

Just a small thought there: I disabled the HA feature, because other threads mentioned that you need to do that, in order to use 2 different DB’s at all. Master 1 should sync all the data from his DB to the master 2, so that these 2 DB are at the same state the whole time. Is this the wrong way to achieve that? I’m not really used in using a DB cluster, like 1 DB for 2 servers etc.

The config from the master is synced to the slave automatically so you just have to config the master.

the master does not sync his DB to the slave automatically. you have to do this on DB site. Indeed, I currently don’t know, if both server in a zone get a check result, when one server executing the check. But when I built my 4 zones 8 nodes cluster 3 years ago, I first tried to disable ido ha and used local dbs indendently, too. But I noticed, that I had a huge latency between master and slave in icingaweb2 when it came to alarms. So I decided to configure a master-master replication on the DB and enabled HA. The latency was gone.