Heterogeneous database unified deployment management method based on cluster management platform

By building metadata, environment detection, and adaptive identification technologies on the Apache Ambari 3.0 management platform, unified deployment and management of domestic databases in heterogeneous environments has been achieved, solving the problems of deployment failure and high operational complexity, and improving deployment efficiency and performance.

CN121387310APending Publication Date: 2026-01-23FUJIAN MEIYA GUOYUN INTELLIGENT EQUIP CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202511658503.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-13
Publication Date
2026-01-23

AI Technical Summary

Technical Problem

The lack of a unified management platform in existing technologies leads to the independent deployment of domestic databases in heterogeneous environments, resulting in high operation and maintenance costs, low resource utilization, and high system complexity. Furthermore, the lack of standardized service definitions and automated deployment support for domestic databases results in high deployment failure rates and poor performance.

Method used

Based on the Apache Ambari 3.0 management platform, this system enables unified deployment and management of domestic databases through predefined metadata, building multi-version package repositories, environment detection, and adaptive identification technologies. This includes environment fingerprint information matching, dynamic selection of installation packages, a unified database adaptation layer, and visual deployment orchestration functions.

Benefits of technology

It enables efficient and stable one-click deployment of domestic databases in heterogeneous environments, reduces operational complexity, improves deployment efficiency and reliability, provides a unified operation and maintenance management experience and performance optimization, and reduces total cost of ownership.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121387310A_ABST
    Figure CN121387310A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of computer software, and particularly relates to a heterogeneous database unified deployment management method based on a cluster management platform, which comprises the following steps: predefining metadata of various database services; the method comprises the following steps: pre-constructing a multi-version program package warehouse, and establishing a structured warehouse directory system; obtaining a chip architecture and an operating system type of the target node, and generating environment fingerprint information; dynamically selecting a database installation package matched with the current environment and a dependency item set of the database installation package by mapping a warehouse directory system; through a unified database adaptation layer, a standardized operation interface is called, and installation, configuration and start-stop operation of the database are executed; a visual deployment and arrangement function based on component roles is provided by expanding a Web service interface of the management platform; and according to a deployment arrangement result and the environment fingerprint information, calling a deployment script to complete automatic deployment and configuration of the database cluster. According to the invention, unified adaptation, deployment and full-life-cycle management of various domestic databases are realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of computer software, and particularly relates to a heterogeneous database unified deployment management method based on a cluster management platform. BACKGROUND

[0002] With the deepening of the China's information technology (IT) strategy, the demand for domestic databases (such as OpenGauss, OceanBase, Dream, and Renmin Gold Warehouse) is growing in the government, finance, and energy industries. However, these database systems are usually independently deployed and independently maintained, and lack a unified management platform, resulting in high operation and maintenance costs, low resource utilization, and high system complexity. Apache Ambari, as a widely used cluster management platform in the Hadoop ecosystem, supports the automated deployment, monitoring, and management of big data components, but it does not natively support the integration and management of domestic databases.

[0003] Existing domestic database deployment solutions rely on independent management tools or manual script deployment provided by each vendor, and lack unified life cycle management and visual operation and maintenance interfaces. In the China's IT environment, due to the diversity of hardware architectures (X86 / ARM) and operating systems (Kylin, UOS, and OpenEuler), deployment adaptation work is complex, and problems such as dependency loss, configuration errors, and poor performance are prone to occur. In modern management platforms such as Ambari 3.0, there is a lack of standardized service definition and automated deployment support for domestic databases. SUMMARY

[0004] The purpose of the present application is to provide a heterogeneous database unified deployment management method based on a cluster management platform to achieve unified adaptation, deployment, and full life cycle management of multiple domestic databases.

[0005] In a first aspect, the embodiments of the present application provide a heterogeneous database unified deployment management method based on a cluster management platform, comprising: Predefining metadata of multiple database services in the management platform, wherein the metadata at least defines component roles of each database service, dependency relationships between components, configuration parameter structures, and deployment script paths; Preconstructing a multi-version program package repository by compiling database components for different target chip architectures and different target operating systems to generate corresponding installation packages, and establishing a structured repository directory system according to the combination of chip architectures and operating system types; Issuing an environment detection instruction to a target node to obtain the chip architecture and operating system type of the target node and generate environment fingerprint information; According to the environment fingerprint information, a database installation package and a dependent item set matching a current environment are dynamically selected from the pre-built multi-version package warehouse by mapping the warehouse directory system; An installation, configuration and start-stop operation of the database is performed by calling a standardized operation interface through a unified database adaptation layer constructed based on the metadata; A visual deployment orchestration function based on the component roles is provided by extending a Web service interface of the management platform; According to the deployment orchestration result and the environment fingerprint information, a deployment script is called to complete the automated deployment and configuration of the database cluster.

[0006] Optionally, the metadata of the pre-defined multiple database services is implemented through a service definition file, and the service definition file is in an extensible markup language format; A root element of the service definition file is <metainfo>elements; the <metainfo>under the element <services>element as its direct child; said <services>one or more of the elements are defined <service>element, each <service>Element is used to describe an independent database service; wherein the <service>The elements at least include: a service name element for defining a unique identifier of the service; a service display name element for defining a display name of the service; and a service component element for defining one or more component sub-elements to describe constituent components of the service.

[0007] Optionally, the component sub-elements at least include: a component name element for defining a unique identifier of the component; a component category element for defining a role category of the component, wherein the component role category defined by the component category element includes a master node role and a slave node role; a component quantity constraint element for defining a deployment quantity constraint of the component, wherein the component quantity constraint element value of the master node role is 1, and the component quantity constraint element value of the slave node role is 1 or more; and a component command script element for associating a deployment script, wherein the component command script element includes a script path sub-element, a script type sub-element, and a timeout time sub-element for defining a timeout time of execution of the deployment script.

[0008] Optionally, the structured warehouse directory system is established according to a combination of a chip architecture and an operating system type, and includes: a top-level directory is divided according to the chip architecture, including an x86_64 directory and an aarch64 directory; a sub-directory is established under each chip architecture directory according to the operating system type; a database installation package compiled for the combination of the chip architecture and the operating system is stored in each operating system sub-directory; wherein the naming of the database installation package includes information of a corresponding database type, a version number, a target operating system, and a target chip architecture, so that the installation package file and the environment information indicated by the storage path of the installation package file are mutually verified.

[0009] Optionally, the environment detection instruction is issued to the target node, and includes: a Python environment detection script is executed on the target node through an Ambari Agent; the script acquires the chip architecture through an os.uname().machine command; the operating system type is identified by detecting the existence of specific system files, wherein a / etc / kylin-release file is detected to identify a Kylin system, an / etc / uos-release file is detected to identify a UOS system, an / etc / openEuler-release file is detected to identify an OpenEuler system, and an / etc / centos-release file is detected to identify a CentOS system; Determine the specific version number of the operating system by reading the content of the specific system file and checking whether a predefined version identification string is contained in the content; wherein, check whether the content of the / etc / kylin-release file contains V10 to determine the Kylin V10 version, check whether the content of the / etc / uos-release file contains 20 to determine the UOS 20 version, check whether the content of the / etc / openEuler-release file contains 22.03 to determine the OpenEuler 22.03 version, and check whether the content of the / etc / centos-release file contains 7 to determine the CentOS 7 version.

[0010] Optionally, the process of executing the environment detection instruction comprises an error processing mechanism, which specifically comprises: capturing an exception generated in the execution process after calling the environment detection function; recording a success log containing the generated chip architecture, operating system type and version information when the environment detection is successful; recording an error log describing the failure reason when the environment detection fails, and re-throwing an exception to terminate the subsequent deployment process.

[0011] Optionally, the dynamic selection of the dependency set is implemented by a dependency relationship parser, which comprises: a predefined dependency mapping table, used to store a corresponding dependency package list with a joint key of database type, chip architecture and operating system type; a dependency parsing method, used to query and return the corresponding dependency package list from the dependency mapping table according to the input database type, chip architecture and operating system type; and an architecture-specific dependency processing method, used to automatically append ARM architecture-specific dependency packages on the basis of the dependency list when the chip architecture is aarch64.

[0012] Optionally, the unified database adaptation layer defines a standardized operation interface through an abstract base class, and the abstract base class comprises the following abstract methods: an install() method for executing database installation; a configure() method for generating and applying database configuration; start() and stop() methods for starting and stopping database services; a get_status() method for obtaining the running state of the database; a backup() method and a restore() method for database backup and recovery; wherein, the specific adapter implementation for the OpenGauss database comprises: an environment checking module for verifying system resources and dependencies; a template rendering module for dynamically generating a database configuration file according to configuration parameters using a template engine; and a script execution module for calling a Shell script to execute the installation operation and verifying the installation result.

