CN117591134A - Database deployment method and device, electronic equipment and storage medium - Google Patents

Database deployment method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117591134A
CN117591134A CN202311218291.7A CN202311218291A CN117591134A CN 117591134 A CN117591134 A CN 117591134A CN 202311218291 A CN202311218291 A CN 202311218291A CN 117591134 A CN117591134 A CN 117591134A
Authority
CN
China
Prior art keywords
database
mirror image
preset
target
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311218291.7A
Other languages
Chinese (zh)
Inventor
向宜航
陈琦
宁亮
谢远
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Dream Database Co ltd
Original Assignee
Wuhan Dream Database Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Dream Database Co ltd filed Critical Wuhan Dream Database Co ltd
Priority to CN202311218291.7A priority Critical patent/CN117591134A/en
Publication of CN117591134A publication Critical patent/CN117591134A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses a database deployment method, a device, electronic equipment and a storage medium, wherein the method comprises the following steps: when determining that a preset mirror warehouse does not store database mirrors of a target database, acquiring mirror composition files of the target database; packaging the mirror image composition file into the database mirror image according to a preset mirror image specification, and storing the database mirror image into the preset mirror image warehouse; and responding to the deployment instruction of the target database, and calling a preset container management platform to deploy the target database in the distributed cluster according to the database mirror image. According to the embodiment of the application, the automatic deployment of the database in the distributed cluster can be realized, the cost of node upgrading is reduced, and the portability of the database deployment is improved.

Description

