Quick test with 2 masters and a single satellite.
Did on icingama01 icinga2 node wizard
.
then i created the tickets on icingama01 for icingama02 and satellite01 with
icinga2 pki ticket --cn 'icingama02'
icinga2 pki ticket --cn 'satellite01'
Run icinga2 node wizard
on icingama02 and satellite .
Final /etc/icinga2/zones.conf on icingama0[1,2]
/*
* Generated by Icinga 2 node setup commands
* on 2019-11-22 18:40:57 +0100
*/
object Endpoint "icingama01" {
host = "192.168.178.233"
}
object Endpoint "icingama02" {
host = "192.168.178.234"
}
object Zone "master" {
endpoints = [ "icingama01", "icingama02" ]
}
object Zone "global-templates" {
global = true
}
object Zone "director-global" {
global = true
}
#
## Zonen
#
object Endpoint "satellite01" {
}
object Zone "internet" {
endpoints = [ "satellite01" ]
parent = "master"
}
Restarted icinga2 on both master -> connection works
Final /etc/icinga2/zones.conf on satellite01
/*
* Generated by Icinga 2 node setup commands
* on 2019-11-22 18:48:51 +0100
*/
object Endpoint "icingama01" {
host = "192.168.178.233"
port = "5665"
}
object Endpoint "icingama02" {
host = "192.168.178.234"
port = "5665"
}
object Zone "master" {
endpoints = [ "icingama01", "icingama02" ]
}
object Endpoint "satellite01" {
}
object Zone "internet" {
endpoints = [ "satellite01" ]
parent = "master"
}
object Zone "global-templates" {
global = true
}
object Zone "director-global" {
global = true
}
Connection works to both masters
Created zone directories on icingama01:
mkdir -p /etc/icinga2/zones.d/master/hosts
mkdir -p /etc/icinga2/zones.d/internet/hosts
mkdir -p /etc/icinga2/zones.d/global-templates
Added test hosts to master zone
cat <<MASTER > /etc/icinga2/zones.d/master/hosts/test-hosts.conf
var globals.numhosts1 = 1
while (numhosts1 < 100) {
object Host "dummy-" + numhosts1 use(numhosts1) {check_command = "dummy" }
globals.numhosts1 += 1
}
MASTER
and for the internet zone:
cat <<INTERNET > /etc/icinga2/zones.d/internet/hosts/test-internet-hosts.conf
var globals.numhosts1 = 1
while (numhosts1 < 100) {
object Host "dummy-internet-" + numhosts1 use(numhosts1) {check_command = "dummy" }
globals.numhosts1 += 1
}
INTERNET
Triggered reload on icingama01 and after a few seconds both master have 198 host objects and the satellite01 has 99 host objects.
No matter how often i restart or trigger reload on icingama01, the configuration and number of host objects are on all masters and satellite like they should be.
From the logs i can see that icingama02 and satellite01 got a new configuration and then restarted. After restart they compare the configuration again, but this time the say âno change, no reloadâ
Log from satellite01 during configuration update
[2019-11-22 19:05:57 +0100] information/ApiListener: Reconnecting to endpoint 'icingama01' via host '192.168.178.233' and port '5665'
[2019-11-22 19:05:57 +0100] information/ApiListener: Reconnecting to endpoint 'icingama02' via host '192.168.178.234' and port '5665'
[2019-11-22 19:05:57 +0100] information/ApiListener: New client connection for identity 'icingama01' to [192.168.178.233]:5665
[2019-11-22 19:05:57 +0100] information/ApiListener: Requesting new certificate for this Icinga instance from endpoint 'icingama01'.
[2019-11-22 19:05:57 +0100] information/ApiListener: Sending config updates for endpoint 'icingama01' in zone 'master'.
[2019-11-22 19:05:57 +0100] information/ApiListener: Finished sending config file updates for endpoint 'icingama01' in zone 'master'.
[2019-11-22 19:05:57 +0100] information/ApiListener: Syncing runtime objects to endpoint 'icingama01'.
[2019-11-22 19:05:57 +0100] information/ApiListener: Finished syncing runtime objects to endpoint 'icingama01'.
[2019-11-22 19:05:57 +0100] information/ApiListener: Finished sending runtime config updates for endpoint 'icingama01' in zone 'master'.
[2019-11-22 19:05:57 +0100] information/ApiListener: Sending replay log for endpoint 'icingama01' in zone 'master'.
[2019-11-22 19:05:57 +0100] information/ApiListener: Finished sending replay log for endpoint 'icingama01' in zone 'master'.
[2019-11-22 19:05:57 +0100] information/ApiListener: Finished syncing endpoint 'icingama01' in zone 'master'.
[2019-11-22 19:05:57 +0100] information/ApiListener: Finished reconnecting to endpoint 'icingama01' via host '192.168.178.233' and port '5665'
[2019-11-22 19:05:57 +0100] information/ApiListener: Applying config update from endpoint 'icingama01' of zone 'master'.
[2019-11-22 19:05:57 +0100] information/ApiListener: Received configuration for zone 'internet' from endpoint 'icingama01'. Comparing the timestamp and checksums.
[2019-11-22 19:05:57 +0100] information/ApiListener: Stage: Updating received configuration file '/var/lib/icinga2/api/zones-stage/internet//_etc/hosts/hosts-internet-test.conf' for zone 'internet'.
[2019-11-22 19:05:57 +0100] information/ApiListener: Applying configuration file update for path '/var/lib/icinga2/api/zones-stage/internet' (295 Bytes).
[2019-11-22 19:05:57 +0100] information/ApiListener: Received configuration updates (1) from endpoint 'icingama01' are different to production, triggering validation and reload.
[2019-11-22 19:05:57 +0100] information/ApiListener: New client connection for identity 'icingama02' to [192.168.178.234]:5665
[2019-11-22 19:05:57 +0100] information/ApiListener: Requesting new certificate for this Icinga instance from endpoint 'icingama02'.
[2019-11-22 19:05:57 +0100] information/ApiListener: Sending config updates for endpoint 'icingama02' in zone 'master'.
[2019-11-22 19:05:57 +0100] information/ApiListener: Finished sending config file updates for endpoint 'icingama02' in zone 'master'.
[2019-11-22 19:05:57 +0100] information/ApiListener: Syncing runtime objects to endpoint 'icingama02'.
[2019-11-22 19:05:57 +0100] information/ApiListener: Finished syncing runtime objects to endpoint 'icingama02'.
[2019-11-22 19:05:57 +0100] information/ApiListener: Finished sending runtime config updates for endpoint 'icingama02' in zone 'master'.
[2019-11-22 19:05:57 +0100] information/ApiListener: Sending replay log for endpoint 'icingama02' in zone 'master'.
[2019-11-22 19:05:57 +0100] information/ApiListener: Finished sending replay log for endpoint 'icingama02' in zone 'master'.
[2019-11-22 19:05:57 +0100] information/ApiListener: Finished syncing endpoint 'icingama02' in zone 'master'.
[2019-11-22 19:05:57 +0100] information/ApiListener: Finished reconnecting to endpoint 'icingama02' via host '192.168.178.234' and port '5665'
[2019-11-22 19:05:57 +0100] information/ApiListener: Applying config update from endpoint 'icingama02' of zone 'master'.
[2019-11-22 19:05:57 +0100] information/ApiListener: Received configuration for zone 'internet' from endpoint 'icingama02'. Comparing the timestamp and checksums.
[2019-11-22 19:05:57 +0100] information/ApiListener: Stage: Updating received configuration file '/var/lib/icinga2/api/zones-stage/internet//_etc/hosts/hosts-internet-test.conf' for zone 'internet'.
[2019-11-22 19:05:57 +0100] information/ApiListener: Applying configuration file update for path '/var/lib/icinga2/api/zones-stage/internet' (295 Bytes).
[2019-11-22 19:05:57 +0100] information/ApiListener: Received configuration updates (1) from endpoint 'icingama02' are different to production, triggering validation and reload.
[2019-11-22 19:05:57 +0100] information/ApiListener: Config validation for stage '/var/lib/icinga2/api/zones-stage/' was OK, replacing into '/var/lib/icinga2/api/zones/' and triggering reload.
[2019-11-22 19:05:57 +0100] information/ApiListener: Applying configuration file update for path '/var/lib/icinga2/api/zones-stage/internet' (295 Bytes).
[2019-11-22 19:05:57 +0100] information/ApiListener: Received configuration updates (1) from endpoint 'icingama02' are different to production, triggering validation and reload.
[2019-11-22 19:05:57 +0100] information/ApiListener: Config validation for stage '/var/lib/icinga2/api/zones-stage/' was OK, replacing into '/var/lib/icinga2/api/zones/' and triggering reload.
[2019-11-22 19:05:57 +0100] information/ApiListener: Copying file 'internet//.checksums' from config sync staging to production zones directory.
[2019-11-22 19:05:57 +0100] information/ApiListener: Copying file 'internet//.timestamp' from config sync staging to production zones directory.
[2019-11-22 19:05:57 +0100] information/ApiListener: Copying file 'internet//_etc/hosts/hosts-internet-test.conf' from config sync staging to production zones directory.
[2019-11-22 19:05:57 +0100] information/ApiListener: Config validation for stage '/var/lib/icinga2/api/zones-stage/' was OK, replacing into '/var/lib/icinga2/api/zones/' and triggering reload.
[2019-11-22 19:05:57 +0100] information/ApiListener: Copying file 'internet//.checksums' from config sync staging to production zones directory.
[2019-11-22 19:05:57 +0100] information/ApiListener: Copying file 'internet//.timestamp' from config sync staging to production zones directory.
[2019-11-22 19:05:57 +0100] information/ApiListener: Copying file 'internet//_etc/hosts/hosts-internet-test.conf' from config sync staging to production zones directory.
[2019-11-22 19:06:00 +0100] information/Application: Received request to shut down.
[2019-11-22 19:06:00 +0100] information/Application: Shutting down...
[2019-11-22 19:06:00 +0100] information/CheckerComponent: 'checker' stopped.
[2019-11-22 19:06:00 +0100] information/ApiListener: 'api' stopped.
[2019-11-22 19:06:00 +0100] information/FileLogger: 'main-log' started.
[2019-11-22 19:06:00 +0100] information/ApiListener: 'api' started.
[2019-11-22 19:06:00 +0100] information/ApiListener: Started new listener on '[0.0.0.0]:5665'
[2019-11-22 19:06:00 +0100] information/CheckerComponent: 'checker' started.
[2019-11-22 19:06:00 +0100] information/ConfigItem: Activated all objects.
[2019-11-22 19:06:00 +0100] information/ApiListener: Reconnecting to endpoint 'icingama01' via host '192.168.178.233' and port '5665'
[2019-11-22 19:06:00 +0100] information/ApiListener: Reconnecting to endpoint 'icingama02' via host '192.168.178.234' and port '5665'
[2019-11-22 19:06:00 +0100] information/ApiListener: New client connection for identity 'icingama01' to [192.168.178.233]:5665
[2019-11-22 19:06:00 +0100] information/ApiListener: Requesting new certificate for this Icinga instance from endpoint 'icingama01'.
[2019-11-22 19:06:00 +0100] information/ApiListener: Sending config updates for endpoint 'icingama01' in zone 'master'.
[2019-11-22 19:06:00 +0100] information/ApiListener: Finished sending config file updates for endpoint 'icingama01' in zone 'master'.
[2019-11-22 19:06:00 +0100] information/ApiListener: Syncing runtime objects to endpoint 'icingama01'.
[2019-11-22 19:06:00 +0100] information/ApiListener: Finished syncing runtime objects to endpoint 'icingama01'.
[2019-11-22 19:06:00 +0100] information/ApiListener: Finished sending runtime config updates for endpoint 'icingama01' in zone 'master'.
[2019-11-22 19:06:00 +0100] information/ApiListener: Sending replay log for endpoint 'icingama01' in zone 'master'.
[2019-11-22 19:06:00 +0100] information/ApiListener: Replayed 99 messages.
[2019-11-22 19:06:00 +0100] information/ApiListener: Finished sending replay log for endpoint 'icingama01' in zone 'master'.
[2019-11-22 19:06:00 +0100] information/ApiListener: Finished syncing endpoint 'icingama01' in zone 'master'.
[2019-11-22 19:06:00 +0100] information/ApiListener: Finished reconnecting to endpoint 'icingama01' via host '192.168.178.233' and port '5665'
[2019-11-22 19:06:00 +0100] information/ApiListener: Applying config update from endpoint 'icingama01' of zone 'master'.
[2019-11-22 19:06:00 +0100] information/ApiListener: Received configuration for zone 'internet' from endpoint 'icingama01'. Comparing the timestamp and checksums.
[2019-11-22 19:06:00 +0100] information/ApiListener: Our production configuration is more recent than the received configuration update. Ignoring configuration file update for path '/var/lib/icinga2/api/zones-stage/internet'. Current timestamp '2019-11-22 19:05:51 +0100' (1574445951.740264) >= received timestamp '2019-11-22 19:05:51 +0100' (1574445951.740264).
[2019-11-22 19:06:00 +0100] information/ApiListener: Stage: Updating received configuration file '/var/lib/icinga2/api/zones-stage/internet//_etc/hosts/hosts-internet-test.conf' for zone 'internet'.
[2019-11-22 19:06:00 +0100] information/ApiListener: Applying configuration file update for path '/var/lib/icinga2/api/zones-stage/internet' (295 Bytes).
[2019-11-22 19:06:00 +0100] information/ApiListener: Received configuration updates (1) from endpoint 'icingama01' do not qualify for production, not triggering reload.
[2019-11-22 19:06:00 +0100] information/ApiListener: New client connection for identity 'icingama02' to [192.168.178.234]:5665
[2019-11-22 19:06:00 +0100] information/ApiListener: Requesting new certificate for this Icinga instance from endpoint 'icingama02'.
[2019-11-22 19:06:00 +0100] information/ApiListener: Sending config updates for endpoint 'icingama02' in zone 'master'.
[2019-11-22 19:06:00 +0100] information/ApiListener: Finished sending config file updates for endpoint 'icingama02' in zone 'master'.
[2019-11-22 19:06:00 +0100] information/ApiListener: Syncing runtime objects to endpoint 'icingama02'.
[2019-11-22 19:06:00 +0100] information/ApiListener: Finished syncing runtime objects to endpoint 'icingama02'.
[2019-11-22 19:06:00 +0100] information/ApiListener: Finished sending runtime config updates for endpoint 'icingama02' in zone 'master'.
[2019-11-22 19:06:00 +0100] information/ApiListener: Sending replay log for endpoint 'icingama02' in zone 'master'.
[2019-11-22 19:06:00 +0100] information/ApiListener: Replayed 99 messages.
[2019-11-22 19:06:00 +0100] information/ApiListener: Finished sending replay log for endpoint 'icingama02' in zone 'master'.
[2019-11-22 19:06:00 +0100] information/ApiListener: Finished syncing endpoint 'icingama02' in zone 'master'.
[2019-11-22 19:06:00 +0100] information/ApiListener: Finished reconnecting to endpoint 'icingama02' via host '192.168.178.234' and port '5665'
[2019-11-22 19:06:00 +0100] information/ApiListener: Applying config update from endpoint 'icingama02' of zone 'master'.
[2019-11-22 19:06:00 +0100] information/ApiListener: Received configuration for zone 'internet' from endpoint 'icingama02'. Comparing the timestamp and checksums.
[2019-11-22 19:06:00 +0100] information/ApiListener: Our production configuration is more recent than the received configuration update. Ignoring configuration file update for path '/var/lib/icinga2/api/zones-stage/internet'. Current timestamp '2019-11-22 19:05:51 +0100' (1574445951.740264) >= received timestamp '2019-11-22 19:05:51 +0100' (1574445951.740264).
[2019-11-22 19:06:00 +0100] information/ApiListener: Stage: Updating received configuration file '/var/lib/icinga2/api/zones-stage/internet//_etc/hosts/hosts-internet-test.conf' for zone 'internet'.
[2019-11-22 19:06:00 +0100] information/ApiListener: Applying configuration file update for path '/var/lib/icinga2/api/zones-stage/internet' (295 Bytes).
[2019-11-22 19:06:00 +0100] information/ApiListener: Received configuration updates (1) from endpoint 'icingama02' do not qualify for production, not triggering reload.
Tomorrow i will add another zone with 2 satellites.