[0013] Optionally, the visualization deployment orchestration function is implemented through a front-end JavaScript component, including: A database service component definition table defines icons, display names and resource constraints of each database component. A topology orchestration engine provides a graphical drag-and-drop interface and performs resource compliance verification when a component is placed, including architecture compatibility verification, operating system compatibility verification and resource sufficiency verification.

[0014] Optionally, the deployment script is called to complete automated deployment and configuration, specifically including: An Ansible deployment playbook is dynamically generated, including the following tasks: installing architecture-specific dependency packages; downloading matching database installation packages from a package repository; installing database packages; generating a database configuration file using a template; executing a database initialization command; starting the database service and setting it to start automatically at boot.

[0015] Compared with the prior art, the present application brings multiple significant beneficial effects in the field of unified management and deployment of localization databases through systematic innovation: first, the scheme realizes unprecedented wide compatibility, systematically solves the compatibility problems of multiple domestic databases such as OpenGauss, OceanBase, Dream, Renmin Gold Warehouse, etc. in the mixed environment of mainstream domestic operating systems such as Kylin, UOS, OpenEuler and X86 (Haiguang), ARM (Kangpeng) multi-chip architecture, through environment self-adaptive identification technology and intelligent package selection mechanism, ensures that each database can run stably on different domestic operating systems such as Kylin V10 SP2, UOS 20, OpenEuler22.03 LTS, and completely solves the deployment failure problems caused by missing dependent libraries, environment recognition errors, and hardware instruction set mismatches; second, the scheme greatly improves the deployment efficiency and reliability, through the automatic deployment engine and B / S visual management platform based on Ambari extension, the manual deployment process which originally takes several days or even several weeks is shortened to hours, which significantly reduces the technical threshold and human error; at the same time, the scheme provides excellent unified operation and management experience, through the innovative unified database adaptation layer and visual control interface, realizes centralized and standardized management of multiple types of databases in mixed localization environment, solves the pain points of independent management and fragmented operation interface of each database in traditional schemes; in addition, the scheme also provides deep performance and security optimization guarantee, through the deep optimization template and security reinforcement baseline for domestic software and hardware stack, fully develops the performance potential of domestic hardware, effectively improves the security controllability level of the system; finally, the scheme significantly reduces the total cost of ownership and enhances the system flexibility, through resource unified scheduling and automatic operation and maintenance, reduces the labor cost and resource waste, and through integrated cluster high availability and disaster recovery mechanism, guarantees business continuity. In summary, through multi-level technical innovation, the present application not only solves the technical problem of unified management of multiple databases in the localization environment, but also brings comprehensive improvement in deployment efficiency, operation experience, system performance, security and economy, etc., providing complete, reliable and efficient technical support for promoting the implementation of the signal creation strategy in the field of data infrastructure. BRIEF DESCRIPTION OF DRAWINGS

[0016] Figure 1 A heterogeneous database unified deployment management method based on a cluster management platform is provided for the present application. Figure 2 A system overall architecture schematic diagram is provided for the present application.

[0017] Figure 3 A complete automatic deployment process is provided for the present embodiment. DETAILED DESCRIPTION

[0018] The application will be described in detail below through examples.

[0019] With the deepening of the Xinyuan strategy, the demand for localized databases (such as OpenGauss, OceanBase, Dream, and RenDa JinCang) is growing in industries such as government, finance, and energy. However, these database systems are usually deployed and maintained independently, lacking a unified management platform, resulting in high operation and maintenance costs, low resource utilization, and high system complexity. Apache Ambari, as a widely used cluster management platform in the Hadoop ecosystem, supports the automated deployment, monitoring, and management of big data components, but it does not natively support the integration and management of domestic databases.

[0020] Existing deployment solutions for domestic databases rely on independent management tools or manual script deployment provided by each vendor, lacking unified life cycle management and visual operation and maintenance interfaces. In the Xinyuan environment, due to the diversity of hardware architectures (X86 / ARM) and operating systems (Kylin, UOS, OpenEuler), deployment adaptation work is complex, and problems such as dependency loss, configuration errors, and poor performance are prone to occur. Especially in modern management platforms such as Ambari 3.0, there is a lack of standardized service definitions and automated deployment support for domestic databases.

[0021] Currently, the types of domestic database management systems in the market are developing rapidly, and the product system is showing a trend of diversification. Each mainstream domestic database product (such as OpenGauss, OceanBase, Dream, and RenDa JinCang) usually adopts an independent deployment and operation and maintenance management mode, lacking an integrated management solution that can achieve unified deployment, configuration, monitoring, and operation and maintenance in a cross-platform heterogeneous environment. In actual projects, if users need to use multiple domestic databases simultaneously, they have to build a management environment for each database system and use the exclusive tools provided by each vendor to perform installation, monitoring, and routine maintenance operations. This approach leads to fragmented management interfaces and non-uniform operation processes, making it difficult to achieve efficient centralized operation and management.

[0022] Especially under the background of the overall promotion of the policy, users have increasingly high requirements for the autonomy and controllability of underlying infrastructure, and various domestic databases must be adapted to the combination of various domestic chip architectures (such as Haiguang of X86 architecture and Kunpeng of ARM architecture) and domestic operating systems (such as Kylin, UOS and OpenEuler). However, there are still a large number of legacy server clusters based on Intel chips and non-domestic operating systems (such as CentOS) in the actual IT environment of users. Due to budget, migration complexity and ecological compatibility, they cannot be replaced with pure domestic architectures at one time, thus forming a hybrid physical environment. This heterogeneous coexistence further increases the difficulty of unified operation and maintenance of databases, and an integrated management method is needed to manage multiple types of domestic databases in any combination environment (multiple chip architecture servers + multiple operating systems). The combination types to be supported include but are not limited to: X86 (Intel / Haiguang chip) + CentOS; X86 (Intel / Haiguang chip) + OpenEuler; ARM (Kunpeng chip) + OpenEuler; ARM (Kunpeng chip) + Kylin; ARM (Kunpeng chip) + UOS; Taking the target scenario of the present application as an example, if a user wants to deploy and manage multiple domestic databases (such as OpenGauss, OceanBase, Dream and RDBMS) in the same environment, the prior art solution usually requires to build an independent management tool chain for each type of database, and to install, configure and monitor them respectively. This not only brings high operation and maintenance complexity and learning cost, but also makes it difficult to achieve resource planning, unified permissions and overall high availability architecture design due to the isolation of each database system management.

[0023] In addition, the official release of the native version of domestic databases such as OpenGauss and OceanBase usually prioritizes support for international mainstream operating systems (such as CentOS and Ubuntu) and general chip architectures, and the compatibility verification of domestic commercial operating systems such as Kylin and UOS is still insufficient, lacking pre-compiled release packages and dependency management mechanisms for mixed architecture combination environments. Therefore, when deploying in typical domestic combination environments such as X86 (Haiguang) + Kylin and ARM (Kunpeng) + UOS, problems such as missing dependent libraries, installation script recognition errors, performance tuning parameters and hardware instruction set mismatches often occur, resulting in a tedious deployment process, high failure rate or suboptimal runtime performance.

[0024] In summary, the present application aims to solve the core technical problems faced in the process of unified management and deployment of multiple types of domestic databases in a domestic environment. Specifically, the prior art lacks an integrated database management solution that can support multiple combinations of domestic operating systems such as Kylin (Kylin V10 SP2), UOS (UOS 20), OpenEuler (22.03 LTS), and X86 (Intel / Haiguang), ARM (Kunpeng) chip architectures. This results in users having to manually adapt, compile, and deploy each database system such as OpenGauss, OceanBase, Dream, and RDBMS in the face of complex heterogeneous Xinda environments, which is tedious, prone to errors, and inefficient. At the same time, the monitoring and management of each database system are fragmented, lacking a unified view, and the operation and maintenance complexity is high. In addition, existing solutions do not perform deep performance optimization for domestic software and hardware stacks, and cannot fully exploit their performance potential.

[0025] Therefore, the technical problem to be solved by the present application is how to provide a multi-database unified management and deployment method and system that can adaptively identify heterogeneous environments, implement one-key automatic deployment and configuration, provide unified visual operation and maintenance management, and achieve deep performance optimization for domestic environments, to completely overcome the defects of the prior art and provide a ready-to-use, efficient, stable, safe, and controllable domestic database integrated solution for users in a mixed Xinda environment.

