diff --git a/dbm-services/common/db-config/assets/migrations/000043_sqlservercomm_data.down.sql b/dbm-services/common/db-config/assets/migrations/000043_sqlservercomm_data.down.sql new file mode 100644 index 0000000000..eabd3f2083 --- /dev/null +++ b/dbm-services/common/db-config/assets/migrations/000043_sqlservercomm_data.down.sql @@ -0,0 +1,2 @@ +DELETE FROM tb_config_file_def WHERE namespace='sqlservercomm'; +DELETE FROM tb_config_name_def WHERE namespace='sqlservercomm' AND (flag_encrypt!=1 or value_default like '{{%'); diff --git a/dbm-services/common/db-config/assets/migrations/000043_sqlservercomm_data.up.sql b/dbm-services/common/db-config/assets/migrations/000043_sqlservercomm_data.up.sql new file mode 100644 index 0000000000..a479f0eae7 --- /dev/null +++ b/dbm-services/common/db-config/assets/migrations/000043_sqlservercomm_data.up.sql @@ -0,0 +1,96 @@ +-- MySQL dump 10.13 Distrib 5.7.20, for Linux (x86_64) +-- +-- Host: localhost Database: bk_dbconfig +-- ------------------------------------------------------ +-- Server version 5.7.20-tmysql-3.3-log +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50717 SELECT COUNT(*) INTO @rocksdb_has_p_s_session_variables FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'performance_schema' AND TABLE_NAME = 'session_variables' */; +/*!50717 SET @rocksdb_get_is_supported = IF (@rocksdb_has_p_s_session_variables, 'SELECT COUNT(*) INTO @rocksdb_is_supported FROM performance_schema.session_variables WHERE VARIABLE_NAME=\'rocksdb_bulk_load\'', 'SELECT 0') */; +/*!50717 PREPARE s FROM @rocksdb_get_is_supported */; +/*!50717 EXECUTE s */; +/*!50717 DEALLOCATE PREPARE s */; +/*!50717 SET @rocksdb_enable_bulk_load = IF (@rocksdb_is_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @rocksdb_dummy_bulk_load = 0') */; +/*!50717 PREPARE s FROM @rocksdb_enable_bulk_load */; +/*!50717 EXECUTE s */; +/*!50717 DEALLOCATE PREPARE s */; + +-- +-- Dumping data for table `tb_config_file_def` +-- +-- WHERE: namespace='sqlservercomm' + +INSERT INTO `tb_config_file_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_type_lc`, `conf_file_lc`, `level_names`, `level_versioned`, `conf_name_validate`, `conf_value_validate`, `value_type_strict`, `namespace_info`, `version_keep_limit`, `version_keep_days`, `conf_name_order`, `description`, `created_at`, `updated_at`, `updated_by`) VALUES (347,'sqlservercomm','alarm','alarm.conf','告警配置','NULL','plat,app,module,cluster','NULL',1,1,0,NULL,5,365,0,'告警配置','2024-04-12 15:06:53','2024-04-12 15:07:34',NULL); +INSERT INTO `tb_config_file_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_type_lc`, `conf_file_lc`, `level_names`, `level_versioned`, `conf_name_validate`, `conf_value_validate`, `value_type_strict`, `namespace_info`, `version_keep_limit`, `version_keep_days`, `conf_name_order`, `description`, `created_at`, `updated_at`, `updated_by`) VALUES (346,'sqlservercomm','backup','dbbackup.conf','备份配置','NULL','plat,app,module,cluster',NULL,1,1,0,NULL,5,365,0,'备份配置','2024-04-11 17:58:05','2024-04-12 15:07:34',NULL); +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- MySQL dump 10.13 Distrib 5.7.20, for Linux (x86_64) +-- +-- Host: localhost Database: bk_dbconfig +-- ------------------------------------------------------ +-- Server version 5.7.20-tmysql-3.3-log +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50717 SELECT COUNT(*) INTO @rocksdb_has_p_s_session_variables FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'performance_schema' AND TABLE_NAME = 'session_variables' */; +/*!50717 SET @rocksdb_get_is_supported = IF (@rocksdb_has_p_s_session_variables, 'SELECT COUNT(*) INTO @rocksdb_is_supported FROM performance_schema.session_variables WHERE VARIABLE_NAME=\'rocksdb_bulk_load\'', 'SELECT 0') */; +/*!50717 PREPARE s FROM @rocksdb_get_is_supported */; +/*!50717 EXECUTE s */; +/*!50717 DEALLOCATE PREPARE s */; +/*!50717 SET @rocksdb_enable_bulk_load = IF (@rocksdb_is_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @rocksdb_dummy_bulk_load = 0') */; +/*!50717 PREPARE s FROM @rocksdb_enable_bulk_load */; +/*!50717 EXECUTE s */; +/*!50717 DEALLOCATE PREPARE s */; + +-- +-- Dumping data for table `tb_config_name_def` +-- +-- WHERE: namespace='sqlservercomm' AND (flag_encrypt!=1 or value_default like '{{%') + +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23686,'sqlservercomm','alarm','alarm.conf','log_send_queue','INT','1048576',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 15:26:47','2024-04-12 15:26:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23687,'sqlservercomm','alarm','alarm.conf','shrink_size','INT','200',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 16:11:08','2024-04-12 16:11:08',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23688,'sqlservercomm','alarm','alarm.conf','slow_duration','INT','1000',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 15:26:47','2024-04-12 15:26:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23689,'sqlservercomm','alarm','alarm.conf','slow_saveday','INT','60',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 15:26:47','2024-04-12 15:26:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23690,'sqlservercomm','alarm','alarm.conf','traceon','INT','0',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 15:26:47','2024-04-12 15:26:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23691,'sqlservercomm','alarm','alarm.conf','updatestats','INT','0',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 15:26:47','2024-04-12 15:26:47',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23680,'sqlservercomm','backup','dbbackup.conf','backup_client_path','STRING','C:\\cygwinroot\\usr\\local\\backup_client\\bin\\backup_client.exe',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:10:58','2024-04-12 11:10:58',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23681,'sqlservercomm','backup','dbbackup.conf','backup_storage_type','STRING','hdfs',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:10:58','2024-04-12 11:10:58',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23678,'sqlservercomm','backup','dbbackup.conf','backup_type','STRING','physics',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:10:58','2024-04-12 11:10:58',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23679,'sqlservercomm','backup','dbbackup.conf','data_schema_grant','STRING','all',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:10:58','2024-04-12 11:10:58',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23684,'sqlservercomm','backup','dbbackup.conf','full_backup_file_tag','STRING','MSSQL_FULL_BACKUP',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:10:58','2024-04-12 11:10:58',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23676,'sqlservercomm','backup','dbbackup.conf','full_backup_min_size_mb','INT','40960',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:09:54','2024-04-12 11:09:54',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23672,'sqlservercomm','backup','dbbackup.conf','full_backup_path','STRING','D:\\dbbak\\full\\',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-11 17:41:52','2024-04-11 17:58:30',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23682,'sqlservercomm','backup','dbbackup.conf','full_backup_report_path','STRING','D:\\dbbak\\backup_result.log',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:10:58','2024-04-12 11:10:58',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23674,'sqlservercomm','backup','dbbackup.conf','keep_full_backup_days','INT','2',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:09:36','2024-04-12 11:09:36',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23675,'sqlservercomm','backup','dbbackup.conf','keep_log_backup_days','INT','2',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:09:45','2024-04-12 11:09:45',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23685,'sqlservercomm','backup','dbbackup.conf','log_backup_file_tag','STRING','INCREMENT_BACKUP',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:10:58','2024-04-12 11:10:58',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23677,'sqlservercomm','backup','dbbackup.conf','log_backup_min_size_mb','INT','30720',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:10:57','2024-04-12 11:10:57',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23673,'sqlservercomm','backup','dbbackup.conf','log_backup_path','STRING','D:\\dbbak\\log\\',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 10:58:15','2024-04-12 10:58:15',0); +INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23683,'sqlservercomm','backup','dbbackup.conf','log_backup_report_path','STRING','D:\\dbbak\\binlog_result.log',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:10:58','2024-04-12 11:10:58',0); +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + diff --git a/dbm-services/go.work.sum b/dbm-services/go.work.sum index 0c1a47a201..fdfe3c97cd 100644 --- a/dbm-services/go.work.sum +++ b/dbm-services/go.work.sum @@ -1284,6 +1284,7 @@ golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/image v0.0.0-20210216034530-4410531fe030 h1:lP9pYkih3DUSC641giIXa2XqfTIbbbRr0w2EOTA7wHA= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs= @@ -1306,6 +1307,7 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= @@ -1320,6 +1322,7 @@ golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74Ow golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1335,8 +1338,10 @@ golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220908150016-7ac13a9a928d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1412,4 +1417,4 @@ modernc.org/sqlite v1.18.1/go.mod h1:6ho+Gow7oX5V+OiOQ6Tr4xeqbx13UZ6t+Fw9IRUG4d4 modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -modernc.org/y v1.0.9/go.mod h1:EjpZC9SxK4Fr+sF7KezoT/AKrl7MOnNO/kNrhxTeib4= \ No newline at end of file +modernc.org/y v1.0.9/go.mod h1:EjpZC9SxK4Fr+sF7KezoT/AKrl7MOnNO/kNrhxTeib4= diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/dbbackup/backup_index.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/dbbackup/backup_index.go index 8b471e5099..8244752e98 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/dbbackup/backup_index.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/dbbackup/backup_index.go @@ -143,7 +143,7 @@ func (f *BackupIndexFile) UntarFiles(untarDir string) error { // 物理备份, merge parts if len(f.splitParts) > 0 { // TODO 考虑使用 pv 限速 - cmd := fmt.Sprintf(`cd %s && cat %s | tar -xf -C %s/ -`, f.backupDir, strings.Join(f.splitParts, " "), untarDir) + cmd := fmt.Sprintf(`cd %s && cat %s | tar -xf - -C %s/`, f.backupDir, strings.Join(f.splitParts, " "), untarDir) if _, err := osutil.ExecShellCommand(false, cmd); err != nil { return errors.Wrap(err, cmd) } diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/restore/dbloader_restore.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/restore/dbloader_restore.go index b700a495c9..d4b7d02262 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/restore/dbloader_restore.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/restore/dbloader_restore.go @@ -3,6 +3,10 @@ package restore import ( "fmt" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "github.com/spf13/cast" + "dbm-services/common/go-pubpkg/logger" "dbm-services/common/go-pubpkg/validate" "dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/restore/dbloader" @@ -12,10 +16,6 @@ import ( "dbm-services/mysql/db-tools/dbactuator/pkg/util" "dbm-services/mysql/db-tools/dbactuator/pkg/util/mysqlutil" "dbm-services/mysql/db-tools/dbactuator/pkg/util/osutil" - - "github.com/jinzhu/copier" - "github.com/pkg/errors" - "github.com/spf13/cast" ) // DBLoader 使用 dbbackup-go loadbackup 进行恢复 @@ -46,9 +46,11 @@ func (m *DBLoader) Init() error { logger.Warn("fail to get mysqld socket: %s", cnfFileName) } } - if err = m.BackupInfo.indexObj.ValidateFiles(); err != nil { - return err - } + /* + if err = m.BackupInfo.indexObj.ValidateFiles(); err != nil { + return err + } + */ if err = m.initDirs(); err != nil { return err } @@ -179,7 +181,6 @@ func (m *DBLoader) initDirs() error { } */ m.targetDir = m.BackupInfo.indexObj.GetTargetDir(m.taskDir) - //m.targetDir = filepath.Join(m.taskDir, m.backupBaseName) return nil }