CN113434156A - Automatic database deployment method and device, storage medium and electronic device - Google Patents

Automatic database deployment method and device, storage medium and electronic device Download PDF

Info

Publication number
CN113434156A
CN113434156A CN202110725075.6A CN202110725075A CN113434156A CN 113434156 A CN113434156 A CN 113434156A CN 202110725075 A CN202110725075 A CN 202110725075A CN 113434156 A CN113434156 A CN 113434156A
Authority
CN
China
Prior art keywords
deployment
target
database
default
parameter
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
CN202110725075.6A
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.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home 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 Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202110725075.6A priority Critical patent/CN113434156A/en
Publication of CN113434156A publication Critical patent/CN113434156A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • 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/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a method and a device for automatically deploying a database, a storage medium and an electronic device, wherein a deployment file of a target database is obtained, wherein the deployment file comprises an installation package corresponding to an operating system to be deployed by the target database; acquiring target deployment parameters related to deployment operation of a target database; generating a database deployment instruction by using the target deployment parameter; and automatically executing the deployment operation of the target database in the operating system according to the deployment file and the database deployment instruction. The invention effectively solves the technical problem of low deployment efficiency caused by manual deployment of the database in the prior art.

Description

Automatic database deployment method and device, storage medium and electronic device
Technical Field
The invention relates to the field of database deployment, in particular to a method and a device for automatically deploying a database, a storage medium and an electronic device.
Background
At present, many internet enterprise operating systems and databases all use open source solutions, so that functions to be compiled can be conveniently selected according to the needs of enterprises, for example, MySQL is used as one of the most used open source databases at present, and is suitable for wide application program deployment. However, the source code compiling complexity of MySQL is high, and configuration parameters also need to be adjusted for different system basic resources, and the MySQL database can be deployed on an operating system only by a manual deployment mode in general, so that in the deployment process, heavy operations such as compiling, installing, parameter modification and the like of the database need to consume a large amount of labor time, and the deployment efficiency of the database is low.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a method and a device for automatically deploying a database, a storage medium and an electronic device, which at least solve the technical problem of low deployment efficiency caused by manually deploying the database at present.
According to an aspect of an embodiment of the present invention, there is provided a method for automatically deploying a database, the method including: acquiring a deployment file of a target database, wherein the deployment file comprises an installation package corresponding to an operating system to be deployed by the target database; acquiring target deployment parameters related to deployment operation of a target database; generating a database deployment instruction by using the target deployment parameter; and automatically executing the deployment operation of the target database in the operating system according to the deployment file and the database deployment instruction.
Optionally, the obtaining target deployment parameters related to the deployment operation of the target database includes: acquiring default deployment parameters of a target database; under the condition that the default deployment parameters are in an editing state, acquiring a modification instruction for modifying the default deployment parameters; modifying the default deployment parameter into a target deployment parameter according to the modification instruction; and in the case that the default deployment parameter is not in an editing state, setting the default deployment parameter as a target deployment parameter.
Optionally, the modifying the default deployment parameter to the target deployment parameter according to the modification instruction includes at least one of: under the condition that the default deployment parameters comprise a default installation path, displaying first modification prompt information for modifying the installation path; acquiring an input target installation path according to the first modification prompt information; prompting that the default installation path is to be replaced by a target installation path; displaying second modification prompt information for modifying the monitoring port number under the condition that the default deployment parameter comprises the default monitoring port number; acquiring an input target monitoring port number according to the second modification prompt information; prompting that the default monitoring port number is replaced by the target monitoring port number; displaying third modification prompt information for modifying the access password under the condition that the default deployment parameters include the default access password; acquiring an input target access password according to the third modification prompt message; prompting that the default access password is replaced with the target access password.
Optionally, the obtaining the deployment file of the target database includes: and acquiring an installation package corresponding to the version of the operating system to be deployed in the target database through a preset file transfer protocol, wherein the installation package comprises a dependent package matched with the version of the operating system.
Optionally, after the deployment operation of the target database is automatically performed in the operating system, the method further includes: and deleting the cleaning installation package.
Optionally, when the deployment operation of the target database is automatically performed in the operating system, the method further includes: acquiring an operation result of deployment operation in real time; and generating an execution instruction for instructing to re-execute the target deployment step in the case that the operation result indicates the target deployment step with the abnormal deployment.
According to another aspect of the embodiments of the present invention, the present invention further provides an automatic database deployment apparatus, including: the system comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring a deployment file of a target database, and the deployment file comprises an installation package corresponding to an operating system to be deployed of the target database; the second acquisition unit is used for acquiring target deployment parameters related to the deployment operation of the target database; the generated original data is used for generating a database deployment instruction by using the target deployment parameter; and the execution unit is used for automatically executing the deployment operation of the target database in the operating system according to the deployment file and the database deployment instruction.
According to another aspect of the embodiments of the present invention, there is provided a storage medium, in which a computer program is stored, where the computer program is configured to execute the above automatic database deployment method when running.
According to another aspect of the embodiments of the present invention, the present invention further provides an electronic apparatus, including a memory and a processor, where the memory stores a computer program, and the processor is configured to execute the computer program to perform the above-mentioned database automatic deployment method.
In the embodiment of the invention, a deployment file of a target database is obtained, wherein the deployment file comprises an installation package corresponding to an operating system to be deployed by the target database; and finally, automatically executing the deployment operation of the target database in the operating system according to the deployment file and the database deployment instruction. In the above embodiment, the deployment file of the target database and the target deployment parameter related to the deployment operation of the target database are obtained, and the database deployment instruction is generated, so that the deployment operation of the target database is automatically executed in the operating system, the deployment efficiency is improved, the labor cost is saved, and the technical problem of low deployment efficiency caused by manual deployment of the database is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a block diagram of a hardware configuration of a computer terminal of a database automatic deployment method according to an embodiment of the present invention;
FIG. 2 is a flow chart of an alternative database automatic deployment method according to an embodiment of the present invention
FIG. 3 is a schematic diagram of an alternative database automatic deployment method according to an embodiment of the invention;
fig. 4 is a schematic structural diagram of an alternative database automation device according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or 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.
The method embodiments provided in the embodiments of the present application may be executed in a computer terminal or a similar computing device. Taking the operation on a computer terminal as an example, fig. 1 is a hardware configuration block diagram of the computer terminal of the area cleaning method according to the embodiment of the present invention. As shown in fig. 1, the computer terminal may include one or more processors 102 (only one is shown in fig. 1), wherein the processors 102 may include, but are not limited to, a Microprocessor (MPU) or a Programmable Logic Device (PLD), and a memory 104 for storing data, and in an exemplary embodiment, the computer terminal may further include a transmission device 106 for communication function and an input/output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the computer terminal. For example, the computer terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration with equivalent functionality to that shown in FIG. 1 or with more functionality than that shown in FIG. 1.
The memory 104 can be used for storing computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the area sweeping method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, so as to implement the above-mentioned method. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to a computer terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal. In one embodiment, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In order to solve the foregoing problem, an aspect of the embodiments of the present invention provides a method for automatically deploying a database, and optionally, as an optional implementation manner, as shown in fig. 2, the method for automatically deploying a database includes:
s202, acquiring a deployment file of the target database, wherein the deployment file comprises an installation package corresponding to an operating system to be deployed by the target database;
s204, acquiring target deployment parameters related to the deployment operation of the target database;
s206, generating a database deployment instruction by using the target deployment parameters;
and S208, automatically executing the deployment operation of the target database in the operating system according to the deployment file and the database deployment instruction.
Optionally, in this embodiment, the method for automatically deploying the database may be applied to, but not limited to, a process of deploying the target database on the operating system, and may also be applied to various scenarios such as development, testing, and online production of the target database. The target database may include, but is not limited to: MySQL database, Oracle database, Sybase database, etc.
Optionally, in the above embodiment, the obtaining of the deployment file and the target deployment parameter of the target database may be, but is not limited to, through a preset file transfer protocol. The preset file transfer protocol may include, but is not limited to: FTP protocol, SFTP protocol, TFTP protocol, etc.; the target deployment parameters herein include, but are not limited to, at least one of: the method comprises the steps of target database installation path, user name, port number, directory authority, database access password, database memory size and the like.
It should be noted that the installation package of the operating system to be deployed with the target database may include, but is not limited to, a dependency package (e.g., a patch) applied when the operating system installs the target database, and through the dependency package, the source code file of the target database may be compiled, so as to smoothly install the target database.
Further, the source code file of the target database refers to a file formed by codes stored in advance on an official open source website, and the same open source of the target database comprises source code files of different versions. Through compiling the source code file, the target database can be deployed or installed on a target operating system. When a source code file (such as a source code of a MySQL database) is obtained, a version required by the user can be prepared in advance, a latest stable version can be automatically downloaded from an official website, and the downloaded and stored directory is the default directory where the current tool is located. And generating a corresponding database deployment instruction according to the target deployment parameter, wherein the target deployment parameter and the database deployment instruction correspond to each other. For example, in the case that the target deployment parameter is a user name, the corresponding database deployment instruction may be an instruction to create the user name; under the condition that the target deployment parameter is the directory authority, the corresponding database deployment instruction can be a design directory authority instruction; when the target deployment parameter is a port number, the corresponding database deployment instruction can be a port number instruction monitored by the configuration database; in the case that the target deployment parameter is an access password, the corresponding database deployment instruction may be to create the access password. The above is an example, and this is not limited in this embodiment.
In step S208, before the deployment operation of the target database is automatically performed in the operating system, the method further includes:
step S208-2, automatically generating an execution step according to the deployment file;
and S208-4, the database deployment instruction performs deployment operation of the target database according to the execution step, and records the execution process and the execution result.
Through the steps, the database deployment instruction can be automatically deployed according to the execution steps generated in advance, so that the step process is orderly carried out, and the deployment efficiency is improved. Furthermore, in the process of executing each sub-step, the executing process of the sub-step is recorded, so that the progress of the whole executing process is conveniently controlled, and meanwhile, abnormal conditions in the executing process can be fed back, so that whether the automatic deployment operation of the database can be successfully completed or not is prompted to the manual work. Therefore, in the whole automatic deployment process, the execution process is monitored only by manpower, the workload of the manpower is reduced, and the labor cost is reduced. In this embodiment, the target database deployment file and the database deployment instruction may be, but are not limited to, utilized to perform corresponding database deployment operations in the operating system.
By adopting the technical scheme, the database does not need to be manually deployed on the operating system by people in the database deployment process, and the problems of overlong deployment time and overhigh labor cost caused by the fact that instructions need to be modified, manual compiling and installing and the like need to be remembered in the manual deployment process are solved. And then reach the technical effect who improves deployment efficiency, practices thrift the human cost.
In addition, the technical scheme is not only suitable for the deployment process of the database on the operating system, but also suitable for the scenes of development, test, on-line production and the like of the database on other platforms, provides a powerful reference for other operation processes of the database, and expands the application range of the automatic database deployment method.
In an alternative embodiment, in order to obtain the target deployment parameters related to the deployment operation of the target database, the following steps may be performed:
acquiring default deployment parameters of a target database;
under the condition that the default deployment parameters are in an editing state, acquiring a modification instruction for modifying the default deployment parameters; modifying the default deployment parameter into a target deployment parameter according to the modification instruction;
and in the case that the default deployment parameter is not in an editing state, setting the default deployment parameter as a target deployment parameter.
It can be understood that, in this embodiment, for the same database, when the same database is deployed on different operating systems, different deployment parameters may need to be configured, but for operating systems of the same type, the same system resource often has universality to a deployment method and the deployment parameters, so in the automatic deployment process of the database, the deployment parameters are usually configured by default, and the default deployment parameters are modified into target deployment parameters according to a preset modification manner, and it can be specifically determined whether the default deployment parameters need to be modified according to a state where the default deployment parameters are located, for example: when the default deployment parameter is in the editable state, the user can input the target deployment parameter meeting the requirement according to the modification instruction, and when the default deployment parameter is in the non-editable state, the default deployment parameter is directly used as the target deployment parameter.
That is to say, for different types of operating systems, the default deployment parameters can be modified according to the modification instruction directly by determining whether the acquired default deployment parameters are in an editable state, so as to obtain the target deployment parameters meeting the user requirements.
For the operating systems of the same type, the default deployment parameters are directly used as target deployment parameters, and then a database deployment instruction is generated, so that the configuration time of the deployment parameters is saved, and the rapidness of automatic deployment is improved.
As an optional embodiment, modifying the default deployment parameter to the target deployment parameter according to the modification instruction includes at least one of:
under the condition that the default deployment parameters comprise a default installation path, displaying first modification prompt information for modifying the installation path; acquiring an input target installation path according to the first modification prompt information; prompting that the default installation path is to be replaced by a target installation path;
displaying second modification prompt information for modifying the monitoring port number under the condition that the default deployment parameter comprises the default monitoring port number; acquiring an input target monitoring port number according to the second modification prompt information; prompting that the default monitoring port number is replaced by the target monitoring port number;
displaying third modification prompt information for modifying the access password under the condition that the default deployment parameters include the default access password; acquiring an input target access password according to the third modification prompt message; prompting that the default access password is replaced with the target access password.
As described above, the types of deployment parameters include, but are not limited to, database installation path, user name, port number, directory permissions, database access password, database memory size, and the like. As can be seen, the default deployment parameters may include information under any deployment parameter type.
For example, under the condition that the default deployment parameters are in an editable state, if the default deployment parameters include the default installation path/data/mysql: printing and outputting first modification prompt information/data/mysql for modifying the installation path on a user interface: when the modification prompt information is manually checked, the default installation path/data/mysql is as follows: the cursor behind the colon in (1) indicates a specific path of the data, such as: and/data 2/mysql/enter confirmation, the user interface prints and outputs the input route again, namely, displaying/data 2/mysql/, reminding the user to confirm the input target installation route/data 2/mysql/, and ensuring the effectiveness of the modified target installation route.
It should be noted that the target installation path confirmed by the user cannot be changed by going backwards directly, and if the target installation path is changed, the current deployment operation step needs to be exited forcibly, and the change operation is performed by re-executing the deployment operation.
And when the default deployment parameter is in an editable state, if the default deployment parameter comprises a default monitoring port number, displaying second modification prompt information for modifying the monitoring port number on the user interface, inputting a target monitoring port number on the interface according to the second modification prompt information, and prompting a user to confirm the input target monitoring port number on the interface.
For example, when the default listening port number is 6033, second modification prompt information 6033 that modifies the default listening port number is printed out on the user interface: manually printing out 6033: if 13306, enter and confirm, print out 13306 target monitoring port number on the user interface, and remind the user to confirm the validity of the target monitoring port number.
It should be noted that, in order to prevent the system error report caused by the port number due to the input error, the range of the monitored port number needs to be limited, for example, when the valid range of the monitored port number is set to be greater than 3000 and smaller than 60000, the user interface will prompt after the port number outside the range is input: prompt information of 'port number out of range, please re-input'.
Similarly, the monitoring port number confirmed by the user cannot be changed by backing directly, if the monitoring port number is changed, the current deployment operation step needs to be forced to exit, and the change operation is performed by re-executing the deployment operation, which is not described herein again.
And when the default deployment parameter is in an editable state, if the default deployment parameter comprises the default access password, displaying third modification prompt information for modifying the access password on the user interface, inputting the target access password on the interface according to the third modification prompt information, and simultaneously prompting the user to confirm the input target access password on the interface, wherein the change of the confirmed target access password is the same as the change method of the target installation path and the target monitoring port number, and the description is omitted here.
For example, when the default access password is ssl001, third modification prompt information ssl001 for modifying the default access password is printed out on the user interface: manually printing out ssl 001: after the colon in the target password, for example, ssl86549, enter the target after completion and confirm the carriage return, and the user interface prints out the target ssl86549, and reminds the user to confirm the validity of the target access password.
It should be noted that, because the access password is important, in addition to the way in which the user sets the target access password according to the third modification prompt information, the password generated by the random rule may be adopted, that is, the obtaining way of the target access password is not limited, so as to avoid a serious data security accident caused by the password being too simple to be decrypted, and improve the data security.
That is to say, in the above embodiment, different modification prompt messages of deployment parameters of corresponding types are displayed according to different types of default deployment parameters included in the default deployment parameters, and then target deployment parameters of corresponding types are input according to the obtained modification prompt messages. Therefore, different modification instructions are generated through the type of the default deployment parameter, so that the flexibility of parameter configuration in the automatic deployment process of the database is improved by obtaining the corresponding target deployment parameter, and the working steps of manually modifying the deployment parameter are simplified. In addition, after the target deployment parameters are input, prompts for input information are set, so that a user can conveniently confirm the correctness of the input information, and the reliability of the target deployment parameters is improved.
As an alternative embodiment, in order to obtain the deployment file with the target database, the following method may be implemented: and acquiring an installation package corresponding to the version of the operating system of the target database through a preset file transfer protocol, wherein the installation package comprises a dependent package matched with the version of the operating system.
It is understood that, in the above embodiments, the manner of obtaining the database source code includes at least one of the following: the version required by the user can be prepared in advance according to the operating system; the latest stable version can also be automatically downloaded from an official website, and the downloaded and stored directory is the default directory where the current deployment is located. That is, the version of the operating system can be automatically obtained through the embodiment, and the operating system is automatically downloaded and installed, so that manual downloading and installation are avoided, downloading and installation time is saved, and the efficiency of deployment operation is improved. Correspondingly, many dependency packages are needed for installing the database source codes on the operating system, and the security of the operating system can be effectively improved by preferentially downloading the database source codes and the dependency packages of the stable version in the automatic downloading process, so that the reliability of automatic deployment operation of the database is improved.
It should be noted that the installation package includes, but is not limited to, a dependency package matched with the version of the operating system, and the dependency package (e.g., a patch) can be used to repair the installation process of the database on the operating system, so that the compiling and installation process of the database is ensured to be performed smoothly.
In an optional embodiment, after the deployment operation of the target database is automatically performed in the operating system, the method further includes: and deleting the cleaning installation package.
In this embodiment, after the deployment operation of the target database is automatically performed in the operating system according to the deployment file and the database deployment instruction by the automatic deployment of the database, an installation package used in the database installation process needs to be processed, which can be understood as that the installation package may be permanently stored on the server or temporarily cached. Similarly, the database source code files downloaded from the official source opening website are also deleted and cleaned, so that the storage space of the operating system is saved, and the operating efficiency of the operating system is improved.
In an optional embodiment, when the deployment operation of the target database is automatically performed in the operating system, the method further includes: acquiring an operation result of deployment operation in real time; and generating an execution instruction for instructing to re-execute the target deployment step in the case that the operation result indicates the target deployment step with the abnormal deployment.
It can be understood that, in order to avoid that the whole deployment process is abandoned due to the abnormality of some steps in the automatic deployment process of the target database, the invention performs real-time monitoring in the automatic deployment operation process of the target database, and records and displays the execution process and the operation result on the display interface, when the real-time monitoring result judges that the abnormality occurs in the execution process of the automatic deployment operation of the target database, the corresponding abnormal execution step is determined, the execution instruction for instructing the target deployment step to be re-executed is generated, and then the step corresponding to the abnormal execution step is re-executed in the operating system. By acquiring the operation result in real time in the embodiment, the step of abnormal deployment can be found in time, and the problem of low deployment efficiency caused by overlong deployment time due to restarting of executing all target steps is solved.
It should be noted that, in the foregoing embodiments, the target deployment parameter includes at least one of the following: the method comprises the steps of deploying the database, deploying the file, monitoring port numbers, database access passwords and database memory size.
It is to be understood that the above-described embodiments are only a few, but not all, embodiments of the present invention. In order to better understand the above automatic database deployment method, the following describes the above process with reference to a complete embodiment, but is not intended to limit the technical solution of the embodiment of the present invention, and specifically:
fig. 3 is a schematic diagram of an automatic database deployment method according to an embodiment of the present invention, wherein a target database is assumed to be a MySQL database, an operating system is Linux, and the specific process is as follows:
a curing configuration M1-1, configured to acquire, through a preset file transfer protocol, a source code and an operating system version of the MySQL database, and install a required dependency package (equivalent to the deployment file of the acquired target database);
query configuration M1-2, configured to configure deployment parameters related to the deployment operation of the database (corresponding to the above-mentioned target deployment parameters related to the deployment operation of the target database);
a database deployment instruction M2 is generated, which is used to generate a corresponding MySQL database deployment instruction (equivalent to the database deployment instruction generated by using the target deployment parameters) according to the deployment parameters;
executing deployment M3, and performing corresponding MySQL deployment operation in the Linux operating system by using the MySQL database source code and the MySQL database deployment instruction (which is equivalent to the above-mentioned deployment operation for automatically executing the target database in the operating system);
the deployment process monitoring M4 is configured to output a command result set to a screen, and is capable of visually monitoring a deployment process (which is equivalent to the above-described operation result of the real-time acquisition deployment operation).
When the M1-1 acquires the source code of the MySQL database, the required version can be prepared in advance, the tool can also automatically download the latest stable book from the official website, and the downloaded and stored directory is the default directory where the current tool is located.
The source code file may be stored in the server permanently or may be cached temporarily, and when the deployment M3 completes the corresponding MySQL database deployment operation, the file may be deleted.
The installation of the source code of the MySQL database on the Linux operating system needs to solve a plurality of dependency packages, the invention can automatically acquire the version of the operating system, and different system versions are installed with different dependencies; the operation of the embodiment of the invention is carried out according to the description of the official guide document, and the operation is safe and credible.
The deployment parameters of the query configuration M1-2 configuration include, but are not limited to, a database deployment location, a data file location, a port number, a database access password, and a database memory size. In order to improve the automatic deployment rapidity, the parameters are subjected to default configuration, and if partial default configuration is not satisfactory, the configuration information of the parameters can be input according to prompts.
It should be noted that, once the configuration information is confirmed, the change cannot be performed backward, and if the change is desired, the current instruction M2 can be forced to exit, and the change operation is performed by re-executing the configuration.
The generating deployment instruction M2 may generate a corresponding MySQL database deployment instruction according to the deployment parameters configured by the query configuration M1-2. It can be understood that the deployment parameter and the MySQL database deployment instruction correspond to each other, for example, if the deployment parameter is a database access password, the corresponding instruction is to create a database access password; if the deployment parameter is the port number, the deployment parameter is the port number monitored by the configuration database correspondingly; if the deployment parameter is the position of the data file, the deployment parameter is correspondingly the storage position of the data file of the configuration database; by analogy, this is not further enumerated here.
According to the method, the curing configuration and the inquiry configuration in the MySQL database automatic deployment tool are utilized to obtain the configuration parameters required by the database deployment, the corresponding MySQL database deployment instruction is generated according to the configuration parameters, then the source code of the MySQL database and the MySQL database deployment instruction can be utilized to perform corresponding MySQL database deployment in the Linux operating system, the MySQL database is not required to be manually deployed on the Linux operating system in the database deployment process, the deployment instruction can be automatically executed according to the steps generated in advance, and the database installation is only required to be waited for completion, so that the efficiency of deploying the MySQL database in the Linux operating system is improved.
In order to avoid unnecessary waste of the storage space of the Linux system caused by long-term occupation of the storage space after the source code file of the MySQL database is used, the downloaded MySQL source code file is deleted and cleaned after the MySQL database is deployed.
The embodiment of the invention describes a specific MySQL database automatic deployment tool, so as to avoid abandoning the whole deployment process before the exception of some sub-steps in the MySQL database deployment process. The MySQL database automatic deployment tool disclosed by the embodiment of the invention further comprises a deployment process monitoring M4, which is used for monitoring the execution process of the MySQL database deployment operation in real time, displaying the execution process and the result record on a screen, and judging whether the execution process of the MySQL database deployment operation is abnormal or not according to the real-time monitoring result. If yes, determining the corresponding abnormal execution step, generating a corresponding reconfiguration instruction for the user to input again, regenerating the execution instruction, and re-executing the step corresponding to the abnormal execution step in the Linux operating system.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Optionally, in this embodiment, an automatic database deployment device is further provided, where the device is used to implement the foregoing embodiment, and details of the description already made are omitted. As used below, the term "unit" may be a combination of software and/or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementations in hardware or a combination of software and hardware are also possible and contemplated.
According to another aspect of the present application, there is also provided an automatic database deployment apparatus, as shown in fig. 4, an optional structural block diagram of the automatic database deployment apparatus according to an embodiment of the present invention, the apparatus includes:
a first obtaining unit 402, configured to obtain a deployment file of a target database, where the deployment file includes an installation package corresponding to an operating system to be deployed by the target database;
a second obtaining unit 404, configured to obtain target deployment parameters related to the deployment of the target database;
a generating unit 406, configured to generate a database deployment instruction by using the target deployment parameter;
the execution unit 408 is configured to automatically execute the deployment operation of the target database in the operating system according to the deployment file and the database deployment instruction.
Through the units, the deployment file of the target database and the target deployment parameters related to the deployment operation of the target database are obtained, and then the target deployment parameters are used for generating a database deployment instruction. And then automatically executing the deployment operation of the target database in the operating system according to the deployment file and the database deployment instruction. That is to say, a deployment file related to the deployment operation of the target database is obtained through a preset file transfer protocol, a database deployment instruction is generated according to the obtained target deployment parameter, and then the deployment operation of the target database is automatically performed on the operating system according to the deployment file and the database deployment instruction. By adopting the technical scheme, the problems of overlong deployment time and overhigh labor cost caused by the fact that instructions need to be modified, manual compiling and installing needs to be remembered in the manual deployment process are solved. And then reach the technical effect who improves deployment efficiency, practices thrift the human cost.
In an optional embodiment, the second obtaining unit further includes:
the first acquisition module is used for acquiring default deployment parameters of the target database;
the first modification module is used for acquiring a modification instruction for modifying the default deployment parameter under the condition that the default deployment parameter is in an editing state; modifying the default deployment parameter into a target deployment parameter according to the modification instruction;
and the setting module is used for setting the default deployment parameter as the target deployment parameter under the condition that the default deployment parameter is not in an editing state.
As an optional implementation, the first modification module further includes:
the first modification submodule is used for displaying first modification prompt information for modifying the installation path under the condition that the default deployment parameters comprise the default installation path; acquiring an input target installation path according to the first modification prompt information; prompting that the default installation path is to be replaced by a target installation path;
the second modification submodule is used for displaying second modification prompt information for modifying the monitoring port number under the condition that the default deployment parameter comprises the default monitoring port number; acquiring an input target monitoring port number according to the second modification prompt information; prompting that the default monitoring port number is replaced by the target monitoring port number;
the third modification submodule is used for displaying third modification prompt information for modifying the access password under the condition that the default deployment parameter comprises the default access password; acquiring an input target access password according to the third modification prompt message; prompting that the default access password is replaced with the target access password.
As another optional implementation, the first obtaining unit further includes:
and the second acquisition module is used for acquiring an installation package corresponding to the version of the operating system to be deployed in the target database through a preset file transfer protocol, wherein the installation package comprises a source code dependent package matched with the version of the operating system.
Optionally, after the executing unit, the method further includes:
and the cleaning unit is used for deleting the cleaning installation package.
Optionally, the execution unit further includes:
the third acquisition module is used for acquiring the operation result of the deployment operation in real time;
and the generating module is used for generating an execution instruction for indicating the target deployment step to be re-executed under the condition that the operation result is only the target deployment step with abnormal deployment.
Optionally, the target deployment parameter includes at least one of:
the method comprises the steps of deploying the database, deploying the file, monitoring port numbers, database access passwords and database memory size.
Embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above-mentioned method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, acquiring a deployment file of the target database, wherein the deployment file comprises an installation package corresponding to an operating system to be deployed by the target database;
s2, acquiring target deployment parameters related to the deployment operation of the target database;
s3, generating a database deployment instruction by using the target deployment parameters;
and S4, automatically executing the deployment operation of the target database in the operating system according to the deployment file and the database deployment instruction.
In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
An embodiment of the present invention further provides an electronic apparatus, which includes a memory and a processor, where the memory stores a computer program, and the processor is configured to execute the computer program to perform the steps in any of the method embodiments.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, acquiring a deployment file of the target database, wherein the deployment file comprises an installation package corresponding to an operating system to be deployed by the target database;
s2, acquiring target deployment parameters related to the deployment operation of the target database;
s3, generating a database deployment instruction by using the target deployment parameters;
and S4, automatically executing the deployment operation of the target database in the operating system according to the deployment file and the database deployment instruction.
In an exemplary embodiment, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary embodiments, and details are not described in this embodiment.
It will be apparent to those skilled in the art that the various modules or steps of the invention described above may be implemented using a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and they may be implemented using program code executable by the computing devices, such that they may be stored in a memory device and executed by the computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into various integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. An automatic database deployment method is characterized by comprising the following steps:
acquiring a deployment file of a target database, wherein the deployment file comprises an installation package corresponding to an operating system to be deployed by the target database;
acquiring target deployment parameters related to the deployment operation of the target database;
generating a database deployment instruction by using the target deployment parameter;
and automatically executing the deployment operation of the target database in the operating system according to the deployment file and the database deployment instruction.
2. The method of claim 1, wherein obtaining target deployment parameters related to deployment operations of the target database comprises:
acquiring default deployment parameters of the target database;
under the condition that the default deployment parameter is in an editing state, acquiring a modification instruction for modifying the default deployment parameter; modifying the default deployment parameter into the target deployment parameter according to the modification instruction;
setting the default deployment parameter as the target deployment parameter if the default deployment parameter is not in an edited state.
3. The method of claim 2, wherein modifying the default deployment parameter to the target deployment parameter according to the modification instruction comprises at least one of:
displaying first modification prompt information for modifying the installation path under the condition that the default deployment parameters comprise a default installation path; acquiring an input target installation path according to the first modification prompt information; prompting that the default installation path is to be replaced by the target installation path;
displaying second modification prompt information for modifying the monitoring port number under the condition that the default deployment parameter comprises a default monitoring port number; acquiring an input target monitoring port number according to the second modification prompt information; prompting that the default monitoring port number is replaced by the target monitoring port number;
displaying third modification prompt information for modifying the access password under the condition that the default deployment parameters comprise the default access password; acquiring an input target access password according to the third modification prompt message; prompting that the default access password is replaced with the target access password.
4. The method of claim 1, wherein obtaining the deployment file for the target database comprises:
and acquiring the installation package corresponding to the version of the operating system to be deployed in the target database through a preset file transfer protocol, wherein the installation package comprises a dependent package matched with the version of the operating system.
5. The method of claim 1, after automatically performing the deployment operation of the target database in the operating system, further comprising:
and deleting and cleaning the installation package.
6. The method of claim 1, wherein when automatically executing the deployment operation of the target database in the operating system, further comprising:
acquiring an operation result of the deployment operation in real time;
and generating an execution instruction for instructing to re-execute the target deployment step when the operation result indicates the target deployment step with abnormal deployment.
7. The method of any one of claims 1 to 6, wherein the target deployment parameters include at least one of:
the method comprises the steps of deploying the database, deploying the file, monitoring port numbers, database access passwords and database memory size.
8. An automatic database deployment device, comprising:
the system comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring a deployment file of a target database, and the deployment file comprises an installation package corresponding to an operating system to be deployed of the target database;
a second obtaining unit, configured to obtain a target deployment parameter related to a deployment operation of the target database;
the generating unit is used for generating a database deployment instruction by using the target deployment parameter;
and the execution unit is used for automatically executing the deployment operation of the target database in the operating system according to the deployment file and the database deployment instruction.
9. A computer-readable storage medium, comprising a stored program, wherein the program when executed performs the method of any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 7 by means of the computer program.
CN202110725075.6A 2021-06-29 2021-06-29 Automatic database deployment method and device, storage medium and electronic device Pending CN113434156A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110725075.6A CN113434156A (en) 2021-06-29 2021-06-29 Automatic database deployment method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110725075.6A CN113434156A (en) 2021-06-29 2021-06-29 Automatic database deployment method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN113434156A true CN113434156A (en) 2021-09-24

Family

ID=77757575

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110725075.6A Pending CN113434156A (en) 2021-06-29 2021-06-29 Automatic database deployment method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN113434156A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106341486A (en) * 2016-09-29 2017-01-18 郑州云海信息技术有限公司 Oracle database automatic deployment tool and method
CN109241035A (en) * 2018-08-28 2019-01-18 福建南威软件有限公司 A kind of custom script realizes the automatic deployment method of database
CN110908674A (en) * 2019-11-14 2020-03-24 武汉虹旭信息技术有限责任公司 Automatic deployment method and device of application program
CN111338656A (en) * 2020-02-25 2020-06-26 平安科技(深圳)有限公司 Method and device for installing software package to target host and computer equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106341486A (en) * 2016-09-29 2017-01-18 郑州云海信息技术有限公司 Oracle database automatic deployment tool and method
CN109241035A (en) * 2018-08-28 2019-01-18 福建南威软件有限公司 A kind of custom script realizes the automatic deployment method of database
CN110908674A (en) * 2019-11-14 2020-03-24 武汉虹旭信息技术有限责任公司 Automatic deployment method and device of application program
CN111338656A (en) * 2020-02-25 2020-06-26 平安科技(深圳)有限公司 Method and device for installing software package to target host and computer equipment

Similar Documents

Publication Publication Date Title
CN107450941B (en) Automatic packaging method, device, storage medium and computer equipment
CA3131079A1 (en) Test case generation method and device, computer equipment and storage medium
CN105468395A (en) Updating method, device and system
CN105072398B (en) A kind of device updating method and device
CN106980565A (en) Escalation process monitoring method and device
CN105574369A (en) Method, device and system for re-signing application program
CN113064630B (en) Mobile terminal APP automatic packaging method, system, electronic equipment and storage medium
CN113312064A (en) Installation configuration method and device of physical machine and computer readable medium
CN105391763A (en) Method and server for reinforcing a plurality of apk files
CN111459812A (en) Interface test case generation method, electronic device and storage medium
CN109726104B (en) Test packet generation method of mobile terminal, test terminal and storage medium
CN114546588A (en) Task deployment method and device, storage medium and electronic device
CN111221546A (en) Map data and map updating method and device, terminal equipment and server
CN113434156A (en) Automatic database deployment method and device, storage medium and electronic device
CN111338644A (en) Task script deployment method and system
CN109582319B (en) Service code deployment method and device
CN113852621B (en) License information determining method and device based on Jenkins server and storage medium
CN111580853A (en) Universal generation method for multi-channel software installation package
CN110888669A (en) Method and system for creating template engineering on IDE
CN113434164B (en) Cloud configuration updating method and system for setting item of vehicle-mounted entertainment host
CN115357258A (en) Application deployment method and device, storage medium and electronic device
JP6677345B2 (en) Development operation support system, development management server, operation management server, their methods and programs
CN111984246A (en) Enterprise-level system automatic deployment method and device in distributed environment
CN112631931A (en) Version testing method and device, storage medium and electronic equipment
CN106775881B (en) System upgrading 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210924

RJ01 Rejection of invention patent application after publication