[0026] A heterogeneous database unified deployment management method based on a cluster management platform provided by an embodiment of the present application will be described in detail below. The present application is based on the Apache Ambari 3.0 management platform, which extends its service definition framework, develops a unified database adaptation layer, implements an environment adaptive identification and intelligent deployment mechanism, and builds a complete system that supports the unified management and deployment of multiple domestic databases in a domestic environment.

[0027] As shown in Figure 1 The heterogeneous database unified deployment management method based on a cluster management platform provided by an embodiment of the present application can include the following steps: S110, predefine the metadata of multiple database services in the management platform, the metadata defining at least the component roles of each database service, the dependency relationship between components, the configuration parameter structure, and the deployment script path.

[0028] The management platform in this embodiment can be an extended Apache Ambari cluster management platform.

[0029] In the Ambari management platform, the metadata of multiple domestic database services is predefined by creating a service definition file. Taking the service definitions created for OpenGauss and Dream databases as an example: Define two component roles OPENGAUSS_MASTER and OPENGAUSS_STANDBY for the OpenGauss database, respectively specify the role category, deployment quantity constraint, and associate the corresponding Python deployment script path; Define the DAMENG_SERVER component role for the DAMENG database, specify the role category and deployment constraint, and associate the corresponding deployment script; at the same time, define the configuration parameter structure required by each database service, including database port, memory parameter, storage path, and other configurable items.

[0030] S120, pre-construct a multi-version program package warehouse, compile database components for different target chip architectures and different target operating systems respectively, generate corresponding installation packages, and establish a structured warehouse directory system according to the combination of chip architecture and operating system type.

[0031] Specifically, the database installation package is compiled in advance for different target environments to establish a structured internal warehouse. For x86_64 and aarch64 chip architectures, corresponding database installation packages are compiled and generated; for different operating systems such as Kirin, UOS, OpenEuler, CentOS, etc., the corresponding format installation package is generated; the installation package is organized according to the hierarchical directory structure of "chip architecture / operating system type", forming a structured warehouse system.

[0032] S130, issue an environment detection instruction to the target node to obtain the chip architecture and operating system type of the target node, and generate environment fingerprint information.

[0033] The environment detection instruction is issued to the target node through the Ambari Agent to execute the environment detection script on the target node, and the chip architecture information is obtained through the system command; the operating system type is identified by detecting the system feature file on the node; the chip architecture and operating system type are combined to generate environment fingerprint information, which is reported to the management platform.

[0034] S140, according to the environment fingerprint information, dynamically select the database installation package and its dependent item set matching the current environment from the pre-constructed multi-version program package warehouse by mapping the warehouse directory system.

[0035] According to the environment fingerprint information, the matching installation resource is intelligently selected. Specifically, the chip architecture and operating system type in the environment fingerprint are parsed; the directory structure of the program package warehouse is mapped to locate the corresponding installation package file; the dependent item set required in the environment is parsed according to the environment characteristics.

[0036] S150, through the unified database adaptation layer constructed based on metadata, call the standardized operation interface to perform the installation, configuration and start-stop operation of the database.

[0037] In this step, a unified database adaptation layer is built based on predefined metadata. Specifically, a unified standardized operation interface is implemented for each database type; the adapter calls specific deployment scripts to perform installation operations; and database configuration files are generated and applied according to the configuration parameter structure. Perform lifecycle management operations such as starting and stopping the database service.

[0038] S160 provides visual deployment and orchestration capabilities based on component roles by extending the web service interface of the management platform.

[0039] In this step, the Ambari web interface is extended to provide visual deployment capabilities. Specifically, the web interface displays a database service topology editor based on component roles; receives deployment orchestration operations performed by users through the graphical interface; calls the corresponding deployment scripts based on the orchestration results and environment fingerprint information; and automatically executes the complete database cluster deployment and configuration process, including software installation, configuration generation, and service initialization.

[0040] S170, based on the deployment orchestration results and environment fingerprint information, calls the deployment script to complete the automated deployment and configuration of the database cluster.

[0041] The deployment engine receives deployment orchestration results from S160 (which explicitly specifies which database components to deploy on which node) and environment fingerprint information from S130 (which precisely describes the hardware and software environment of the target node). The engine combines these two with predefined metadata from S110 (such as deployment script paths and configuration parameter structures) and the specific installation packages and dependencies selected from S140 to generate a complete deployment task context specific to the target environment.

[0042] Based on the synthesized task context, the engine locates and invokes predefined deployment scripts (such as openGaussMaster.py) for each database component in S110. These scripts are executed on the target node through standardized interfaces (such as the install() method) of the unified database adaptation layer built by S150. The execution process is an ordered, automated sequence: (1) Environment preparation: The script first automatically installs all necessary system dependency libraries on the target node based on the dependency set parsed by S140.

[0043] (2) Software installation: Subsequently, the script downloads the database installation package (e.g., the RPM package for aarch64+openeuler) that is exactly matched with the fingerprint information of the current environment from the multi-version package repository built by S120, and completes the installation.

[0044] (3) Configuration generation and application: The script dynamically generates the final database configuration file (such as postgresql.conf) according to the user's preset configuration parameter structure (derived from metadata) and specific deployment parameters, and deploys it to the specified location of the target node.

[0045] (4) Service initialization and startup: After the configuration is completed, the script executes the initialization command of the database (such as creating a data directory and initializing system tables), and finally starts the database service process, and usually sets it to start automatically at boot.

[0046] When the deployment involves multiple nodes (such as deploying a primary-backup cluster of OpenGauss), this step is also responsible for cluster-level coordination. For example, before starting the standby node, the deployment script will ensure that the primary node is ready and has configured replication permissions. During the entire deployment process, the execution status of each node is fed back to the management platform in real time, providing a clear deployment progress view. If any step fails, the system will automatically abort the process and report the error, ensuring controllability and traceability of the deployment state.

[0047] In summary, the S170 step is the key to realizing the "one-key deployment" user experience. It connects static metadata definition, structured program package warehouse, dynamic environment perception, and flexible visualized orchestration through an automated and reliable execution engine, and finally realizes the one-key deployment of database clusters in a complex heterogeneous environment with high efficiency and accuracy.

[0048] Compared with the prior art, the embodiment of the present application realizes unprecedented technical effects by constructing a complete technical chain of "metadata definition-environment perception-intelligent package selection-unified adaptation-visualized orchestration": it systematically solves the core problem of unified deployment and management of multiple databases in a localized heterogeneous environment, realizing the leap from manual deployment of several days to hour-level one-key deployment; through the precise mapping of environment fingerprint information and structured program package warehouse, the method completely eliminates the dependence on missing, configuration errors and compatibility failures caused by the complexity of chip architecture and operating system combinations, ensuring the high reliability and environment adaptability of the deployment process; at the same time, by using the unified database adaptation layer and visualized deployment orchestration function based on metadata, the operation and maintenance of each heterogeneous database is encapsulated as a standardized interface, which simplifies the operation, reduces the technical threshold, and provides a centralized and unified management view, fundamentally solving the pain points of fragmented operation and maintenance interface and low management efficiency in traditional solutions, thereby providing an efficient, stable and automated integrated solution for multi-database mixed deployment in the context of signal creation, significantly reducing the total cost of ownership.

[0049] In Figure 1 On the basis of the shown embodiment, as an implementation manner of the embodiment of the present application, the metadata of the predefined multiple database services is implemented through a service definition file, and the service definition file is in an extensible markup language format; The root element of the service definition file is <metainfo>elements; <metainfo>under the element <services>elements as their direct children; <services>one or more of the elements are defined <service>element, each <service>Element is used to describe an independent database service; wherein, <service>The elements at least include: a service name element for defining a unique identification of the service; a service display name element for defining a display name of the service; and a service component element for defining one or more component sub-elements to describe constituent components of the service.

[0050] In an alternative implementation, the component sub-elements at least include: a component name element for defining a unique identification of the component; a component category element for defining a role category of the component, the component category element defining a component role category including a master node role and a slave node role; a component quantity constraint element for defining a deployment quantity constraint of the component, wherein the component quantity constraint element value of the master node role is 1, and the component quantity constraint element value of the slave node role is 1 or more; a component command script element for associating a deployment script, wherein the component command script element includes a script path sub-element, a script type sub-element, and a timeout time sub-element; and the timeout time sub-element for defining a timeout time of the deployment script execution.