Database deployment method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of database technologies, and in particular, to a method and apparatus for deploying a database, an electronic device, and a storage medium.
Background
At present, the deployment of the distributed computer clusters is often carried out through a command line tool or graphic decoding, the deployment process of the distributed computer clusters is often carried out by configuring configuration files, archive files, registration files and the like of a large number of nodes, the processes all need manual participation, the accuracy and the efficiency of the deployment of the distributed clusters are low, in addition, the operation, the configuration, the management and the like of the distributed clusters are bound with the current operating system, and the number of nodes in the distributed clusters is large, so that the operations of software updating, rollback and the like of a database are limited by the current operating system. At present, the efficiency and accuracy of database deployment in a distributed cluster are low, and automatic deployment is needed.
Disclosure of Invention
The application provides a database deployment method, a device, electronic equipment and a storage medium, so as to realize automatic deployment of databases in a distributed cluster, reduce the cost of node upgrading and improve the portability of database deployment.
According to an aspect of the present application, there is provided a database deployment method, wherein the method includes:
when determining that a preset mirror warehouse does not store database mirrors of a target database, acquiring mirror composition files of the target database;
packaging the mirror image composition file into the database mirror image according to a preset mirror image specification, and storing the database mirror image into the preset mirror image warehouse;
and responding to the deployment instruction of the target database, and calling a preset container management platform to deploy the target database in the distributed cluster according to the database mirror image.
According to another aspect of the present application, there is provided a database deployment apparatus, wherein the apparatus includes:
the mirror image file module is used for acquiring a mirror image composition file of the target database when determining that the database mirror image of the target database is not stored in the preset mirror image warehouse;
the mirror image storage module is used for packaging the mirror image forming file into the database mirror image according to a preset mirror image specification and storing the database mirror image into the preset mirror image warehouse;
The mirror image deployment module is used for responding to the deployment instruction of the target database, calling a preset container management platform and deploying the target database in the distributed cluster according to the database mirror image.
According to another aspect of the present application, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the database deployment method of any of the embodiments of the present application.
According to another aspect of the present application, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute a database deployment method according to any embodiment of the present application.
According to the technical scheme, the mirror image composition file of the target database is obtained when the preset mirror image warehouse does not store the database mirror image of the target database, the mirror image composition file is packaged into the database mirror image according to the preset mirror image specification and stored in the preset mirror image warehouse, when the deployment instruction corresponding to the target database is obtained, the target database is arranged in the distributed cluster according to the database mirror image of the preset mirror image warehouse, automatic deployment of the database in the distributed cluster is realized, the deployment cost of the database in the cluster can be reduced, the fault probability caused by manual deployment is reduced, the portability of the target database can be improved, and the use experience of a user is enhanced.
It should be understood that the description of this section is not intended to identify key or critical features of the embodiments of the application or to delineate the scope of the application. Other features of the present application will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a database deployment method according to a first embodiment of the present application;
FIG. 2 is a flowchart of another database deployment method provided according to a second embodiment of the present application;
FIG. 3 is a flow chart of another database deployment method provided in accordance with a third embodiment of the present application;
FIG. 4 is an exemplary diagram of a database deployment method provided in accordance with a fourth embodiment of the present application;
fig. 5 is a schematic structural diagram of a database deployment apparatus according to a fifth embodiment of the present application;
Fig. 6 is a schematic structural diagram of an electronic device according to a sixth embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a database deployment method according to an embodiment of the present application, where the method may be implemented by a database deployment device, and the database device may be implemented in hardware and/or software, and the database device may be configured in a server or a server cluster. As shown in fig. 1, the method includes:
and 110, when the fact that the preset mirror warehouse does not store the database mirror image of the target database is determined, acquiring a mirror image composition file of the target database.
The preset mirror image warehouse can be a storage area for storing database mirrors, can be built by an enterprise or by a third-party cloud service provider, and can comprise database mirrors of different manufacturers and different types. The target database may be a database to be deployed, the target database may be automatically determined or determined by an operation and maintenance person, for example, the target database may be a database of a specific version of some databases, the server may automatically acquire the latest version of the designated database as the target database at intervals, or the operation and maintenance person manually designates a certain database as the target database, the database mirror may be a precision aid containing the whole database, the database mirror may include data stored in a hard disk, an optical disk, a system memory or the like, and may be capable of failing these file structures and file contents. The image component files may be files that constitute database images of the target database, and may include, but are not limited to, base images, configuration files, and the like.
In this embodiment of the present application, whether a database image of a target database exists may be searched in a preset image warehouse at regular or irregular time, and it may be understood that the target database may be a database determined according to service requirements, for example, may be a database of the latest version or a database specified by an operation and maintenance personnel, if no database image of the target database exists in the preset image warehouse, an image composition file of the target database is extracted, and if a database image of the target database exists in the preset image warehouse, the preset image warehouse is waited for the next inspection or the deployment is performed using the database.
And 120, packaging the mirror image composition file into a database mirror image according to a preset mirror image specification, and storing the database mirror image into a preset mirror image warehouse.
The preset mirror image specification can be a rule for packaging a mirror image composition file, and can adopt different mirror image file packaging rules according to different service requirements and software and hardware equipment conditions, the preset mirror image specification comprises but is not limited to a file storage format of a database, an operation mode of the database, environment resources configured by the database and the like, taking a database mirror image in a Kubernetes environment as an example, the mirror image file is required to have producer information, installation package information and the like in the preset mirror image specification, and a basic mirror image of the database mirror image and producer information are written into the Dockerfile and the like.
In the embodiment of the application, the image composition file of the target database may be obtained, where the image composition file may include contents such as a base image and a configuration file, and the image composition file may be packaged according to a preset image specification, and the generated file package is used as a database image. It may be understood that in the embodiment of the present application, the preset mirror image specification may be multiple, and the mirror image composition file may be encapsulated according to the service requirement or the user instruction by selecting a corresponding preset mirror image specification. Specifically, after the database image is obtained, the database may be uploaded to a preset image repository for storage, and in this embodiment of the present application, implementation manners of the preset image repository are not limited, and the preset image repository may include a self-built platform or a service platform provided by a third party cloud service provider.
And 130, responding to a deployment instruction of the target database, and calling a preset container management platform to deploy the target database in the distributed cluster according to the database mirror image.
The deployment instruction may be information triggering the target data to deploy, where the deployment instruction may include nodes and node roles of the deployed distributed cluster, and in some application embodiments, the deployment instruction may further include identification information of the target database. The preset container management platform can be a platform for performing containerization management on resources in the distributed cluster, and can comprise a Kubernet es platform, an ECS container management platform and the like.
In the embodiment of the application, the deployment instruction of the target database can be monitored, when the deployment instruction of the corresponding target database is received, the database mirror image of the preset mirror image warehouse can be obtained, and the preset container management platform is called to deploy the database mirror image in the distributed cluster, so that the target database is installed to the corresponding node in the distributed cluster.
According to the method and the device, when the preset mirror warehouse does not store the database mirror image of the target database, the mirror image composition file of the target database is acquired, the mirror image composition file is packaged into the database mirror image according to the preset mirror image specification and stored in the preset mirror image warehouse, when the deployment instruction corresponding to the target database is acquired, the target database is arranged in the distributed cluster according to the database mirror image of the preset mirror image warehouse, automatic deployment of the database in the distributed cluster is realized, the deployment cost of the database in the cluster can be reduced, the fault probability caused by manual deployment is reduced, portability of the target database can be improved, and the use experience of a user is enhanced.
Example two
Fig. 2 is a flowchart of another database deployment method according to a second embodiment of the present application, where the embodiment is implemented on the basis of the foregoing embodiment, and description is given of obtaining a mirror image composition file and packaging a database mirror image, and referring to fig. 2, the method provided in the embodiment of the present application specifically includes the following steps:
Step 210, extracting a database identifier of the target database.
The database identifier may be information for distinguishing the target database, and the database identifier may include a database version number, a database name, a database number, and the like.
In the embodiment of the application, one or more of information such as a database version number, a database name, a database number and the like can be extracted from the target database to serve as a database identifier.
Step 220, if the database mirror image corresponding to the database identifier is not found in the preset mirror image warehouse, determining that the database mirror image of the target database is not stored in the preset mirror image warehouse.
Specifically, the database image associated with the database identifier may be determined by searching in a preset image repository according to the database identifier, where the association may include storing the database image in association with the database identifier, and storing the database identifier in the database image or storing the database identifier in the same storage area as the database image. If the database mirror image corresponding to the database identifier is found in the preset mirror image warehouse, determining that the database mirror image of the target database exists in the preset mirror image warehouse, otherwise, determining that the database mirror image corresponding to the database identifier does not exist in the preset mirror image warehouse.
Step 230, determining the configuration file of the target database and the base mirror image as the mirror image composition file.
The base image may be an image file formed by a program file of the target database, the base image may exist in a file directory structure of the target database, the configuration file may include a file of configuration information used by running of the target database, and the configuration file may include a service name configuration file or an archive log configuration file.
In the embodiment of the application, after determining that the preset mirror warehouse does not store the database mirror image of the target database, the engineering file of the target database can be extracted to form a basic mirror image, the configuration parameters used by the running of the target database are determined to be stored as configuration files, and the determined basic mirror image and the configuration files can be used as mirror image forming files of the target data. In some embodiments of the application, the image composition file may also include control commands of the base image, and software and hardware resources of the application, and so on.
And 240, packaging the mirror image composition file into a database mirror image according to a preset mirror image specification of the distributed cluster.
In this embodiment of the present application, a corresponding preset mirror image specification may be selected according to information such as software and hardware conditions and service requirements of the distributed cluster, an image composition file may be adjusted according to requirements in the preset mirror image specification, and the adjusted image composition file is used as a database mirror image, where it may be understood that the preset mirror image specification may include information such as a form of a file directory of the database, a template of a configuration file, a type of a control instruction, and the like, and packaging the image composition file according to the preset mirror image specification may include adjusting a database directory in a base mirror image according to the file directory, and adjusting the configuration file in the image composition file according to the template of the configuration file.
Step 250, determining an execution script file of the database mirror image, wherein the execution script file at least comprises a main logic script and an initialization script.
In the embodiment of the application, the execution script file of the database mirror image can be prepared, the execution script file can comprise a main logic script and an initialization script of the database, the customized configuration of the configuration items in the execution script file can be realized, and the subsequent database mirror image deployment is facilitated.
Step 260, configuring external port information of the database mirror.
Specifically, the database may be configured with external port information, where the external port information may be used for data interaction with the outside by the deployed database, and it may be understood that the external port information may include a port number or a port number range.
Step 270, determining the identification information of the target database; and generating a tag identification of the database mirror image according to the identification information, and uploading the database mirror image to a Chart warehouse.
The tag identification may be information for identifying the database images, the tag identification may have uniqueness, and tag identifications of different database images may be different. The Chart repository may be a storage repository storing database images, the Chart repository may provide storage, upload, and download functions, and the Chart repository may upload database images to the Chart repository through a client or command line.
In this embodiment of the present application, the identification information of the target database may be extracted, and a tag information may be determined according to the identification information, for example, a portion or all of the identification information is included in the tag information, and the determined tag information may be identified in the generated database image. The database image marked by the tag identification can be uploaded to the Chart warehouse through a command line or a client corresponding to the Chart warehouse.
Step 280, responding to a deployment instruction of the target database, and distributing the target database in the distributed cluster according to the preset container management platform and the database mirror image.
According to the embodiment of the application, whether the database image corresponding to the target database exists or not is determined in the preset image warehouse according to the database identification, the basic image and the configuration file of the target database are obtained as image composition files when the database image does not exist, the image composition files are packaged into the database image according to the preset image specification corresponding to the distributed cluster, the script files and the external port information are configured and executed for the database image, the identification information of the target database is extracted, the label identification is determined according to the identification information, the database image is marked, and the marked database image is uploaded to the Chart warehouse, so that the automatic deployment of the database in the distributed cluster is realized, the cost of node upgrading can be reduced, and the portability of the database deployment is improved.
Further, on the basis of the foregoing application embodiment, determining the base image and the configuration file of the target database as the image composition file includes:
reading an engineering file of a target database as a basic mirror image; receiving configuration parameters corresponding to the target database, and storing the configuration parameters as configuration files according to a preset configuration template, wherein the preset configuration template comprises a service name configuration template and an archive log configuration template.
In this embodiment of the present application, an engineering file of a target database may be read, where the engineering file may be a code file used by an execution function of the target database, the engineering file may include a library package engineering file, a script engineering file, a kernel engineering file, a function implementation engineering file, and the like of the target database, the read engineering file of the target database may be used as a base mirror image, a configuration parameter of the target database may also be received, the configuration parameter may be necessary information for controlling the operation of the target database, for example, a permission authentication parameter, a connection parameter, and the like, the received configuration parameter may be saved as a configuration file according to a preset configuration target, and in this embodiment of the present application, a preset configuration template may include a service name configuration template, an archive log configuration template, and the like according to different uses of the configuration parameter, where the service name configuration template may be used to establish a configuration parameter storage used template file for service connection, and the archive log configuration template is used to store the target file of the configuration parameter of the configuration file.
Example III
Fig. 3 is a flowchart of another database deployment method according to a third embodiment of the present application, which is embodied on the basis of the foregoing application embodiment, and referring to fig. 3, the method provided by the embodiment of the present application specifically includes the following steps:
step 310, when it is determined that the preset mirror warehouse does not store the database mirror image of the target database, a mirror image composition file of the target database is obtained.
And 320, packaging the mirror image composition file into a database mirror image according to a preset mirror image specification, and storing the database mirror image into a preset mirror image warehouse.
Step 330, receiving the deployment instruction, and extracting the target node and the cluster role corresponding to the distributed cluster from the deployment instruction.
The target nodes can be nodes of a target database in the distributed cluster, the target nodes can be part or all of the nodes in the distributed cluster, the deployment instruction can carry information indicating the target nodes, the cluster roles can be roles of each target node in the target database, and the cluster roles can be divided according to service requirements and hardware characteristics.
In the embodiment of the present application, the deployment instruction may be monitored, when it is determined that the deployment instruction is received, information in the deployment instruction may be extracted to determine a target node and a cluster role of the deployment target database, and it may be understood that information in the deployment instruction, which indicates the target node and the cluster role, may be a direct indication, for example, the deployment instruction directly carries the target node and the cluster role; the deployment instruction can also implicitly indicate the target node and the cluster roles, the nodes in the distributed cluster can be divided into a plurality of groups, each group is allocated with different cluster roles, and the deployment instruction can indicate the target node and the node roles in a mode of carrying a group number.
And 340, pulling a database mirror image of a preset mirror image warehouse for each target node.
In the embodiment of the application, the database mirror image corresponding to the target database can be downloaded in the preset mirror image warehouse, and the database mirror image is sent to the target nodes in the distributed cluster, so that the target nodes acquire the corresponding database mirror images. In other application embodiments, the trigger information may be sent to the target node, so that the target node actively pulls the database image in the preset image repository.
And step 350, calling a preset container management platform to install the mirror image database according to the execution script file of the database mirror image.
Specifically, a preset container management platform can be called, resources in each target node are scheduled through the preset container management platform, and script files are executed in the resources so that the mirror database is input into each target node.
And step 360, configuring the management role of the target database for the target node according to the cluster role.
In the embodiment of the application, after the mirror database is installed for the target node, the target node can be configured according to the cluster role, so that the target node manages the target database according to the cluster role.
According to the method, when the database mirror image of the target database is not stored in the preset mirror image warehouse, the mirror image composition file of the target database is obtained, the mirror image composition file and the preset mirror image specification are used for generating the database mirror image, the database mirror image is uploaded to the preset mirror image warehouse, the target node and the cluster role in the received deployment instruction are extracted, the database mirror image of the preset mirror image warehouse is transmitted to the target node, the preset container management platform is called to install the database mirror image to the target node, and the management role of the target node in the target database is configured according to the cluster role, so that automatic deployment of the database in the distributed cluster is realized, the deployment cost of the database in the cluster can be reduced, the fault probability caused by manual deployment is reduced, the portability of the target database can be improved, and the use experience of a user is enhanced.
Further, on the basis of the embodiment of the application, installing the image database according to the execution script file of the database image on the preset container management platform includes:
determining container resources of the database mirror image in a preset container management platform; invoking an execution script file at the container resource to initialize a database environment of the database image; installing a basic mirror image in a database environment and configuring an external port of a target database according to external port information of a mirror image database.
In the embodiment of the application, the container resources corresponding to the database mirror image are called at the preset container management platform, the container resources can comprise software resources and/or hardware resources in the target node, the execution script file is realized according to the container resources, so that the database environment of the database mirror image is initialized, the basic mirror image of the mirror image database can be copied to the database environment in the target node, and the target database installed in the target node is configured with an external interface according to external port information, so that the interface for communicating the target database in the target node with the outside is realized.
Example IV
Fig. 4 is an exemplary diagram of a database deployment method provided according to a fourth embodiment of the present application, taking a database deployment in a distributed computing cluster as an example, and according to characteristics of the distributed computing cluster, fabricating a Docker mirror image of the distributed computing cluster by writing Dockerfile; developing a distributed computing cluster Chart warehouse based on a Docker mirror image, and manufacturing a Kubernetes resource yml template file of each node of the distributed computing cluster; based on the Chart warehouse template file, distributed computing clusters are deployed on a Kubernetes environment using Helm instruction automation. Referring to fig. 4, the database deployment provided in the embodiment of the present application includes the following procedures:
1) Writing Dockerfire, writing the Dockerfire into the basic mirror image, and establishing producer information of the dream distributed computing cluster mirror image.
In the embodiment of the application, the basic mirror image can be a manufactured ubuntu16.04 basic mirror image with cron service and dpkg command, so that the distributed cluster can also perform safe remote file copying in a container.
2) Preparing an installation package required for a distributed computing cluster: the installation package data needs to contain the most basic directory structure, typically containing bin directory (execution code directory), data directory (data directory) and log directory (log directory). The installation package comprises a most basic directory structure, so that the mirror image on which the containerized deployment method depends becomes lightweight, the limitation of hardware specification is reduced, the noise floor overhead is smaller, and the application field is wider.
3) Preparing a configuration template file required by the distributed computing cluster, wherein the configuration template file mainly comprises a service name configuration (dm_svc.conf), an archive log configuration (dmarch.ini) and the like; the configuration template file changes some configuration items which need to be customized, and is convenient to modify and replace later by using container environment variables.
4) Preparing relevant script files required by the distributed computing cluster: including master logic execution script startup. Sh, initialization script prestup. Sh, etc. The main logic execution script startup. Sh comprises the functions of service starting, copy registration, configuration realization, backup recovery and the like of each node of the distributed cluster, and the initialization script presetup. Sh comprises the functions of SSH access, encryption algorithm and the like.
In the embodiment of the application, the execution steps required by deploying the distributed computing clusters can be scripted through the related script files, so that the container can complete the execution of all functions during one-key deployment, and the purpose of enabling the distributed computing cluster container to be started and provide services is achieved.
5) Exposing the distributed computing clusters requires ports to be used externally and opening corresponding ports in the container as needed. In order to facilitate subsequent maintenance work, the example mainly exposes the access port and the cluster monitoring port of the SP computing server node database, and sets the port range to 30000 to 33000 so as to avoid port conflict.
6) And constructing a dream distributed computing cluster mirror image by using a dock build command, and uploading the constructed mirror image to a distributed computing cluster Chart warehouse after marking so as to be used in a kubernetes environment later.
7) And (3) making a Kubernetes resource yml template file of each node of the distributed computing cluster, and automatically deploying the distributed computing cluster on the Kubernetes environment by using a Helm instruction based on a distributed computing cluster mirror image in a Chart warehouse.
Example III
Fig. 5 is a schematic structural diagram of a database deployment apparatus according to a fifth embodiment of the present application. As shown in fig. 5, the apparatus includes: an image file module 401, an image save module 402, and an image deployment module 403.
And the mirror image file module 401 is configured to obtain a mirror image composition file of the target database when determining that the preset mirror image warehouse does not store a database mirror image of the target database.
And the image storage module 402 is configured to package the image forming file into the database image according to a preset image specification, and store the database image in the preset image repository.
The mirror image deployment module 403 is configured to respond to a deployment instruction of the target database, and call a preset container management platform to deploy the target database in a distributed cluster according to the database mirror image.
According to the embodiment of the application, when the mirror image file module determines that the preset mirror image warehouse does not store the mirror image of the target database, the mirror image storage module packages the mirror image composition file into the mirror image of the database according to the preset mirror image specification and stores the mirror image into the preset mirror image warehouse, and when the mirror image deployment module acquires the deployment instruction corresponding to the target database, the target database is deployed in the distributed cluster according to the mirror image of the database in the preset mirror image warehouse, so that the automatic deployment of the database in the distributed cluster is realized, the deployment cost of the database in the cluster can be reduced, the fault probability caused by manual deployment can be reduced, the portability of the target database can be improved, and the use experience of a user can be enhanced.
Further, on the basis of the above application embodiment, the image file module 401 includes:
and the identification extraction unit is used for extracting the database identification of the target database.
And the storage determining unit is used for determining that the preset mirror warehouse does not store the database mirror image of the target database if the database mirror image corresponding to the database identifier is not searched in the preset mirror image warehouse.
And the file determining unit is used for determining the configuration file of the target database and the basic mirror image as the mirror image composition file.
Further, on the basis of the above-mentioned application embodiment, the file determining unit is specifically configured to: reading an engineering file of the target database as the basic mirror image; receiving configuration parameters corresponding to the target database, and storing the configuration parameters as the configuration files according to a preset configuration template, wherein the preset configuration template comprises a service name configuration template and an archive log configuration template.
Further, in the embodiment of the application, the image saving module 402 includes:
the image acquisition unit is used for packaging the image forming files into the database images according to the preset image specification of the distributed cluster.
And the script file unit is used for determining an execution script file of the database mirror image, wherein the execution script file at least comprises a main logic script and an initialization script.
And the port configuration unit is used for configuring the external port information of the database mirror image.
Further, on the basis of the above application embodiment, when the preset image repository is a Chart repository, the image saving module 402 is further configured to: determining identification information of the target database; and generating a tag identification of the database mirror image according to the identification information, and uploading the database mirror image to the Chart warehouse.
Further, on the basis of the above application embodiment, the mirror deployment module 403 includes:
and the information extraction unit is used for receiving the deployment instruction and extracting a target node and a cluster role corresponding to the distributed cluster from the deployment instruction.
And the mirror image pulling unit is used for pulling the database mirror image of the preset mirror image warehouse for each target node.
The mirror image installation unit is used for calling the preset container management platform to install the mirror image database according to the execution script file of the mirror image of the database.
And the role deployment unit is used for configuring the management role of the target database for the target node according to the cluster role.
Further, on the basis of the above-mentioned application embodiment, the mirror image mounting unit is configured to: determining container resources of the database mirror image at the preset container management platform;
invoking the execution script file at the container resource to initialize a database environment of the database image;
and installing the basic mirror image in the database environment and configuring the external port of the target database according to the external port information of the mirror image database.
The database deployment device provided by the embodiment of the application can execute the database deployment method provided by the embodiment of the application, and has the corresponding functional modules and beneficial effects of the execution method.
Example six
Fig. 6 is a schematic structural diagram of an electronic device according to a sixth embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the application described and/or claimed herein.
As shown in fig. 6, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as database deployment methods.
In some embodiments, the database deployment method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the database deployment method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the database deployment method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out the methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this application, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present application may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solutions of the present application are achieved, and the present application is not limited herein.
The above embodiments do not limit the scope of the application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application are intended to be included within the scope of the present application.

