CN113590271A - 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
CN113590271A
CN113590271A CN202111132133.0A CN202111132133A CN113590271A CN 113590271 A CN113590271 A CN 113590271A CN 202111132133 A CN202111132133 A CN 202111132133A CN 113590271 A CN113590271 A CN 113590271A
Authority
CN
China
Prior art keywords
database
virtual machine
configuration information
mode
deployment
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
CN202111132133.0A
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 Sitong Information Service Co ltd
Original Assignee
Wuhan Sitong Information Service 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 Sitong Information Service Co ltd filed Critical Wuhan Sitong Information Service Co ltd
Priority to CN202111132133.0A priority Critical patent/CN113590271A/en
Publication of CN113590271A publication Critical patent/CN113590271A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45508Runtime interpretation or emulation, e g. emulator loops, bytecode interpretation
    • G06F9/45512Command shells
    • 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/21Design, administration or maintenance of databases
    • G06F16/211Schema design and management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • 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/45562Creating, deleting, cloning virtual machine instances
    • 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/45579I/O management, e.g. providing access to device drivers or storage

Landscapes

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

Abstract

The invention provides a database deployment method, a database deployment device, electronic equipment and a storage medium. The database deployment method comprises the following steps: firstly, determining a database deployment mode and virtual machine configuration information according to a database deployment instruction, wherein the database deployment mode comprises an internal resource mode, an external resource mode and an instance mode; then, according to the internal resource mode, the external resource mode or the instance mode, constructing or selecting a corresponding virtual machine; and finally, acquiring the configuration information of the database, so that the constructed virtual machine creates a target database according to the configuration information of the database. According to the invention, a standardized flow of database deployment is established, automatic deployment of the database can be realized under different database deployment modes and deployment environments, namely an internal virtualization platform and an external virtualization platform, manual filling of configuration information creation scripts is not needed, failure or problems of database deployment caused by manual misoperation are avoided, and the database deployment efficiency is improved.

Description