[0051] Specifically, the service definition file is created in an extensible markup language format, and a root element of the file is <metainfo> <services>The element as its direct child. <services>one or more of the elements are defined <service>element, each <service>Element is used to describe an independent database service.

[0052] Take OpenGauss database as an example, its <service>The specific configuration of the elements includes: service name element <name>is set to "OPENGAUSS" as the unique identification of this service; the service display name element <displayname>Set to "OpenGauss Database" for display in the management interface; service component element <components>The plurality of component sub-elements are used to describe the constituent components of the OpenGauss service.

[0053] In <components>Among the elements, two core component sub-elements are defined.

[0054] The first component targets the master node role. The component name element <name>OPENGAUSS_MASTER is set as the unique identification of the master node component. The component category element <category>is set to "MASTER" to define the role category of the component as a master role. The component quantity constraint element <cardinality>Set to "1" for strict deployment constraint requirement of the master node role. Component command script element <commandscript>An association deployment script, which contains: a script path sub-element <script>设置为"scripts / openGaussMaster.py"。脚本类型子元素<scriptType>设置为"PYTHON"。超时时间子元素<timeout>设置为"1200",定义该部署脚本执行的超时时间为1200秒。

[0055] 第二个组件针对从节点角色。组件名称元素<name>设置为"OPENGAUSS_STANDBY",作为从节点组件的唯一标识。组件类别元素<category>设置为"SLAVE",定义该组件的角色类别为从节点角色。组件数量约束元素<cardinality>设置为"1+",符合从节点角色需要部署一个及以上实例的要求。组件命令脚本元素<commandScript>关联部署脚本,其中包含:脚本路径子元素<script>设置为"scripts / openGaussStandby.py"。脚本类型子元素<scriptType>设置为"PYTHON"。超时时间子元素<timeout>设置为"1200",确保从节点部署有足够的执行时间。

[0056] 通过这种结构化的服务定义文件配置,管理平台能够精确理解OpenGauss数据库的服务拓扑结构,包括其主从组件的关系、部署数量约束以及对应的自动化脚本。当用户在管理界面选择部署OpenGauss服务时,系统会根据这些元数据自动校验部署规划的合理性,确保主节点有且仅有一个实例,从节点可以弹性扩展,并为每个组件的部署分配合适的执行资源和超时控制,从而实现数据库服务部署的标准化和自动化管理。

[0057] 这种基于XML的元数据定义方式不仅适用于OpenGauss数据库,同样可以扩展到达梦、OceanBase等其他国产数据库,为异构数据库的统一管理提供了灵活且规范的配置基础。

[0058] 在图2所示实施例的基础上,作为本发明实施例的一种实现方式,按照芯片架构和操作系统类型的组合建立结构化的仓库目录体系,可以包括如下步骤:步骤a1,顶层目录按芯片架构划分,包括x86_64目录和aarch64目录。

[0059] 首先建立按芯片架构划分的顶层目录结构。具体的,创建x86_64目录,专门存放适用于Intel和海光等x86架构芯片的数据库安装包。创建aarch64目录,专门存放适用于鲲鹏等ARM架构芯片的数据库安装包。

[0060] 这种顶层划分确保了不同芯片架构的安装包完全隔离,避免了架构不匹配导致的安装失败。

[0061] 步骤a2,每个芯片架构目录下按操作系统类型建立子目录。

[0062] 在每个芯片架构目录下,进一步按照操作系统类型建立子目录。在x86_64目录下建立如下子目录:kylin子目录,存放适用于麒麟操作系统的安装包。uos子目录,存放适用于统信UOS操作系统的安装包。openeuler子目录,存放适用于OpenEuler操作系统的安装包。centos子目录,存放适用于CentOS操作系统的安装包。

[0063] 在aarch64目录下建立如下子目录:kylin子目录,存放适用于ARM架构+麒麟操作系统的安装包。openeuler子目录,存放适用于ARM架构+OpenEuler操作系统的安装包。

[0064] 步骤a3,各操作系统子目录中存储针对该芯片架构和操作系统组合编译的数据库安装包。

[0065] 其中,数据库安装包的命名包含其对应的数据库类型、版本号、目标操作系统及目标芯片架构信息,使得安装包文件与其存储路径所指示的环境信息相互印证。

[0066] 具体的,在各操作系统子目录中,存储针对该特定芯片架构和操作系统组合编译的数据库安装包。安装包的命名采用标准化规则,包含完整的环境信息。

[0067] 以OpenGauss数据库为例,在aarch64 / kylin目录中,存储名为openGauss-5.0.0-1.kylin.aarch64.rpm的安装包,其中,openGauss标识数据库类型;5.0.0标识版本号;kylin标识目标操作系统;aarch64标识目标芯片架构。

[0068] 在x86_64 / uos目录中,存储名为dameng-8.0.0-1.uos.x86_64.deb的安装包,其中,dameng标识数据库类型;8.0.0标识版本号;uos标识目标操作系统;x86_64标识目标芯片架构。

[0069] 通过这种结构化的仓库目录体系,实现了安装包文件与其存储路径所指示的环境信息的完全对应。当系统进行环境检测并生成环境指纹信息后,能够通过简单的路径映射即可精准定位到匹配的安装包。例如,检测到环境为aarch64架构+kylin操作系统时,系统自动构建路径aarch64 / kylin / 并匹配该目录下相应的安装包文件。

[0070] 这种设计不仅提高了部署的准确性和可靠性,还极大地简化了包管理逻辑。任何新增的数据库类型或新的环境组合,只需按照相同的目录结构和命名规则添加到仓库中,即可自动融入现有的部署体系,实现了良好的可扩展性和维护性。

[0071] 在图1所示实施例的基础上,作为本发明实施例的一种实现方式,所述向目标节点下发环境检测指令,可以包括如下步骤:步骤b1,通过Ambari Agent在目标节点执行Python环境检测脚本。

[0072] 通过Ambari Agent在目标节点执行Python环境检测脚本。该脚本作为环境信息采集的核心工具,负责全面收集节点的硬件和软件配置信息。

[0073] 步骤b2,上述脚本通过os.uname().machine命令获取芯片架构。

[0074] 脚本通过os.uname().machine系统命令获取芯片架构信息。此步骤确保系统能够准确识别x86_64和aarch64两种主流架构,并对不支持的架构及时抛出异常。

[0075] 步骤b3,通过检测特定系统文件的存在性来识别操作系统类型,其中,检测 / etc / kylin-release文件识别麒麟系统,检测 / etc / uos-release文件识别统信系统,检测 / etc / openEuler-release文件识别OpenEuler系统,检测 / etc / centos-release文件识别CentOS系统。

[0076] 步骤b4,通过读取所述特定系统文件的内容,并检查其内容中是否包含预定义的版本标识字符串,以确定操作系统的具体版本号。

[0077] 其中,检查 / etc / kylin-release 文件内容是否包含V10以确定麒麟V10版本,检查 / etc / uos-release文件内容是否包含20以确定统信20版本,检查 / etc / openEuler-release文件内容是否包含22.03以确定OpenEuler 22.03版本,检查 / etc / centos-release文件内容是否包含7以确定CentOS 7版本。

[0078] 在一种可选的实现方式中,执行环境检测指令的过程包括差错处理机制,差错处理机制具体包括:在调用环境检测函数后,捕获执行过程中产生的异常。

[0079] 当环境检测成功时,记录包含所生成的芯片架构、操作系统类型及版本信息的成功日志。

[0080] 当环境检测失败时,记录描述失败原因的错误日志,并重新抛出异常以终止后续部署流程。

[0081] 通过本实施例的技术方案,至少能够达到如下技术效果:1、精准识别环境配置。准确检测节点的芯片架构、操作系统类型和版本信息,为后续的智能选包提供可靠依据。2、全面覆盖国产环境。支持麒麟、统信、OpenEuler等主流国产操作系统的识别,满足信创环境需求。3、提供完善的容错能力。通过差错处理机制确保在环境检测异常时能够及时终止部署流程,避免因环境不匹配导致的部署失败。4、保障部署过程可靠性。详细的日志记录为运维人员提供完整的故障排查依据,提高了系统的可维护性。这种环境检测方法确保了数据库部署过程的环境自适应能力,为异构环境下的统一部署管理提供了技术基础。

[0082] 在图1所示实施例的基础上,作为本发明实施例的一种实现方式,动态选择依赖项集合通过依赖关系解析器实现,依赖关系解析器包括:预定义的依赖映射表,用于以数据库类型、芯片架构和操作系统类型为联合键,存储对应的依赖包列表。依赖解析方法,用于根据输入的数据库类型、芯片架构和操作系统类型,从依赖映射表中查询并返回对应的依赖包列表。架构特异性依赖处理方法,用于当芯片架构为aarch64时,在基础依赖列表上自动追加ARM架构特异性依赖包。