Claims (10)

1. A method of database deployment, the method comprising:
when determining that a preset mirror warehouse does not store database mirrors of a target database, acquiring mirror composition files of the target database;
packaging the mirror image composition file into the database mirror image according to a preset mirror image specification, and storing the database mirror image into the preset mirror image warehouse;
and responding to the deployment instruction of the target database, and calling a preset container management platform to deploy the target database in the distributed cluster according to the database mirror image.
2. The method according to claim 1, wherein when the determining that the preset mirror repository does not store the database mirror of the target database, obtaining the mirror composition file of the target database includes:
extracting a database identifier of the target database;
if the database mirror image corresponding to the database identifier is not searched in the preset mirror image warehouse, determining that the database mirror image of the target database is not stored in the preset mirror image warehouse;
and determining the configuration file of the target database and the basic mirror image as the mirror image composition file.
3. The method of claim 2, wherein said determining the configuration file of the target database and the base image as the image composition file comprises:
reading an engineering file of the target database as the basic mirror image;
receiving configuration parameters corresponding to the target database, and storing the configuration parameters as the configuration files according to a preset configuration template, wherein the preset configuration template comprises a service name configuration template and an archive log configuration template.
4. The method of claim 1, wherein the encapsulating the image component file into the database image according to a preset image specification comprises:
Packaging the mirror image composition file into the database mirror image according to the preset mirror image specification of the distributed cluster;
determining an execution script file of the database mirror image, wherein the execution script file at least comprises a main logic script and an initialization script;
and configuring external port information of the database mirror image.
5. The method of claim 1, wherein said saving the database image to the preset image repository when the preset image repository is a hart repository comprises:
determining identification information of the target database;
and generating a tag identification of the database mirror image according to the identification information, and uploading the database mirror image to the Chart warehouse.
6. The method of claim 1, wherein the invoking the preset vessel management platform to deploy the target database within the distributed cluster according to the database mirror in response to the deployment instruction of the target database comprises:
receiving the deployment instruction, and extracting a target node and a cluster role corresponding to the distributed cluster from the deployment instruction;
pulling the database mirror image of the preset mirror image warehouse for each target node;
Calling the preset container management platform to install the mirror image database according to the execution script file of the database mirror image;
and configuring the management role of the target database for the target node according to the cluster role.
7. The method of claim 6, wherein installing the mirror database at the preset container management platform according to the execution script file of the database mirror comprises:
determining container resources of the database mirror image at the preset container management platform;
invoking the execution script file at the container resource to initialize a database environment of the database image;
and installing the basic mirror image in the database environment and configuring the external port of the target database according to the external port information of the mirror image database.
8. A database deployment apparatus, the apparatus comprising:
the mirror image file module is used for acquiring a mirror image composition file of the target database when determining that the database mirror image of the target database is not stored in the preset mirror image warehouse;
the mirror image storage module is used for packaging the mirror image forming file into the database mirror image according to a preset mirror image specification and storing the database mirror image into the preset mirror image warehouse;
The mirror image deployment module is used for responding to the deployment instruction of the target database, calling a preset container management platform and deploying the target database in the distributed cluster according to the database mirror image.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the database deployment method of any of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to implement the database deployment method of any one of claims 1-7 when executed.
CN202311218291.7A 2023-09-19 2023-09-19 Database deployment method and device, electronic equipment and storage medium Pending CN117591134A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311218291.7A CN117591134A (en) 2023-09-19 2023-09-19 Database deployment method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311218291.7A CN117591134A (en) 2023-09-19 2023-09-19 Database deployment method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117591134A true CN117591134A (en) 2024-02-23