Database deployment method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of database technologies, and in particular, to a method and an apparatus for deploying a database, an electronic device, and a storage medium.
Background
At present, when the database deployment is carried out, the Linux operating system centros version is mainly manually created, and then the configuration script is customized to realize the database deployment. In the process, relevant parameters need to be manually configured to create an operating system, full-automatic deployment of the database cannot be realized, and misoperation is easy to occur in manual operation, so that the database deployment fails.
Disclosure of Invention
In order to solve the problems and disadvantages of the prior art, the present invention provides a method and an apparatus for database deployment, an electronic device, and a storage medium, which can automatically deploy a database in different environments, thereby reducing manual operations.
The invention firstly provides a database deployment method, which is applied to a management unit of a database management system, the database management system also comprises an internal virtualization platform and an external virtualization platform, and the database deployment method comprises the following steps:
determining a database deployment mode and virtual machine configuration information according to a database deployment instruction, wherein the database deployment mode comprises an internal resource mode, an external resource mode and an instance mode;
when the database deployment mode is an internal resource mode, sending the virtual machine configuration information to an internal virtualization platform, and enabling the internal virtualization platform to construct a virtual machine according to the virtual machine configuration information; when the database deployment mode is an external resource mode, sending the virtual machine configuration information to an external virtualization platform, and enabling the external virtualization platform to construct a virtual machine according to the virtual machine configuration information; when the database deployment mode is an instance mode, determining a corresponding constructed virtual machine from a pre-constructed virtual machine set according to the configuration information of the virtual machine;
and acquiring the configuration information of the database, so that the constructed virtual machine creates a target database according to the configuration information of the database.
Optionally, the step of enabling the constructed virtual machine to create the target database according to the database configuration information includes:
generating database configuration information according to the database medium information and the database attribute information;
and generating an installation script according to the database configuration information, and enabling the constructed virtual machine to run the installation script to create a target database.
Optionally, the database management system further includes a proxy service unit, which generates an installation script according to the database configuration information, and causes the built virtual machine to run the installation script to create the target database, where the step includes:
generating an installation script according to the database configuration information;
acquiring the installation state of a target database through a proxy service unit in the process of running an installation script by the constructed virtual machine;
and when the installation state of the target database is successful, receiving the information of successful installation returned by the proxy service unit.
Optionally, the database management system further includes a file server, the internal virtualization platform is provided with a file storage unit, and before the step of determining the database deployment mode and the virtual machine configuration information according to the database deployment instruction, the method further includes:
acquiring file data of a plurality of database operating systems;
storing file data of a plurality of database operating systems into a file server, and generating corresponding file data identification marks;
and recording the file data identification mark into a file storage unit.
Optionally, before the step of determining the database deployment mode and the virtual machine configuration information according to the database deployment instruction, the method further includes:
acquiring a plurality of database media;
storing a plurality of database media into a file server, and generating corresponding database media identification marks;
and recording the database medium identification mark into a file storage unit.
Optionally, when the database deployment mode is an external resource mode, sending the virtual machine configuration information to the external virtualization platform, so that the external virtualization platform constructs the virtual machine according to the virtual machine configuration information, including:
when the database deployment mode is an external resource mode, the virtual machine configuration information stored in the file server is imported into the virtual host of the external virtualization platform through the program interface, so that the virtual host builds the corresponding virtual machine.
Optionally, after the step of importing the virtual machine configuration information stored in the file server into the virtual host of the external virtualization platform when the database deployment mode is the external resource mode, so that the virtual host builds the corresponding virtual machine, the method further includes:
and adding the file storage unit into the virtual host machine as a temporary storage unit through a program interface so that the virtual machine acquires the target database medium from the temporary storage unit.
The invention also provides a database deployment device, which is applied to a management unit of a database management system, the database management system also comprises an internal virtualization platform and an external virtualization platform, and the database deployment device comprises:
the deployment instruction determining module is used for determining a database deployment mode and virtual machine configuration information according to a database deployment instruction, wherein the database deployment mode comprises an internal resource mode, an external resource mode and an instance mode;
the virtual machine configuration module is used for sending the virtual machine configuration information to the internal virtualization platform when the database deployment mode is the internal resource mode, so that the internal virtualization platform constructs a virtual machine according to the virtual machine configuration information; when the database deployment mode is an external resource mode, sending the virtual machine configuration information to an external virtualization platform, and enabling the external virtualization platform to construct a virtual machine according to the virtual machine configuration information; when the database deployment mode is an instance mode, determining a corresponding constructed virtual machine from a pre-constructed virtual machine set according to virtual machine system configuration information;
and the database creating module is used for sending the database medium information to the constructed virtual machine, so that the constructed virtual machine attaches the corresponding target database medium according to the database medium information to create the target database.
The invention further provides an electronic device, which comprises a storage medium and a processor, wherein the storage medium stores a computer program, and the processor realizes the steps of the database deployment method when executing the computer program.
The present invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the database deployment method of any one of the above.
Compared with the prior art, the invention has the beneficial effects that: firstly, determining a database deployment mode and virtual machine configuration information according to a database deployment instruction, wherein the database deployment mode comprises an internal resource mode, an external resource mode and an instance mode; then when the database deployment mode is an internal resource mode, sending the virtual machine configuration information to an internal virtualization platform, and enabling the internal virtualization platform to construct a virtual machine according to the virtual machine configuration information; when the database deployment mode is an external resource mode, sending the virtual machine configuration information to an external virtualization platform, and enabling the external virtualization platform to construct a virtual machine according to the virtual machine configuration information; when the database deployment mode is an instance mode, determining a corresponding constructed virtual machine from a pre-constructed virtual machine set according to the configuration information of the virtual machine; and finally, acquiring the configuration information of the database, so that the constructed virtual machine creates a target database according to the configuration information of the database. According to the invention, a standardized flow of database deployment is established, automatic deployment of the database can be realized under different database deployment modes and deployment environments (an internal virtualization platform and an external virtualization platform), a configuration information creation script does not need to be manually filled, failure or problem of database deployment caused by manual misoperation is avoided, and the database deployment efficiency is improved.
Drawings
In order to illustrate the embodiments or the technical solutions in the prior art more clearly, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the invention, and it is obvious for a person skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is an architecture diagram of a database management system according to an embodiment of the present invention;
FIG. 2 is a flowchart of a database deployment method according to an embodiment of the present invention;
FIG. 3 is a flowchart of a database deployment method according to an embodiment of the present invention;
FIG. 4 is a flowchart of a database deployment method according to an embodiment of the present invention;
FIG. 5 is a flow chart of a database deployment method of the present invention;
FIG. 6 is an architecture diagram of a database deployment device in accordance with an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. Furthermore, in the embodiments of the present invention, the terms "first", "second", "third", "fourth", and the like are used only for the purpose of distinguishing between descriptions and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. In embodiments of the present invention, "for example," example, "and" such as "are used to mean" serving as an example, instance, or illustration. Any embodiment described herein as "for example," "for example," and "such as" is not necessarily to be construed as preferred or advantageous over other embodiments. The following description is presented to enable any person skilled in the art to make and use the invention. In the following description, details are set forth for the purpose of explanation. It will be apparent to one of ordinary skill in the art that the present invention may be practiced without these specific details. In other instances, well-known structures and processes are not shown in detail to avoid obscuring the description of the invention with unnecessary detail. Thus, the present invention is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
The embodiment of the invention provides a database deployment method, which is applied to a management unit 1 of a database management system, and as shown in fig. 1, the database management system further comprises an internal virtualization platform 2 and an external virtualization platform 3. The internal virtualization platform 2 may be cloudstock, which is an open-source infrastructure as a service platform, and is used to manage and orchestrate storage, networks, and computer resource pools to construct a private cloud platform, and in this embodiment, the cloudstock platform may be used as the internal virtualization platform 2 to construct a virtual machine based on the cloudstock platform. The external virtualization platform 3 may be a VMware, which is a common platform for providing virtualization services, and in this embodiment, the VMware platform may be used as the external virtualization platform 3.
The database deployment method of the embodiment is applied to the management unit 1 of the database management system, as shown in fig. 2, and includes the following steps:
step 100, determining a database deployment mode and virtual machine configuration information according to a database deployment instruction, wherein the database deployment mode comprises an internal resource mode, an external resource mode and an instance mode.
Wherein the virtual machine configuration information comprises: CPU core number, memory size, system name, network information, etc. The database deployment schema comprises a template schema and an instance schema, and the template schema comprises an internal resource schema and an external resource schema. The internal resource mode is used for building a virtual machine based on a Cloudstack platform environment, the external mode is used for building the virtual machine based on a VMware platform environment, and the example mode is used for selecting the built virtual machine to deploy, wherein the virtual machine is built in the environment of the Cloudstack platform or the VMware platform.
In the above steps, the operating system type of the database application, such as operating systems of Windows2008r2, 20012r2, 2016, 2019, Window7, Windows10, CentOS6, CentOS7, Redhat6, Redhat7, Ubuntu14, Ubuntu16, etc., may also be determined according to the database deployment instruction.
Step 200 comprises the steps of:
step 210, when the database deployment mode is the internal resource mode, sending the configuration information of the operating system to the internal virtualization platform 2, so that the internal virtualization platform 2 constructs a virtual machine according to the configuration information of the virtual machine.
Wherein, the internal resources in the internal resource mode refer to virtual machines constructed based on the Cloudstack platform environment. And constructing the virtual machine according to the CPU core number, the memory size, the system name, the network information and other virtual machine configuration information.
Step 220, when the database deployment mode is the external resource mode, sending the configuration information of the operating system to the external virtualization platform 3, so that the external virtualization platform 3 constructs the virtual machine according to the configuration information of the virtual machine.
The external resources in the external resource mode refer to virtual machines constructed based on a VMware platform environment, and the virtual machines are constructed according to the CPU core number, the memory size, the system name, the network information, the affiliated host, the affiliated storage and other virtual machine configuration information.
In one embodiment, the steps specifically include: when the database deployment mode is the external resource mode, the virtual machine configuration information stored in the file server 5 is imported into the virtual host of the external virtualization platform 3 through the program interface, so that the virtual host builds the corresponding virtual machine. Specifically, the program interface is an API, and the File server 5 is an FTP (File Transfer Protocol) server.
In one embodiment, the foregoing steps may specifically include: and adding the file storage unit into the virtual host machine as a temporary storage unit through a program interface so that the virtual machine acquires the target database medium from the temporary storage unit. The File storage unit can be NFS storage (Network File System) storage of the Cloudstack platform, and the database medium is a database installation File. Specifically, the virtual machine acquires file address information corresponding to the database medium from the NFS storage, and acquires the database medium from the FTP server according to the file address information.
Step 230, when the database deployment mode is the instance mode, determining a corresponding constructed virtual machine from the pre-constructed virtual machine set according to the configuration information of the operating system.
The relevant configuration information of the virtual machine is configured, the virtual machine is constructed, and the configuration is not needed in practical application.
And step 300, acquiring database configuration information, and enabling the constructed virtual machine to create a target database according to the database configuration information.
In one embodiment, as shown in fig. 3, step 300 specifically includes the following steps:
step 310, generating database configuration information according to the database medium information and the database attribute information. The database medium information is a storage path of a database installation file, the database installation file can be an ISO file (optical disc mirror image file), and the database attribute information includes information such as a database name, a database login name, a database password, and a database installation path.
And 320, generating an installation script according to the database configuration information, and enabling the constructed virtual machine to run the installation script to create a target database. In the embodiment, the installation script adopts a silent installation mode, so that automatic deployment of the database is realized to the greatest extent, and interference of manual operation is reduced.
In an embodiment, the database management system further includes a proxy service unit 4, as shown in fig. 4, step 320 specifically includes:
step 321, generating an installation script according to the database configuration information.
Step 322, in the process of running the installation script by the constructed virtual machine, obtaining the installation state of the target database through the proxy service unit 4.
Specifically, the running state of the script to be installed (the installation process of the database) may be requested from the proxy service unit 4 at intervals (for example, 3 seconds, 5 seconds, or 10 seconds), and the proxy service unit 4 calls an API (application program interface) of the Cloudstack platform or the VMware platform to acquire the installation process of the database and then returns the installation process of the database.
And step 323, receiving the information of successful installation returned by the proxy service unit 4 when the installation state of the target database is successful installation.
Specifically, the Database is directly connected through a JDBC (Java Database Connectivity) interface, and if the connection is successful, it represents that the Database is successfully installed.
In one embodiment, the database management System further includes a File server 5, the internal virtualization platform 2 is provided with a File storage unit, the File server 5 may be an FTP server, and the File storage unit may be NFS (Network File System) storage of the Cloudstack platform.
Before step 100, the following steps are also included:
first, file data of a plurality of database operating systems is acquired. The database operating systems include multiple types of operating systems such as Windows2008r2, 20012r2, 2016, 2019, Window7, Windows10, CentOS6, CentOS7, redcat 6, redcat 7, Ubuntu14, Ubuntu16, and the like.
Then, the file data of the plurality of database operating systems are stored in the file server 5, and corresponding file data identification marks are generated.
Specifically, the file data of the database operating system is stored in different formats according to the category of the virtual machine management program. For example, when the virtual machine management program is VMware, file data of a database operating system is saved in an OVA format; when the virtual machine manager is KVM or H3C, the file data of the operating system is saved in the qcow2 format. In the process, the environment needing configuration can be set in advance, such as system firewall closing, Windows needing Winrm remote service opening, proxy service application installation and the like. And then uploading all the file data and the configuration information to the FTP server to generate a file address on the FTP server, namely a file data identification mark.
And finally, recording the file data identification mark into a file storage unit. Specifically, the file address on the FTP server is transmitted to the Cloudstack platform NFS storage. In this embodiment, the VMware platform and the Cloudstack platform may share one NFS storage. In the subsequent installation process of the database, the file address can be directly and quickly acquired from the NFS storage, and then the corresponding file data is downloaded from the FTP server.
In one embodiment, before step 100, the method further comprises the following steps:
first, a plurality of database media are acquired. The database media may include, but are not limited to, SQLServer2008, SQLServer2012, SQLServer2014, SQLServer2016, SQLServer2017, Oracle11g, Oracle12c, mysql5.7, etc. database files.
Then, the plurality of database media are stored in the file server 5, and corresponding database medium identification marks are generated. Specifically, the database medium is uploaded to the FTP server in an ISO format, and then a file address on the FTP, that is, a database medium identification is generated.
And finally, recording the database medium identification mark into a file storage unit. Specifically, the file address of the database medium stored on the FTP server is stored in the NFS storage, so that the corresponding database medium can be quickly and accurately acquired in the installation process of the database.
As shown in fig. 5, the specific implementation manner of the database deployment method of the present invention in the application process is as follows:
s1, setting a database deployment mode: setting the configuration environments of the mainstream Windows operating system (such as Windows2008r2, 20012r2, 2016, 2019, Window7 and Windows 10) and the Linux operating system (such as CentOS6, CentOS7, Redhat6, Redhat7, Ubuntu14 and Ubuntu 16) in advance, for example, closing a system firewall, opening Winrm remote service by Windows, installing a proxy service application and the like, uploading files of the operating system to a server in an OVA format or a qcow2 format (when the virtual machine management program is VMware, storing the file data of the database operating system in an OVA format, and when the virtual machine management program is KVM or H3C, storing the file data of the operating system in a qcow2 format) for storage, and storing the addresses or paths of the files in a Cloudstack platform NFS storage. The relevant information is then recorded in a database management system.
And S2, storing and registering database ISO files, wherein the database ISO files such as SQLServer2008, SQLServer2012, SQLServer2014, SQLServer2016, SQLServer2017, Oracle11g, Oracle12c, MySql5.7 and the like are converted into ISO files and uploaded into FTP files for storage, and storage addresses or paths of the database files are stored in the Cludstack platform NFS storage to register the database ISO files.
And S3, when entering the database deployment process, determining the type and version of the database, and selecting an instance mode or a template mode.
When the example mode is selected, the login account and the login password of the virtual machine, the account and the password of the database, the installation path and other information are input, and the automatic deployment of the database is started. In the example mode, the relevant configuration information of the virtual machine is configured and the virtual machine is constructed, and the automatic deployment of the database can be completed by directly applying the configurations.
When the internal resource mode is selected, the virtual machine is constructed based on the Cloudstack platform environment. The management unit calls an API (application programming interface) to inform the Cloudstack platform of virtual machine configuration information in an internal mode resource mode, wherein the virtual machine configuration information comprises CPU (Central processing Unit) core number, memory size, system name, network information and the like, and then the virtual machine configuration information in the internal mode is acquired from the NFS (network file system) storage of the Cloudstack platform to start building a virtual machine. After the virtual machine is successfully built, the ISO file of the target database is attached, and after the attachment is successful, whether the state of the proxy service unit 4 is normal or not is checked. And if the attachment of the database ISO file fails, ending the database deployment process.
When the external resource mode is selected, based on the virtual machine constructed in the VMware platform environment, the management unit calls the API to inform the VMware platform of the configuration information of the virtual machine in the external resource mode, wherein the configuration information comprises the CPU core number, the memory size, the system name, the network information, the host to which the virtual machine belongs, the storage to which the virtual machine belongs and the like. And importing a virtual host from the FTP server, starting to construct a virtual machine in the virtual host, and constructing the virtual machine according to the virtual machine configuration information. After the virtual machine is successfully built, the NFS storage of the Cloudstack platform is added into the virtual host as temporary storage by calling the API, and then a path for storing the database ISO file is notified to the VMware platform by calling the API, so that the database ISO file is attached to the virtual machine, and whether the state of the proxy service unit 4 is normal or not is checked after the attachment is successful. And if the attachment of the database ISO file fails, ending the database deployment process.
And S4, generating database configuration information according to the database medium information and the database attribute information. The database medium information is a storage path of a database installation file, the database installation file can be an ISO file (optical disc mirror image file), and the database attribute information includes information such as a database name, a database login name, a database password, and a database installation path.
And S5, generating an installation script according to the database configuration information, enabling the constructed virtual machine to run the installation script, carrying out silent installation and finishing the creation of the target database. In the installation process, installation state polling is carried out every 5 seconds, database installation state information is requested from the proxy service unit 4, and the proxy service unit 4 returns the installation state information by checking the installation process state of the database and matching with feedback information of JDBC connection database.
In the embodiment, the standardization and templating process of database deployment is established, automatic deployment of the database can be realized under different database deployment modes and deployment environments (the internal virtualization platform 2 and the external virtualization platform 3), a configuration information creating script does not need to be manually filled, failure or problem of database deployment caused by manual misoperation is avoided, and the database deployment efficiency is improved.
In the prior art, two schemes are generally adopted when a database is deployed:
the first method is to manually create a Linux operating system centros version by manpower and then customize a configuration script to realize database deployment. In the scheme, an operator needs to have script related knowledge, errors are easy to occur in the configuration of the configuration script, and if the right for accessing the external network is not set, the database medium cannot be downloaded through the external network, so that the data deployment fails.
The second is to complete automatic deployment of the database through a fixed database template, for example, specifying that the Cent0S7 operating system installs the MySql5.7 database, or that the Redhat7 operating system installs Oracle11 g. In the scheme, the database version and the operating system version are bound, so that the selection is not flexible enough, the early-stage investment and maintenance cost is high, the database installation path is fixed, most of the database versions are corresponding to the installation of the Linux system, the deployment operation can be only carried out on a private cloud platform, and the application range is relatively small.
By adopting the method, different operating system versions are supported to match the database types and versions, and an operator can complete automatic deployment of the database by selecting the corresponding deployment mode without paying attention to script configuration. Meanwhile, different database version types can be matched according to different operating system versions, and the database is more flexible and diversified to select. And automatic deployment of the database can be completed aiming at different platforms such as cloudstock, VMware and the like.
An embodiment of the present invention provides a database deployment apparatus, which is applied to a management unit 1 of a database management system, where the database management system further includes an internal virtualization platform 2 and an external virtualization platform 3, and as shown in fig. 6, the database deployment apparatus includes:
a deployment instruction determining module 400, configured to determine a database deployment mode and virtual machine configuration information according to a database deployment instruction, where the database deployment mode includes an internal resource mode, an external resource mode, and an instance mode;
the virtual machine configuration module 500 is configured to send the virtual machine configuration information to the internal virtualization platform 2 when the database deployment mode is the internal resource mode, so that the internal virtualization platform 2 constructs a virtual machine according to the virtual machine configuration information; when the database deployment mode is the external resource mode, sending the virtual machine configuration information to the external virtualization platform 3, and enabling the external virtualization platform 3 to construct a virtual machine according to the virtual machine configuration information; when the database deployment mode is an instance mode, determining a corresponding constructed virtual machine from a pre-constructed virtual machine set according to virtual machine system configuration information;
the database creating module 600 is configured to send the database medium information to the constructed virtual machine, so that the constructed virtual machine attaches the corresponding target database medium according to the database medium information to create the target database.
The database deployment device of the embodiment adopts the database deployment method provided by the embodiment to construct the standardization and templating process of database deployment of the data part, can realize automatic deployment of the database under different database deployment modes and deployment environments (the internal virtualization platform 2 and the external virtualization platform 3), does not need to fill in configuration information creating scripts manually, avoids failure or problems of database deployment caused by manual operation errors, and improves the deployment efficiency of the database.
An embodiment of the present invention also provides an electronic device, as shown in fig. 7, including a processor and a computer-readable storage medium, where the storage medium stores a computer instruction or a computer program.
The electronic device of the embodiment first determines a database deployment mode and virtual machine configuration information according to a database deployment instruction, wherein the database deployment mode comprises an internal resource mode, an external resource mode and an instance mode; then when the database deployment mode is an internal resource mode, sending the virtual machine configuration information to the internal virtualization platform 2, and enabling the internal virtualization platform 2 to construct a virtual machine according to the virtual machine configuration information; when the database deployment mode is the external resource mode, sending the virtual machine configuration information to the external virtualization platform 3, and enabling the external virtualization platform 3 to construct a virtual machine according to the virtual machine configuration information; when the database deployment mode is an instance mode, determining a corresponding constructed virtual machine from a pre-constructed virtual machine set according to the configuration information of the virtual machine; and finally, acquiring the configuration information of the database, so that the constructed virtual machine creates a target database according to the configuration information of the database. According to the invention, a standardized flow of database deployment is established, automatic deployment of the database can be realized under different database deployment modes and deployment environments (the internal virtualization platform 2 and the external virtualization platform 3), a configuration information creation script does not need to be manually filled, failure or problem of database deployment caused by manual misoperation is avoided, and the database deployment efficiency is improved.
It will be understood by those skilled in the art that all or part of the steps in the methods of the above embodiments may be performed by instructions (computer programs) which may be stored in a computer-readable storage medium and loaded and executed by a processor, or by related hardware controlled by the instructions (computer programs). To this end, the storage medium of the hardware device according to the embodiment of the present invention stores a plurality of instructions, and the instructions can be loaded by the processor to execute the steps of any embodiment of the database deployment method according to the embodiment of the present invention.
The storage medium and the processor are electrically connected, directly or indirectly, to enable transmission or interaction of data. For example, the elements may be electrically connected to each other via one or more communication buses or signal lines, such as via a bus. The storage medium stores computer-executable instructions for implementing the data access control method, and includes at least one software functional module which can be stored in the storage medium in the form of software or firmware, and the processor executes various functional applications and data processing by running the software programs and modules stored in the storage medium. The storage medium may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a programmable read-only memory (PROM), an erasable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), and the like. The storage medium is used for storing programs, and the processor executes the programs after receiving the execution instructions. Further, the software programs and modules within the storage media described above may also include an operating system, which may include various software components and/or drivers for managing system tasks (e.g., memory management, storage device control, power management, etc.), and may communicate with various hardware or software components to provide an operating environment for other software components. The processor may be an integrated circuit chip having signal processing capabilities. The processor may be a general-purpose processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like. The various methods, steps, and logic flow diagrams disclosed in this embodiment may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Since the instructions stored in the storage medium may execute the steps in any database deployment method embodiment provided in the embodiments of the present invention, beneficial effects that can be achieved by any database deployment method provided in the embodiments of the present invention may be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A method for deploying a database is applied to a management unit of a database management system, the database management system further comprises an internal virtualization platform and an external virtualization platform, and the method for deploying the database comprises the following steps:
determining a database deployment mode and virtual machine configuration information according to a database deployment instruction, wherein the database deployment mode comprises an internal resource mode, an external resource mode and an instance mode;
when the database deployment mode is an internal resource mode, sending the virtual machine configuration information to the internal virtualization platform, so that the internal virtualization platform constructs a virtual machine according to the virtual machine configuration information; when the database deployment mode is an external resource mode, sending the virtual machine configuration information to the external virtualization platform, so that the external virtualization platform constructs a virtual machine according to the virtual machine configuration information; when the database deployment mode is an instance mode, determining a corresponding constructed virtual machine from a pre-constructed virtual machine set according to the virtual machine configuration information;
and acquiring database configuration information, and enabling the constructed virtual machine to establish a target database according to the database configuration information.
2. The database deployment method according to claim 1, wherein the step of causing the built virtual machine to create a target database according to the database configuration information includes:
generating database configuration information according to the database medium information and the database attribute information;
and generating an installation script according to the database configuration information, and enabling the constructed virtual machine to run the installation script to create a target database.
3. The database deployment method according to claim 2, wherein the database management system further includes a proxy service unit, and the step of generating an installation script according to the database configuration information, and causing the built virtual machine to run the installation script to create a target database includes:
generating an installation script according to the database configuration information;
acquiring the installation state of the target database through the proxy service unit in the process of running the installation script by the constructed virtual machine;
and when the installation state of the target database is successful, receiving the information of successful installation returned by the proxy service unit.
4. The database deployment method according to claim 1, wherein the database management system further includes a file server, the internal virtualization platform is provided with a file storage unit, and before the step of determining the database deployment mode and the virtual machine configuration information according to the database deployment instruction, the method further includes:
acquiring file data of a plurality of database operating systems;
storing the file data of the database operating systems into the file server, and generating corresponding file data identification marks;
and recording the file data identification mark into a file storage unit.
5. The database deployment method according to claim 4, further comprising, before the step of determining the database deployment mode and the virtual machine configuration information according to the database deployment instruction:
acquiring a plurality of database media;
storing the plurality of database media into the file server, and generating corresponding database media identification marks;
and recording the database medium identification mark into the file storage unit.
6. The database deployment method according to claim 5, wherein the step of sending the virtual machine configuration information to the external virtualization platform when the database deployment mode is an external resource mode, so that the external virtualization platform constructs a virtual machine according to the virtual machine configuration information includes:
when the database deployment mode is an external resource mode, the virtual machine configuration information stored in the file server is imported into a virtual host of the external virtualization platform through a program interface, so that the virtual host builds a corresponding virtual machine.
7. The database deployment method according to claim 6, wherein after the step of importing the virtual machine configuration information stored in the file server into the virtual host of the external virtualization platform when the database deployment mode is an external resource mode, so that the virtual host builds a corresponding virtual machine, the method further comprises:
and adding a file storage unit into the virtual host machine as a temporary storage unit through the program interface so that the virtual machine acquires a target database medium from the temporary storage unit.
8. A database deployment apparatus, applied to a management unit of a database management system, the database management system further including an internal virtualization platform and an external virtualization platform, the database deployment apparatus comprising:
the deployment instruction determining module is used for determining a database deployment mode and virtual machine configuration information according to a database deployment instruction, wherein the database deployment mode comprises an internal resource mode, an external resource mode and an instance mode;
the virtual machine configuration module is used for sending the virtual machine configuration information to the internal virtualization platform when the database deployment mode is an internal resource mode, so that the internal virtualization platform constructs a virtual machine according to the virtual machine configuration information; when the database deployment mode is an external resource mode, sending the virtual machine configuration information to the external virtualization platform, so that the external virtualization platform constructs a virtual machine according to the virtual machine configuration information; when the database deployment mode is an instance mode, determining a corresponding constructed virtual machine from a pre-constructed virtual machine set according to the virtual machine system configuration information;
and the database creating module is used for sending the database medium information to the constructed virtual machine, so that the constructed virtual machine attaches the corresponding target database medium according to the database medium information to create a target database.
9. An electronic device comprising a storage medium and a processor, the storage medium storing a computer program, wherein the processor implements the steps of the database deployment method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the database deployment method of any one of claims 1 to 7.
CN202111132133.0A 2021-09-27 2021-09-27 Database deployment method and device, electronic equipment and storage medium Pending CN113590271A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111132133.0A CN113590271A (en) 2021-09-27 2021-09-27 Database deployment method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111132133.0A CN113590271A (en) 2021-09-27 2021-09-27 Database deployment method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113590271A true CN113590271A (en) 2021-11-02

Family

ID=78242317

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111132133.0A Pending CN113590271A (en) 2021-09-27 2021-09-27 Database deployment method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113590271A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116644058A (en) * 2023-06-01 2023-08-25 北京首都在线科技股份有限公司 Method for creating database based on relational database management system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106155759A (en) * 2015-03-26 2016-11-23 华为软件技术有限公司 virtual machine batch creation method and device
CN107391665A (en) * 2017-07-20 2017-11-24 郑州云海信息技术有限公司 The creation method and device of a kind of database instance
CN108572860A (en) * 2018-04-19 2018-09-25 国云科技股份有限公司 A kind of cloud platform application cluster automatic deployment method
CN109814882A (en) * 2018-12-13 2019-05-28 国网信通亿力科技有限责任公司 A kind of virtual machine quick deployment method of customizable
CN109840094A (en) * 2017-11-24 2019-06-04 腾讯科技(深圳)有限公司 A kind of dispositions method of database, device and storage equipment
CN110177148A (en) * 2019-05-30 2019-08-27 上海通联金融科技发展有限公司 A kind of prosperous cloud service platform of IaaS
CN112199157A (en) * 2020-10-16 2021-01-08 深圳无域科技技术有限公司 Cloud environment management method
CN112256289A (en) * 2020-10-27 2021-01-22 北京月新时代科技股份有限公司 Automatic deployment method, device and equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106155759A (en) * 2015-03-26 2016-11-23 华为软件技术有限公司 virtual machine batch creation method and device
CN107391665A (en) * 2017-07-20 2017-11-24 郑州云海信息技术有限公司 The creation method and device of a kind of database instance
CN109840094A (en) * 2017-11-24 2019-06-04 腾讯科技(深圳)有限公司 A kind of dispositions method of database, device and storage equipment
CN108572860A (en) * 2018-04-19 2018-09-25 国云科技股份有限公司 A kind of cloud platform application cluster automatic deployment method
CN109814882A (en) * 2018-12-13 2019-05-28 国网信通亿力科技有限责任公司 A kind of virtual machine quick deployment method of customizable
CN110177148A (en) * 2019-05-30 2019-08-27 上海通联金融科技发展有限公司 A kind of prosperous cloud service platform of IaaS
CN112199157A (en) * 2020-10-16 2021-01-08 深圳无域科技技术有限公司 Cloud environment management method
CN112256289A (en) * 2020-10-27 2021-01-22 北京月新时代科技股份有限公司 Automatic deployment method, device and equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116644058A (en) * 2023-06-01 2023-08-25 北京首都在线科技股份有限公司 Method for creating database based on relational database management system

Similar Documents

Publication Publication Date Title
US10002054B2 (en) Method and system for performing automatic system recovery
EP2973147B1 (en) Policy-based secure web boot
US20150074659A1 (en) Methods and Apparatus to Perform Web-Based Installations and/or Upgrade Architectures for Enterprise Software
EP2328088A1 (en) Home network system, gateway device, and firmware update method
CN110096424B (en) Test processing method and device, electronic equipment and storage medium
US20120198438A1 (en) Systems, methods, and apparatus to deploy software
US8332490B2 (en) Method, apparatus and program product for provisioning a computer system
WO2011153751A1 (en) Software upgrading method and apparatus
CN110908753B (en) Intelligent fusion cloud desktop server, client and system
CN107391193A (en) A kind of client, the system and method for configuration server
CN106547645B (en) Method for automatically restoring image file and server system
CN112162770B (en) Firmware version upgrading method and device for realizing integrity verification based on block chain
CN112256294A (en) Deployment method, cloud platform, system and storage medium of terminal application
US20060129788A1 (en) System and method for initially configuring and booting a device using a device identifier
CN113590271A (en) Database deployment method and device, electronic equipment and storage medium
CN109992295B (en) Version management method and server
CN114115917A (en) Operating system installation method and device
CN114021141A (en) Electronic equipment, trusted application calling method, device, equipment and medium
WO2016029774A1 (en) Virtualization based application storage method and execution method, device and system
EP4087206A1 (en) Internet-of-things device registration method and apparatus, device and storage medium
JPH11143730A (en) Method for testing computer system device
CN110737444A (en) Remote self-adaptive dynamic deployment method and system for operating system based on firmware
US20230289193A1 (en) Systems and methods for deploying a distributed containers-as-a-service platform architecture for telecommunications applications
CN116112412A (en) Virtual network card binding redundancy function test method, system, device and medium
US11425203B2 (en) Commissioning a virtualized network function

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20211102