[0083] 具体的,依赖关系解析器的核心组件与工作机制如下:1、预定义依赖映射表的结构化设计。

[0084] 依赖关系解析器内置了经过精心组织的预定义依赖映射表。该映射表采用三维层次结构进行组织,第一维度为数据库类型,涵盖OpenGauss、OceanBase、达梦、人大金仓等主流国产数据库;第二维度为芯片架构,包括x86_64和aarch64两种主流架构;第三维度为操作系统类型,覆盖麒麟、统信UOS、OpenEuler、CentOS等操作系统。

[0085] 每个具体的环境组合都在映射表中对应一个精确的依赖包列表。例如,对于OpenGauss数据库在x86_64架构统信UOS环境下的部署,映射表记录了包括libaio-dev、flex、bison、libncurses5-dev等必需的基础依赖包。这种精细化的映射关系确保了依赖项与环境特征的完全匹配。

[0086] 2、依赖解析方法的智能查询流程。

[0087] 依赖解析方法作为解析器的核心处理逻辑,接收来自环境检测阶段生成的数据库类型、芯片架构和操作系统类型作为输入参数。方法内部通过三层索引机制,首先根据数据库类型定位到对应的架构分支,然后根据芯片架构定位到操作系统分支,最后根据操作系统类型检索出精确的依赖包列表。

[0088] 在整个查询过程中,解析方法包含了完善的异常处理机制。当遇到未预定义的环境组合时,方法会立即抛出明确的异常信息,指出具体不支持的组合类型,为系统运维人员提供清晰的故障定位依据。

[0089] 3、架构特异性依赖的智能增强。

[0090] 针对ARM架构的特殊性,解析器集成了架构特异性依赖处理方法。当检测到目标环境芯片架构为aarch64时,该方法会在基础依赖列表的基础上,自动追加ARM架构必需的特异性依赖包。这些特异性依赖包包括libatomic、libgcc_s.so.1等确保ARM环境下软件稳定运行的关键组件。

[0091] 这种架构感知的依赖增强机制有效解决了不同指令集架构下的兼容性问题,确保数据库软件在国产ARM芯片环境中能够发挥性能优势并保持稳定运行。

[0092] 在一个典型部署场景中,当系统检测到目标环境需要部署OpenGauss数据库,且环境为aarch64架构搭配麒麟操作系统时,依赖关系解析器会启动完整的解析流程。首先通过依赖解析方法查询到基础依赖列表,然后通过架构特异性依赖处理方法追加ARM专用依赖包,最终生成完整的依赖项集合,为后续的自动化部署提供准确可靠的依赖安装依据。

[0093] 通过本实施例,系统建立了智能化的依赖管理体系,能够根据具体环境特征精准匹配依赖项,有效避免了因依赖缺失或版本不匹配导致的部署失败。同时,架构感知的依赖增强机制显著提升了国产ARM环境下数据库部署的成功率和运行稳定性,为异构环境统一管理提供了坚实的底层支撑。

[0094] 在上述实施例的基础上,作为本发明实施例的一种实现方式,统一数据库适配层通过抽象基类定义标准化操作接口,抽象基类包括以下抽象方法:install()方法,用于执行数据库安装。configure()方法,用于生成和应用数据库配置。start()方法和stop()方法,用于启动和停止数据库服务。get_status()方法,用于获取数据库运行状态。backup()方法和restore()方法,用于数据库备份和恢复。

[0095] 其中,针对OpenGauss数据库的具体适配器实现包括:环境检查模块,用于验证系统资源和依赖项。模板渲染模块,使用模板引擎,根据配置参数动态生成数据库配置文件。脚本执行模块,调用Shell脚本执行安装操作,并验证安装结果。

[0096] 具体的,统一数据库适配层通过面向对象的设计理念,构建了一套标准化的数据库管理框架,为不同类型的国产数据库提供统一的操作接口和实现规范。

[0097] 统一数据库适配层的架构设计包括:1、抽象基类的标准化接口定义。统一数据库适配层通过抽象基类定义了六大核心操作方法,形成了一套完整的数据库生命周期管理接口规范:安装管理接口提供数据库软件的完整安装流程,包括环境检查、依赖验证、软件包安装和安装验证等标准化步骤。配置管理接口负责根据用户输入的参数动态生成数据库配置文件,并确保配置的正确应用和生效。服务控制接口封装了数据库服务的启动和停止操作,确保服务状态转换的可靠性和一致性。状态监控接口实时获取数据库运行状态信息,为运维监控提供数据支持。数据保护接口提供数据库备份和恢复的标准方法,确保数据安全性和可恢复性。

[0098] 2、OpenGauss数据库适配器的具体实现。针对OpenGauss数据库的特性,实现了具体适配器,包含三个核心功能模块:环境检查模块在安装前执行全面的系统验证,包括磁盘空间检测、内存资源评估、依赖包完整性检查以及系统参数优化建议。该模块确保目标环境满足OpenGauss数据库的运行要求,提前发现并解决潜在的环境问题。

[0099] 模板渲染模块基于先进的模板引擎技术,根据用户配置参数动态生成数据库配置文件。该模块支持参数校验、模板变量替换和配置格式优化,能够根据不同的部署场景(如单机、主备、集群等)生成最优的配置方案。

[0100] 脚本执行模块负责调用Shell脚本执行具体的安装操作,包括软件包解压、目录创建、权限设置、服务注册等步骤。安装完成后,该模块会执行一系列的验证检查,包括进程状态确认、端口监听检测、基础功能测试等,确保安装结果的正确性和可靠性。

[0101] 在一个典型的OpenGauss数据库部署场景中,适配器按照标准化流程执行操作:首先通过环境检查模块验证目标节点是否满足安装要求,然后使用模板渲染模块生成适配当前硬件环境的配置文件,最后通过脚本执行模块完成数据库的安装、初始化和服务启动。整个过程严格遵循抽象基类定义的接口规范,确保操作的一致性和可预测性。

[0102] 通过本实施例的技术方案,系统建立了标准化的数据库管理框架,有效解决了不同数据库之间操作接口异构的问题。这种设计使得新增数据库类型的支持变得更加简单快捷,只需要实现相应的具体适配器即可融入现有的管理体系。同时,统一的操作接口极大简化了上层管理逻辑,提高了系统的可维护性和扩展性,为多数据库统一管理提供了坚实的技术基础。

[0103] 在图1所示实施例的基础上,作为本发明实施例的一种实现方式,可视化部署编排功能通过前端JavaScript组件实现,包括:数据库服务组件定义表,定义各数据库组件的图标、显示名称和资源约束;拓扑编排引擎,提供图形化拖拽界面,并在组件放置时执行资源合规性校验,包括架构兼容性校验、操作系统兼容性校验和资源充足性校验。

[0104] 该可视化部署编排功能通过先进的前端技术架构实现,为用户提供直观、智能的数据库服务编排体验,显著降低了在复杂异构环境中进行数据库部署的技术门槛。

[0105] 可视化部署编排系统的组件构成包括:1、数据库服务组件定义表的实现。

[0106] 系统内置了完整的数据库服务组件定义表,该定义表采用结构化数据模型,为每种数据库组件提供全面的元数据定义:组件图标信息采用直观的图形化标识,根据数据库类型和组件角色差异设计不同的视觉元素。如OpenGauss主节点使用金色数据库图标,从节点使用银色图标;OceanBase组件使用蓝色系图标,形成完整的视觉识别体系。

[0107] 显示名称定义遵循中文化、易理解的原则,如"OpenGauss主数据库"、"OpenGauss备数据库"、"OceanBase集群节点"等,确保用户能够快速识别组件功能。

[0108] 资源约束配置包含多维度的要求定义:内存需求明确标注最小内存要求(如16GB)、CPU核心数要求(如8核心)、存储空间需求(如500GB SSD)。架构兼容性约束明确指定组件支持的芯片架构类型,如OpenGauss主节点同时支持x86_64和aarch64架构,某些特定组件可能仅支持单一架构。操作系统兼容性约束列出经过验证的操作系统类型,如麒麟V10、统信UOS 20、OpenEuler 22.03等。

[0109] 2、拓扑编排引擎的智能校验机制。

