Icinga 2 HA envirnment

I’m having trouble setting up Icinga2 with high availability (HA). My plan is to install it on two nodes, mon1 and mon2. I want mon1 to be the primary node, with HA provided by Redis, but it’s not working as expected, and I think I’m doing something wrong.

Is there a guide available that explains this setup step-by-step? The documentation assumes a lot of prior knowledge.

Here’s what I’ve done so far:

  • mon1: Installed Icinga2, IcingaDB, Icinga Web, Icinga Web database, and Redis.
  • mon2: Installed the same setup as mon1, with Icinga2, IcingaDB, Icinga Web, Icinga Web database, and Redis.

I think I’ve misunderstood something—maybe mon2 doesn’t need everything that’s on mon1? Could you point me to any helpful guide?

Basically everything is on every master.
if you use icingadb, keep the icingadb id the same, see here.

you need some mechanism to do the failover of things icinga can’t manage, like virtual ips ->webinterface, and some services releated to your monitoring like icinga-x509, icinga-director if you use that.

Your mysql/mariadb can be on a galera cluster so both nodes can write to / read from one database.

It would be good to have some sync between icingaweb2 filebased settings, so you need an rsync or remote mount or something like that.

Best Regards Nicolas

I really appreciate your help, thank you.
I dont have that file containing icingadb id at this location “/var/lib/icinga2/icingadb.env”
shell i create that file, manually?
i am just following the documentation. having no prior icinga knowledge .

We use direvent on /etc/icingaweb2 with git and SSH to sync the icingaweb settings to the second master.

This allows also to have a history over time of all the changes.

/etc/direvent.conf

watcher {
   path /etc/icingaweb2 recursive;
   event (create, delete, write, attrib);
   command "/opt/icingaweb2-sync/commit-etc-icingaweb";
   option (stdout, stderr);
}

/opt/icingaweb2-sync/commit-etc-icingaweb

#!/usr/bin/env bash

cd /etc/icingaweb2
git add .
git commit --all --message="automated sync"
git push origin master
ssh icinga2.example.com 'cd /etc/icingaweb2/ && git stash --include-untracked && git reset --hard HEAD'

git on both masters under /opt/icingaweb2-sync/git/ and /etc/icingaweb2 is only the workdir. Also origin master of the first server is the second one so git push origin master moved the changes over.

1 Like

thanks a lot for the guidance.