Packages sync in a multi-master environment

Hi there,

I’ve deployed Director to both of our masters, and I’ve created a host template and host.

I’m running into issues with the sync of packages in the folder ‘/var/lib/icinga2/api/packages’ - specifically the host template does not appear to have come across on the second master, but the host itself has.
[2019-07-11 10:14:02 +1000] critical /config: Error: Import references unknown template: ‘Windows Server’
Location: in /var/lib/icinga2/api/zones/satellite/director/hosts.conf: 2:5-2:27.

The working server has a director folder in …/api/packages:
[root@master1 ~]# ls -l /var/lib/icinga2/api/packages
total 0
drwx------. 3 icinga icinga 126 Aug 30 2018 _api
drwx------. 4 icinga icinga 153 Jul 11 09:28 director

But the second master does not:
[root@master2 ~]# ls -l /var/lib/icinga2/api/packages
total 0
drwx------. 3 icinga icinga 126 Jun 13 2018 _api

From what I understand the API should be syncing these config packages across, and it seems it must be working in some fashion as the config for the host I created in director was created on the second master.

Is there anything special about this folder - should it get synchronised with the hosts created in Director?

After re-reading the documentation, if I am understanding correctly master1 should only have config in /var/lib/icinga2/api/packages/director and this should be deployed to master2 in /var/lib/icinga2/api/zones.

I also realised this bit of config was commented out on master2, so I’ve added it back in, and confirmed it now exists on both masters:
object Zone “director-global” {
global = true

After running systemctl reload icinga2 on master1, and greping the logs on master2, I’ve found that the director-global files were not being sent by master1… seems to be working now though.

1 Like