[0110] 拓扑编排引擎提供基于HTML5技术的图形化拖拽界面,用户可以通过简单的鼠标操作完成复杂的数据库集群拓扑设计。在组件放置过程中,引擎实时执行三重校验机制:架构兼容性校验在用户将组件拖拽到目标节点时立即触发,引擎比对组件支持的架构类型与节点实际架构。如检测到将仅支持x86_64的数据库组件放置到aarch64架构节点时,立即弹出警告提示并阻止非法放置。

[0111] 操作系统兼容性校验验证组件与目标节点操作系统的匹配度。引擎维护完整的操作系统兼容矩阵,当用户尝试在不兼容的操作系统上部署数据库组件时,系统会明确提示不兼容的具体原因,并推荐替代方案。

[0112] 资源充足性校验通过实时查询节点资源状态,确保目标节点满足组件的资源需求。校验内容包括可用内存是否满足最低要求、CPU核心数是否充足、存储空间是否达标。当资源不足时,系统提供详细的资源缺口分析,指导用户进行扩容或重新规划。

[0113] 在一个金融级数据库集群部署场景中,用户通过拖拽界面设计OpenGauss一主两备集群架构。当用户将主节点组件拖至鲲鹏架构的OpenEuler节点时,系统立即通过架构兼容性校验;在配置备节点时,用户误选至资源不足的节点,资源充足性校验及时告警并显示"内存不足:可用8GB,需要16GB"的详细提示。用户根据系统建议调整部署方案后,拓扑编排引擎显示所有校验通过,生成最优部署拓扑。

[0114] 通过本实施例的技术方案,系统建立了智能化的可视化编排体系,将复杂的异构环境数据库部署转化为直观的图形化操作。三重校验机制有效防止了配置错误和环境不匹配问题,大幅提高了部署成功率。同时,标准化的组件定义和智能化的编排引擎显著降低了运维人员的技术门槛,为大规模异构环境数据库统一管理提供了高效、可靠的前端支撑。

[0115] 在图1所示实施例的基础上,作为本发明实施例的一种实现方式,调用部署脚本,完成自动化部署与配置,具体包括:动态生成Ansible部署剧本,Ansible部署剧本包括以下任务:安装架构特异性依赖包;从程序包仓库下载匹配的数据库安装包;安装数据库软件包;使用模板生成数据库配置文件;执行数据库初始化命令;启动数据库服务并设置为开机自启。

[0116] 在该实施例中,通过动态生成和执行Ansible部署剧本,实现了在异构国产化环境中数据库集群的全自动化部署与配置,确保了部署过程的高度可靠性和一致性。

[0117] Ansible部署剧本的动态生成与执行过程包括:1、部署剧本的动态合成机制。

[0118] 系统根据环境检测阶段生成的环境指纹信息、依赖关系解析结果以及用户通过可视化界面定义的部署拓扑,动态合成具有高度针对性的Ansible部署剧本。该合成过程基于预定义的Jinja2剧本模板,通过变量替换和逻辑控制,生成与目标环境完全匹配的可执行剧本。

[0119] 2、部署任务的有序执行流程。

[0120] 生成的Ansible部署剧本包含六个核心任务,按照严格的顺序执行以确保部署成功率:安装架构特异性依赖包任务首先执行,根据依赖关系解析器输出的依赖包列表,调用目标节点的包管理工具(如yum、apt等)自动安装所有必需的依赖组件。该任务特别针对不同芯片架构进行优化处理,确保ARM架构环境下的特殊依赖得到满足。

[0121] 从程序包仓库下载匹配的数据库安装包任务通过精确的环境匹配,从预构建的多版本程序包仓库中下载与当前环境完全匹配的数据库安装包。下载过程基于环境指纹信息构建准确的下载路径,确保获取正确的安装包版本。

[0122] 安装数据库软件包任务调用系统包管理器执行安装操作,支持RPM、DEB等多种包格式。安装过程中自动处理包之间的依赖关系,并记录详细的安装日志用于后续排查。

[0123] 使用模板生成数据库配置文件任务基于数据库适配层提供的配置模板,结合用户的具体配置参数,动态生成最优化的数据库配置文件。该任务确保配置文件与当前硬件环境、性能要求和业务场景完美匹配。

[0124] 执行数据库初始化命令任务运行数据库特定的初始化脚本,创建必要的数据库实例、系统表结构和初始用户账户。初始化过程严格遵循各数据库的最佳实践,确保数据库实例处于就绪状态。

[0125] 启动数据库服务并设置为开机自启任务最终启动数据库服务进程,并通过系统服务管理器(如systemd)将服务设置为开机自动启动,确保持续可用性。

[0126] 3、错误处理与回滚机制。

[0127] 部署剧本内置完善的错误处理机制,每个任务都包含状态检测和异常处理逻辑。当某个任务执行失败时,系统自动触发回滚流程,清理已安装的组件并恢复系统到部署前状态。同时,详细的执行日志实时反馈到管理界面,为运维人员提供完整的部署过程可视性。

[0128] 在一个典型的OpenGauss数据库集群部署场景中,系统首先根据环境检测结果(aarch64架构、OpenEuler操作系统)生成针对性的Ansible剧本。剧本依次执行:安装libaio-devel等ARM架构依赖包,下载openGauss-5.0.0-1.openeuler.aarch64.rpm安装包,通过yum完成软件安装,生成适配当前硬件的数据缓存配置,执行gs_initdb进行数据库初始化,最后启动openGauss服务并设置为开机自启。整个过程完全自动化,无需人工干预。

[0129] 通过本实施例的技术方案,系统建立了工业级的自动化部署流水线,将原本需要数小时甚至数天的手动部署过程缩短至分钟级别。标准化的部署流程彻底消除了人为操作失误的风险,确保了不同环境中部署结果的一致性。同时,基于环境感知的动态剧本生成机制,使得单一套部署方案能够自适应多种异构环境,极大提高了部署效率和系统可靠性,为大规模国产化数据库集群的快速交付提供了关键技术支撑。

[0130] 并且,在上述实施例的基础上,作为本发明实施例的一种实现方式,还可以包括:监控与运维集成。具体的,统一监控指标采集。实现监控数据采集器,将各数据库性能指标统一接入Ambari Metrics系统。

[0131] 在该实现方式中,监控与运维集成通过统一监控指标采集器实现,该采集器采用模块化架构设计,能够将多种异构数据库的性能指标统一接入Ambari Metrics系统,实现对不同国产数据库的一体化监控管理。

[0132] 其中,统一监控指标采集器的架构设计,包括:1、采集器的统一接口与多数据库适配。

[0133] 监控数据采集器采用工厂模式设计,通过统一的DatabaseMetricsCollector类为所有支持的数据库类型提供标准化的监控接口。采集器初始化时接收两个关键参数:数据库类型标识和监控配置信息。数据库类型标识用于路由到对应的专用采集模块,监控配置信息则包含数据库连接字符串、认证凭证等必要参数。

[0134] 采集器的核心方法是collect_metrics(),该方法作为统一的指标收集入口,内部根据数据库类型自动分发到相应的专用采集方法。这种设计使得新增数据库类型的监控支持变得简单明了,只需要实现对应的专用采集方法即可融入现有监控体系。

[0135] 2、OpenGauss数据库的深度监控实现。

[0136] 针对OpenGauss数据库,系统实现了深度的监控指标采集能力。_collect_openGauss_metrics()方法通过psycopg2连接库建立与OpenGauss数据库的连接,执行专业的SQL查询语句从pg_stat_database系统视图中提取关键性能指标。

[0137] 采集的指标包括:当前数据库连接数,反映数据库的并发负载情况;事务提交总数,体现数据库的写操作吞吐量;事务回滚总数,揭示系统异常或业务逻辑问题。这些指标通过精心设计的指标命名规范(如opengauss.connections)进行统一标识,确保在监控系统中的唯一性和可识别性。

[0138] 3、多数据库扩展与异常处理机制。

[0139] 系统采用可扩展的架构设计,支持多种国产数据库的监控集成。对于OceanBase数据库,系统提供_collect_oceanbase_metrics()专用采集方法;对于达梦、人大金仓等其他国产数据库,同样可以通过实现对应的采集方法快速接入监控体系。

[0140] 采集器内置完善的异常处理机制,当某个数据库的指标采集过程中出现连接失败、查询超时等异常情况时,系统会捕获异常并记录详细的错误日志,同时保证其他数据库的监控采集不受影响。这种隔离设计确保了监控系统的整体稳定性。

[0141] 4、指标数据的统一集成与存储。

