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.
Setting up both Icinga 2 Masters: The first one as Master, the second one as Satellite/Agent like defined in the guide.
I added the enable_ha = false line to the ido-mysql conf (both master write to their own db)
Both servers have the same features enabled and the rest of the config is similar.
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?
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.
Do you maybe have a guide you followed to that? I’d like to try this way out first, because our company is really really small.
Same with this, so I can compare these two methods and decide which one to use, since I’m really not used to a DB cluster. If you know a good guide for this, I would actually try it out first.
Just a sidenote: If I now re-install the second master, can I just purge the hints to it in the conf-files of the first master, or do I need to do anything else?