Both masters are connected to the same database via a Galera cluster.
What exactly do you mean by enabling HA? As far as I know, there’s nothing specific to “start” HA in Icinga.Right ? or im wrong ?
Could you clarify if there’s something particular you’re referring to?
/**
* The API listener is used for distributed monitoring setups.
*/
object ApiListener "api" {
accept_config = true
accept_commands = true
ticket_salt = TicketSalt
}
influxdb :
/**
* The InfluxdbWriter type writes check result metrics and
* performance data to an InfluxDB HTTP API
*/
object InfluxdbWriter "influxdb" {
host = "127.0.0.1"
port = 8086
database = "icinga"
flush_threshold = 1024
flush_interval = 10s
host_template = {
measurement = "$host.check_command$"
tags = {
hostname = "$host.name$"
}
}
service_template = {
measurement = "$service.check_command$"
tags = {
hostname = "$host.name$"
service = "$service.name$"
}
}
enable_ha = true
}
Ido-mysql :
/**
* The IdoMysqlConnection type implements MySQL support
* for DB IDO.
*/
object IdoMysqlConnection "ido-mysql" {
user = "icinga"
password = "adb7f1558c63c890fcef"
host = "localhost"
database = "icinga"
enable_ha = true
}
/**
* The API listener is used for distributed monitoring setups.
*/
object ApiListener "api" {
accept_config = true
accept_commands = true
ticket_salt = TicketSalt
}
influxdb.conf:
/**
* The InfluxdbWriter type writes check result metrics and
* performance data to an InfluxDB v1 HTTP API
*/
object InfluxdbWriter "influxdb" {
host = "127.0.0.1"
port = 8086
database = "icinga"
flush_threshold = 1024
flush_interval = 10s
host_template = {
measurement = "$host.check_command$"
tags = {
hostname = "$host.name$"
}
}
service_template = {
measurement = "$service.check_command$"
tags = {
hostname = "$host.name$"
service = "$service.name$"
}
}
enable_ha = true
}
ido-mysql.conf:
/**
* The IdoMysqlConnection type implements MySQL support
* for DB IDO.
*/
object IdoMysqlConnection "ido-mysql" {
user = "icinga"
password = "adb7f1558c63c890fcef"
host = "localhost"
database = "icinga"
enable_ha = true
}
I just need to mention something: the first master didn’t have a database named icingaweb2, but the second one did. I added this database to the first master as well. I’ll also share the screenshots of the resources from both Master 1 and Master 2.
Master1 :
Master2 :
At least the IdoMysqlConnection isn’t looking like both nodes icinga and/or Galera are communicating properly. Can you try with a single MySQL DB on a external Host that both icinga masters connect to?
Currently, I have Icinga Director enabled on one of my master servers.
The second master is also included in the master zone configuration.
The database is synchronized using Galera.
However, when I start the icinga2 service on the second master server, the dashboard becomes empty.
In the logs( /var/lib/icinga2/api/zones-stage-startup-last-failed.log), I see many errors indicating that hosts or host templates are not defined or do not exist.
I’ll share a few examples here.
Should the Director only be enabled on the first master? Will these errors be resolved by enabling the Director?
[2024-12-10 16:26:59 +0100] information/cli: Icinga application loader (version: r2.14.0-1)
[2024-12-10 16:26:59 +0100] information/cli: Loading configuration file(s).
[2024-12-10 16:26:59 +0100] information/ConfigItem: Committing config item(s).
[2024-12-10 16:26:59 +0100] information/ApiListener: My API identity: smon02
[2024-12-10 16:26:59 +0100] warning/Zone: The Zone object 'satellite' has more than two endpoints. Due to a known issue this type of configuration is strongly discouraged and may cause Icinga to use excessive amounts of CPU time.
[2024-12-10 16:26:59 +0100] critical/config: Error: Validation failed for object 'AW - Aula' of type 'Host'; Attribute 'groups': Object 'Service-Zentrum' of type 'HostGroup' does not exist.
Location: in /var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf: 8016:5-8016:34
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(8014): display_name = "AW - Aula"
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(8015): address = "x"
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(8016): groups = [ "Service-Zentrum" ]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(8017): }
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(8018):
[2024-12-10 16:26:59 +0100] critical/config: Error: Validation failed for object 'aw-mul1-le4' of type 'Host'; Attribute 'groups': Object 'ACI' of type 'HostGroup' does not exist.
Location: in /var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf: 7689:5-7689:22
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(7687): display_name = "aw-mul1-le4"
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(7688): address = "x"
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(7689): groups = [ "ACI" ]
^^^^^^^^^^^^^^^^^^
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(7690): }
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(7691):
[2024-12-10 16:26:59 +0100] critical/config: Error: Validation failed for object 'aw-c7005-admin2' of type 'Host'; Attribute 'groups': Object 'c7000_synergy' of type 'HostGroup' does not exist.
Location: in /var/lib/icinga2/api/zones-stage//satellite/director/host_templates.conf: 90:5-90:32
/var/lib/icinga2/api/zones-stage//satellite/director/host_templates.conf(88): check_command = "hostalive"
/var/lib/icinga2/api/zones-stage//satellite/director/host_templates.conf(89): command_endpoint = "satellite01"
/var/lib/icinga2/api/zones-stage//satellite/director/host_templates.conf(90): groups = [ "c7000_synergy" ]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/var/lib/icinga2/api/zones-stage//satellite/director/host_templates.conf(91): vars.snmp_community = "x"
/var/lib/icinga2/api/zones-stage//satellite/director/host_templates.conf(92): }
[2024-12-10 16:26:59 +0100] critical/config: Error: Validation failed for object 'aw-bul1-uz2 at' of type 'Host'; Attribute 'groups': Object 'usv_zentral' of type 'HostGroup' does not exist.
Location: in /var/lib/icinga2/api/zones-stage//satellite/director/host_templates.conf: 177:5-177:30
/var/lib/icinga2/api/zones-stage//satellite/director/host_templates.conf(175): check_command = "hostalive"
/var/lib/icinga2/api/zones-stage//satellite/director/host_templates.conf(176): command_endpoint = "satellite02"
/var/lib/icinga2/api/zones-stage//satellite/director/host_templates.conf(177): groups = [ "usv_zentral" ]
^^^^^^^^^^^^^^^^^^^^^^^^^^
/var/lib/icinga2/api/zones-stage//satellite/director/host_templates.conf(178): vars.snmp_community = "x"
/var/lib/icinga2/api/zones-stage//satellite/director/host_templates.conf(179): }
[2024-12-10 16:26:59 +0100] critical/config: Error: Validation failed for object 'aw-v1l1-ats3' of type 'Host'; Attribute 'groups': Object 'ats' of type 'HostGroup' does not exist.
Location: in /var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf: 7944:5-7944:22
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(7942): display_name = "aw-v1l1-ats3"
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(7943): address = "x"
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(7944): groups = [ "ats" ]
^^^^^^^^^^^^^^^^^^
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(7945): vars["_override_servicevars"] += {
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(7946): Strom = {
[2024-12-10 16:26:59 +0100] critical/config: Error: Validation failed for object 'aw-del1-li1' of type 'Host'; Attribute 'groups': Object 'ACI' of type 'HostGroup' does not exist.
Location: in /var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf: 7626:5-7626:22
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(7624): display_name = "aw-del1-li1"
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(7625): address = "x"
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(7626): groups = [ "ACI" ]
^^^^^^^^^^^^^^^^^^
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(7627): }
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(7628):
[2024-12-10 16:26:59 +0100] critical/config: Error: Validation failed for object 'aw-nora04' of type 'Host'; Attribute 'groups': Object 'oracle_servers' of type 'HostGroup' does not exist.
Location: in /var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf: 1264:5-1264:33
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(1262): display_name = "aw-nora04"
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(1263): address = "x"
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(1264): groups = [ "oracle_servers" ]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(1265): vars.hpilocommunity = "schubert"
/var/lib/icinga2/api/zones-stage//satellite/director/hosts.conf(1266): vars.hpiloservertype = "blade"
[2024-12-10 16:26:59 +0100] critical/config: Error: Validation failed for object 'fs-fa-transfer.mdw.ac.at' of type 'Host'; Attribute 'groups': Object 'netapp' of type 'HostGroup' does not exist.
Location: in /var/lib/icinga2/api/zones-stage//satellite/director/host_templates.conf: 260:5-260:25
/var/lib/icinga2/api/zones-stage//satellite/director/host_templates.conf(258): check_command = "hostalive"
/var/lib/icinga2/api/zones-stage//satellite/director/host_templates.conf(259): command_endpoint = "satellite02"
/var/lib/icinga2/api/zones-stage//satellite/director/host_templates.conf(260): groups = [ "netapp" ]
^^^^^^^^^^^^^^^^^^^^^