[0142] 采集到的各类数据库性能指标通过统一的MetricsRegistry进行注册和管理,随后被集成到Ambari Metrics系统中。指标数据按照统一的时间序列格式进行存储,支持灵活的查询聚合和数据可视化。这种统一存储方案打破了各数据库监控数据孤岛的局面,为跨数据库的性能分析和容量规划提供了数据基础。

[0143] 在一个包含OpenGauss和OceanBase混合部署的生产环境中,统一监控指标采集器定时(如每30秒)执行监控数据采集任务。对于OpenGauss数据库,采集器连接至数据库实例,查询pg_stat_database等系统视图获取实时性能数据;对于OceanBase数据库,采集器调用相应的监控接口获取集群运行状态。所有采集到的指标数据统一上报至AmbariMetrics系统,运维人员可以在Grafana等可视化工具中查看跨数据库的整体运行态势,及时发现性能瓶颈和异常情况。

[0144] 通过本实施例的技术方案,系统建立了标准化的数据库监控体系,有效解决了异构数据库监控数据碎片化的问题。统一的监控接口和指标规范极大简化了运维复杂度,提高了故障发现和诊断的效率。同时,可扩展的架构设计为后续支持更多国产数据库类型提供了便捷的接入路径,为大规模异构数据库环境的统一运维管理提供了可靠的技术保障。

[0145] 在上述实施例的基础上,在本发明的一个具体实现中,针对国产芯片和操作系统的特点,设计了深度的性能优化模板和安全加固方案,确保数据库系统在信创环境中能够充分发挥硬件性能优势,同时满足严格的安全合规要求。

[0146] 对于国产化深度优化配置体系,可以包括:1、性能参数调优模板的智能适配。

[0147] 系统内置了针对不同国产芯片和操作系统的性能优化配置模板,采用XML格式进行结构化存储和管理。这些模板基于大量实际测试和性能调优经验,针对国产环境的特殊性进行了专门优化。

[0148] 内存管理优化模块通过memory_page_size参数将内存页大小设置为8192字节,这一优化特别适合国产操作系统的大页内存管理特性,能够有效减少TLB缺失,提升内存访问效率。查询执行优化模块设置query_parallel_degree参数为8,充分利用多核国产芯片的并行计算能力,显著提升复杂查询的处理速度。

[0149] 针对ARM架构的优化模块通过enable_arm_neon参数启用NEON指令集加速,充分利用ARM处理器的SIMD(单指令多数据)能力,优化向量化计算和批量数据处理性能。对于海光芯片,专门的扩展优化模块通过enable_haiguang_extension参数启用芯片特定功能,包括加密指令加速和缓存优化等特性。

[0150] 2、自适应调优机制。系统能够根据检测到的具体硬件环境自动选择和应用相应的优化模板。当部署环境为ARM架构时,自动启用NEON指令集优化;当检测到海光芯片时,自动加载对应的芯片扩展功能。这种自适应机制确保各种国产硬件组合都能获得最优的性能配置。

[0151] 对于安全加固配置体系,可以包括:1、全面的安全基线配置。系统提供符合国产化安全规范的安全加固脚本,从多个维度构建数据库安全防护体系。密码安全加固模块实施强密码策略,包括最小密码长度16位、要求大小写字母、数字和特殊字符组合、密码有效期90天、密码重复使用限制等。访问控制加固模块限制数据库监听地址为内网IP,关闭不必要的网络端口,实施最小权限原则,严格限制超级用户权限。审计日志加固模块启用详细的操作审计功能,记录所有敏感操作,设置日志文件保护和自动归档机制。2、持续安全维护机制。

[0152] 系统内置漏洞防护模块,自动识别和修复已知安全漏洞,禁用不安全的协议和功能。提供定期的安全更新机制,确保数据库系统能够及时获得安全补丁。数据保护模块启用透明数据加密功能,对敏感数据进行加密存储,防止数据泄露。

[0153] 举例而言,在某政务云平台的信创环境部署中,系统检测到目标环境为鲲鹏ARM处理器搭配麒麟操作系统。在部署OpenGauss数据库时,自动应用性能优化模板:启用8192字节内存页大小优化,设置查询并行度为8,激活ARM NEON指令集加速。同时执行安全加固脚本,实施强密码策略、网络访问控制和安全审计配置。经过优化后,数据库系统在TPC-C测试中性能提升35%,同时满足等保2.0三级安全要求。

[0154] 通过本实现方式,系统建立了完整的国产化深度优化与安全保障体系。性能优化模板使数据库在国产硬件上的性能表现提升30%以上,达到甚至超过国际同类产品水平。安全加固配置确保系统符合国家信息安全等级保护要求,有效防范各类安全威胁。这种软硬件协同优化的设计理念,为信创环境下数据库系统的高性能、高安全运行提供了可靠的技术保障,有力推动了国产化生态的成熟和完善。

[0155] 为了方案描述清楚,下面将结合本发明的系统整体架构图,详细阐述在信创环境下实现多数据库统一管理的完整工作流程,如图2所示。

[0156] 本系统采用分层架构设计,构建了一个完整的异构数据库统一管理平台。各层次之间通过标准化的接口进行通信,实现了从环境感知、智能决策到执行监控的全流程自动化管理。

[0157] 对于环境感知层。操作系统识别模块用于:通过解析目标节点的系统特征文件进行操作系统识别。检测 / etc / kylin-release文件识别麒麟操作系统;检测 / etc / uos-release文件识别统信UOS操作系统;检测 / etc / openEuler-release文件识别OpenEuler操作系统;检测 / etc / centos-release文件识别CentOS操作系统。从而提供了精确的操作系统版本信息,为后续的依赖包选择和性能优化提供依据。

[0158] 芯片架构识别模块,用于通过系统命令os.uname().machine获取芯片架构信息;支持x86_64架构(Intel / 海光芯片)识别;支持aarch64架构(鲲鹏芯片)识别,确保数据库安装包与硬件架构的完全匹配。

[0159] 核心服务器Ambari扩展用于:基于Apache Ambari 3.0管理平台进行深度功能扩展;保留原有Hadoop生态组件管理能力的同时,增加国产数据库管理功能;并提供集群管理的基础服务,包括节点管理、服务调度等核心功能。

[0160] 部署与配置引擎是本系统的智能控制中枢,承担着将可视化编排拓扑转化为实际运行数据库集群的核心职责。该引擎基于环境感知层提供的芯片架构与操作系统指纹,智能决策最优部署策略,通过统一适配层向目标节点精准下发安装、配置与启停指令,并动态加载针对国产软硬件栈深度优化的性能参数与安全基线,从而在异构环境中实现数据库服务从资源调度、依赖解析、软件安装到服务初始化的全流程自动化,最终达成"一键部署、自适应优化、统一监控”的智能运维目标。

[0161] 生命周期管理模块,用于负责数据库服务的全生命周期管理;实现数据库的自动化安装、配置、启动、停止、升级和卸载;并提供基于策略的服务伸缩和故障恢复能力。

[0162] 服务定义与管理模块用于:管理各数据库服务的元数据定义;维护服务组件间的依赖关系和部署约束;提供服务拓扑的验证和优化功能。

[0163] 配置模块库用于:存储各数据库服务的标准配置模板;提供基于环境的配置参数自适应调整;包含连接池配置、内存参数、存储设置等优化参数。

[0164] 优化规划库用于:存储针对国产芯片和操作系统的深度优化配置;包含ARM架构的NEON指令集优化参数;提供海光芯片的特定扩展功能配置;包含各数据库在不同场景下的性能调优模板。

[0165] 对于用户交互层,Web可视化控制台提供基于B / S架构的图形化管理界面;支持跨平台访问,兼容主流浏览器;实现用户与系统的可视化交互接口。

[0166] 拓扑编辑器提供图形化的数据库集群拓扑设计界面;支持拖拽式的服务组件编排;实时验证拓扑结构的合理性和可行性。

[0167] 监控Dashboard提供统一的数据库集群监控视图;实时展示各数据库服务的运行状态;支持性能指标的时序数据可视化。

[0168] 对于统一适应层。标准化接口用于提供统一的数据库管理操作接口;定义标准的安装、配置、启停、监控接口规范;确保不同数据库类型的管理操作一致性管理指令用于:封装具体的数据库管理操作命令;将标准化接口转换为具体数据库的执行指令;提供指令执行的状态反馈和错误处理。

[0169] 对于监控告警层,包括如下几个方面:1、数据库监控器集群。

[0170] 人大金仓监控器:专用于人大金仓数据库的指标采集。达梦监控器:实现达梦数据库的性能监控。OceanBase监控器:负责OceanBase数据库的状态监测。各监控器通过标准化接口采集数据库运行指标。