Family

ID=89915578

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311218291.7A Pending CN117591134A (en) 2023-09-19 2023-09-19 Database deployment method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117591134A (en)

Similar Documents

Publication Publication Date Title
CN107896162B (en) Deployment method and device of monitoring system, computer equipment and storage medium
CN109885316B (en) Hdfs-hbase deployment method and device based on kubernetes
CN111580926A (en) Model publishing method, model deploying method, model publishing device, model deploying device, model publishing equipment and storage medium
US20230060053A1 (en) Method and apparatus of deploying a cluster, and storage medium
CN111225064A (en) Ceph cluster deployment method, system, device and computer-readable storage medium
CN113204353B (en) Big data platform assembly deployment method and device
CN115292026A (en) Management method, device and equipment of container cluster and computer readable storage medium
CN114527996A (en) Multi-service deployment method and device, electronic equipment and storage medium
CN111752581A (en) Distributed system upgrading method and device and computer system
CN115048205A (en) ETL scheduling platform, deployment method thereof and computer-readable storage medium
CN112540805B (en) Integrated item packaging method, integrated item packaging device, integrated item packaging apparatus, integrated item packaging device, integrated item packaging storage medium, and integrated item packaging program product
CN112199200A (en) Resource scheduling method and device, computer equipment and storage medium
CN115632944B (en) Node configuration method, device, equipment, readable storage medium and server
CN114070889B (en) Configuration method, traffic forwarding device, storage medium, and program product
CN117591134A (en) Database deployment method and device, electronic equipment and storage medium
CN116248526A (en) Method and device for deploying container platform and electronic equipment
CN115576565A (en) Application program deployment method and device, electronic equipment and storage medium
CN117519989B (en) Distributed system hosting method and device, electronic equipment and storage medium
CN111934907B (en) Application cloud method, system and device based on container cloud platform
CN112948065B (en) Kubernetes-based scheduling automation system management device
CN115509612A (en) Redis cluster processing method, device, equipment and storage medium
CN116931974A (en) Intelligent installation system and method for edge service
CN116527761A (en) Database proxy service adding method, device, equipment and storage medium
CN115913922A (en) Domain name configuration method and device
CN117149224A (en) Mirror image processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination