Update database targets in HA environments using metaconsole

This commit is contained in:
Enrique Martin 2024-02-20 14:01:32 +01:00
parent d9bc9b199b
commit 5e49200f72
3 changed files with 20 additions and 0 deletions

View File

@ -97,4 +97,11 @@ INSERT IGNORE INTO `tcredential_store` (`identifier`, `id_group`, `product`, `ex
;
UPDATE `trecon_task` SET `auth_strings` = IF(`auth_strings` = '',CONCAT(@creds_name,`id_rt`),CONCAT(@creds_name,`id_rt`,',',`auth_strings`)) WHERE `snmp_version` = 3 AND `snmp_enabled` = 1;
CREATE TABLE IF NOT EXISTS `tmetaconsole_ha_databases` (
`node_id` int unsigned NOT NULL,
`host` varchar(255) DEFAULT '',
`master` tinyint unsigned DEFAULT '0',
PRIMARY KEY (`node_id`, `host`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
COMMIT;

View File

@ -4653,4 +4653,14 @@ CREATE TABLE IF NOT EXISTS `tmerge_queries` (
`utimestamp` int(20) unsigned NOT NULL default 0,
`query` LONGTEXT NOT NULL default "",
PRIMARY KEY (`steps`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
-- ---------------------------------------------------------------------
-- Table `tmetaconsole_ha_databases`
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tmetaconsole_ha_databases` (
`node_id` int unsigned NOT NULL,
`host` varchar(255) DEFAULT '',
`master` tinyint unsigned DEFAULT '0',
PRIMARY KEY (`node_id`, `host`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;

View File

@ -743,6 +743,9 @@ sub ha_main_pandora($) {
# Execute resync actions.
enterprise_hook('pandoraha_resync_dbs', [$conf, $dbh, $DB_Host, \@HA_DB_Hosts]);
# Update and push HA databases info to Metaconsole or nodes.
enterprise_hook('pandoraha_update_and_push_databases_info', [$conf, $dbh]);
# Synchronize nodes.
enterprise_hook('pandoraha_sync_node', [$conf, $dbh]);
};