[0171] 2、指标数据处理。

[0172] 推送指标:各监控器主动推送采集到的性能指标。数据源:提供指标数据的统一接入接口。Prometheus:作为时序数据库存储所有监控指标。支持指标的长期存储和快速查询。

[0173] 3、告警与展示。

[0174] 告警管理器:实现基于规则的智能告警。Grafana:提供专业的指标数据可视化。支持自定义告警阈值和通知策略。

[0175] 对于数据传输与状态管理。Web控制台向能量与配置引擎发送用户操作指令;支持部署、配置、监控等各类管理指令;确保指令传输的可靠性和安全性。

[0176] 各组件向部署与配置引擎反馈执行状态;提供实时的任务执行进度信息;支持异常状态的及时上报和处理。

[0177] 系统工作流程如下:1、部署阶段。

[0178] 用户在拓扑编辑器中设计数据库集群架构;环境感知层采集目标节点环境信息;部署与配置引擎生成最优部署方案;统一适应层执行具体的部署操作。

[0179] 2、运行阶段。

[0180] 各数据库监控器实时采集运行指标;指标数据存储至Prometheus时序数据库;Grafana进行数据可视化展示;告警管理器监控异常状态并触发告警。

[0181] 3、维护阶段。

[0182] 通过Web控制台进行日常运维操作;部署与配置引擎执行服务生命周期管理;系统提供完整的操作审计日志。

[0183] 图3所示实施例展示了一个完整的自动化部署流程。系统首先进行环境兼容性验证,若失败则提示"环境不兼容"并终止流程;验证通过后,依次执行依赖解析与安装、数据库安装与配置等关键步骤,最终应用针对特定硬件环境(如IBM Power、ARM等架构)的深度优化与安全策略,形成端到端的智能化部署闭环。< / script> < / commandscript> < / cardinality> < / category> < / name> < / components> < / components> < / displayname> < / name> < / service> < / service> < / service> < / services> < / services> ​< / metainfo> < / service> < / service> < / service> < / services> < / services> < / metainfo> < / metainfo> < / service> < / service> < / service> < / services> < / services> < / metainfo> < / metainfo>

Claims

1. A method for unified deployment management of heterogeneous databases based on a cluster management platform, characterized in that, Comprise: Predefine the metadata of multiple database services in the management platform, which at least defines the component roles, dependency relationships between components, configuration parameter structures, and deployment script paths of each database service; Pre-construct a multi-version package repository by compiling database components for different target chip architectures and different target operating systems to generate corresponding installation packages, and establish a structured repository directory system according to the combination of chip architectures and operating system types; Issue environment detection instructions to the target node to obtain the chip architecture and operating system type of the target node and generate environment fingerprint information; According to the environment fingerprint information, dynamically select the database installation package and its dependent item set that match the current environment from the pre-constructed multi-version package repository by mapping the repository directory system; Call the standardized operation interface through the unified database adaptation layer constructed based on the metadata to perform installation, configuration, and start-stop operations of the database; Provide visual deployment orchestration functions based on the component roles by extending the Web service interface of the management platform; According to the deployment orchestration results and the environment fingerprint information, call the deployment script to complete the automated deployment and configuration of the database cluster.

2. The method of claim 1, wherein, The metadata of the pre-defined multiple database services is implemented through a service definition file, and the service definition file is in Extensible Markup Language format; The root element of the service definition file is <metainfo>Element;< / metainfo> The <metainfo>under the element <services>Element as its direct child element;< / services> < / metainfo> The <services>one or more of the elements are defined <service>element, each <service>The element is used to describe an independent database service;< / service> < / service> < / services> wherein the <service>The element at least includes:< / service> The service name element is used to define the unique identification of the service; The service display name element is used to define the display name of the service; The service component element is used to define one or more component sub-elements to describe the constituent components of the service.

3. The method of claim 2, wherein, The component sub-element at least includes: The component name element is used to define the unique identification of the component; The component category element is used to define the role category of the component, and the component role category defined by the component category element includes the master node role and the slave node role; The component quantity constraint element is used to define the deployment quantity constraint of the component, wherein the component quantity constraint element value of the master node role is 1, and the component quantity constraint element value of the slave node role is 1 or more. The component command script element is used to associate the deployment script, which includes a script path sub-element, a script type sub-element, and a timeout time sub-element; the timeout time sub-element is used to define the timeout time of the deployment script execution.

4. The method of claim 1, wherein, The structured repository directory system established according to the combination of chip architectures and operating system types includes: The top-level directory is divided according to the chip architecture, including an x86_64 directory and an aarch64 directory; Each chip architecture directory establishes a subdirectory according to the operating system type; The database installation package compiled for the combination of the chip architecture and the operating system is stored in each operating system subdirectory; The naming of the database installation package contains the corresponding database type, version number, target operating system, and target chip architecture information, so that the installation package file and the environment information indicated by its storage path are mutually verified.

5. The method of claim 1, wherein, The environment detection instructions to the target node include: A Python environment detection script is executed on the target node through the Ambari Agent; The script obtains the chip architecture through the os.uname().machine command; The operating system type is identified by detecting the existence of specific system files, wherein the / etc / kylin-release file is detected to identify the Kylin system, the / etc / uos-release file is detected to identify the UOS system, the / etc / openEuler-release file is detected to identify the OpenEuler system, and the / etc / centos-release file is detected to identify the CentOS system; The specific version number of the operating system is determined by reading the content of the specific system file and checking whether it contains a predefined version identification string in its content; Wherein, the content of the / etc / kylin-release file is checked to determine whether it contains V10 to determine the Kylin V10 version, the content of the / etc / uos-release file is checked to determine whether it contains 20 to determine the UOS 20 version, the content of the / etc / openEuler-release file is checked to determine whether it contains 22.03 to determine the OpenEuler 22.03 version, and the content of the / etc / centos-release file is checked to determine whether it contains 7 to determine the CentOS 7 version.

6. The method of claim 5, wherein, The process of executing the environment detection instruction includes an error handling mechanism, which specifically includes: After calling the environment detection function, the exception generated during execution is captured; When the environment detection is successful, a success log containing the generated chip architecture, operating system type and version information is recorded; When the environment detection fails, an error log describing the failure reason is recorded, and the exception is rethrown to terminate the subsequent deployment process.

7. The method of claim 1, wherein, The dynamic selection of the dependency set is implemented through a dependency relationship parser, which includes: A predefined dependency mapping table is used to store the corresponding dependency package list with the database type, chip architecture and operating system type as the joint key; A dependency parsing method is used to query and return the corresponding dependency package list from the dependency mapping table according to the input database type, chip architecture and operating system type; An architecture-specific dependency processing method is used to automatically append ARM architecture-specific dependency packages to the basic dependency list when the chip architecture is aarch64.

8. The method of claim 1, wherein, The unified database adaptation layer defines a standardized operation interface through an abstract base class, which includes the following abstract methods: The install() method is used to execute database installation; The configure() method is used to generate and apply database configuration; The start() method and the stop() method are used to start and stop the database service; The get_status() method is used to obtain the database running status; The backup() method and the restore() method are used for database backup and recovery; Among them, the specific adapter implementation for OpenGauss database includes: Environment check module, used to verify system resources and dependencies; Template rendering module, using template engine to dynamically generate database configuration file according to configuration parameters; Script execution module, calling Shell script to execute installation operation and verifying installation results.

9. The method of claim 1, wherein, The visual deployment orchestration function is implemented through front-end JavaScript components, including: Database service component definition table, defining the icons, display names and resource constraints of each database component; Topology orchestration engine, providing a graphical drag-and-drop interface and performing resource compliance verification when components are placed, including architecture compatibility verification, operating system compatibility verification and resource sufficiency verification.

10. The method of claim 1, wherein, The calling deployment script completes automatic deployment and configuration, specifically including: Dynamically generating Ansible deployment playbook, which includes the following tasks: Installing architecture-specific dependency packages; Downloading matching database installation packages from package repository; Installing database packages; Generating database configuration file using template; Executing database initialization command; Starting database service and setting it to start automatically at boot.

Citation Information

Cited By

  • Intelligent log analysis and fault diagnosis system for distributed software

    CN121636242A

  • Log intelligent analysis fault diagnosis system for distributed software

    CN121636242B

  • Control method of computing power unit management service and electronic equipment

    CN122120127A

  • Method for managing and controlling computing power unit management service and electronic device

    CN122120127B