Server deployment method and device, computer equipment and storage medium
By obtaining the load information and disk usage information of the original server, multiple MySQL instances are merged and processed, and a server script framework is built based on the information of the original server and the server to be deployed, and the MySQL instance collection to be synchronized is automatically deployed, solving the problems of inefficient server deployment and duplicate development in the existing technology, achieving efficient server deployment and simplified operation and maintenance management.
Patent Information
- Application Number
- CN202411563313.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-11-04
AI Technical Summary
In the prior art, when deploying and managing servers, various types of enterprises face different operating procedures, which leads to increased management difficulties. Moreover, since the server of each online system needs to develop a deployment system, a large number of repeated developments have led to serious waste of manpower and resources.
By obtaining the load information and disk usage information of the original server, multiple MySQL instances are merged and processed, a collection of MySQL instances to be synchronized is generated, and a server script framework is built based on the information of the original server and the server to be deployed is automatically deployed.
By automatically processing the merge and deployment of MySQL instances, the server deployment efficiency is improved, the number of servers required is reduced, and the database operation and maintenance management is simplified.
Smart Images

Figure CN119645436A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of base frame operation and maintenance technology, application and financial technology business field, and in particular to a server deployment method, device, computer equipment and storage medium. Background Art
[0002] With the rapid development of computer technology and cloud network technology, as well as the rapid development requirements of various types of enterprises, the pressure on the network servers of enterprises has also increased. For some enterprises, it is necessary to replace the server room with a higher configuration to relieve the pressure of data storage. Now various large-scale online systems have their own deployment systems to complete large-scale server deployment. Generally, each deployment system can complete large-scale deployment tasks, but because these deployment systems are targeted at specific servers, the operation processes are different, which increases the difficulty of the work of server managers. At the same time, a deployment system must be developed for the server of each online system, which causes a lot of repeated development, resulting in serious waste of manpower and resources. Therefore, how to improve the deployment efficiency of servers has become a technical problem that needs to be solved urgently. Summary of the invention
[0003] The present application provides a server deployment method, apparatus, computer equipment and storage medium to improve the deployment efficiency of the server.
[0004] In a first aspect, the present application provides a server deployment method, the method comprising:
[0005] Obtaining original server information of the original server, and merging the original MySQL instances in the original server based on the load information and disk usage information in the original server information to generate a set of MySQL instances to be synchronized;
[0006] Acquire the server information to be deployed of the server to be deployed, and build a server script framework based on the original server information and the server information to be deployed;
[0007] The original MySQL instances in the set of MySQL instances to be synchronized are monitored by the server to be deployed, a deployment plan is determined, and the set of MySQL instances to be synchronized is deployed to the server to be deployed through the server script framework and the deployment plan.
[0008] In a second aspect, the present application further provides a server deployment device, the device comprising:
[0009] A module for generating a set of MySQL instances to be synchronized is used to obtain original server information of an original server, and based on load information and disk usage information in the original server information, merge the original MySQL instances in the original server to generate a set of MySQL instances to be synchronized;
[0010] A server script framework construction module, used to obtain the to-be-deployed server information of the to-be-deployed server, and to construct a server script framework based on the original server information and the to-be-deployed server information;
[0011] The server deployment module is used to monitor each of the original MySQL instances in the set of MySQL instances to be synchronized through the server to be deployed, determine the deployment plan, and deploy the set of MySQL instances to be synchronized to the server to be deployed through the server script framework and the deployment plan.
[0012] In a third aspect, the present application also provides a computer device, comprising a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the server deployment method as described above when executing the computer program.
[0013] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the server deployment method as described above.
[0014] The present application discloses a server deployment method, device, computer equipment and storage medium, wherein the server deployment method comprises obtaining the original server information of the original server, merging the original MySQL instances in the original server based on the load information and disk usage information in the original server information to generate a set of MySQL instances to be synchronized; obtaining the server information to be deployed of the server to be deployed, and building a server script framework based on the original server information and the server information to be deployed; monitoring each of the original MySQL instances in the set of MySQL instances to be synchronized through the server to be deployed, determining a deployment plan, and deploying the set of MySQL instances to be synchronized to the server to be deployed through the server script framework and the deployment plan. In the above manner, the present application more effectively utilizes server resources and reduces the number of servers required by automatically processing the merging of MySQL instances in the original server. The server script framework and deployment plan are adjusted according to different server information to be deployed, which simplifies the operation and maintenance management of the database, thereby improving the efficiency of server deployment. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0016] Figure 1 is a schematic flow chart of a server deployment method provided by the first embodiment of the present application;
[0017] Figure 2 is a schematic flow chart of a server deployment method provided in the second embodiment of the present application;
[0018] Figure 3 is a schematic flow chart of a server deployment method provided in the third embodiment of the present application;
[0019] Figure 4 is a schematic flow chart of a server deployment method provided in the fourth embodiment of the present application;
[0020] Figure 5 A schematic block diagram of a server deployment device provided in an embodiment of the present application;
[0021] Figure 6 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0023] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0024] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0025] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0026] The embodiments of the present application provide a server deployment method, device, computer equipment and storage medium. Among them, the server deployment method can be applied to a server, and by automatically processing the MySQL instance merge in the original server, server resources are more effectively utilized, and the number of servers required is reduced. The server script framework and deployment scheme are adjusted according to different server information to be deployed, which simplifies the operation and maintenance management of the database, thereby improving the server deployment efficiency. Among them, the server can be an independent server or a server cluster.
[0027] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0028] See also Figure 1 , Figure 1 This is a schematic flow chart of a server deployment method provided by the first embodiment of the present application. The server deployment method can be applied to the server to more effectively utilize server resources and reduce the number of required servers by automatically processing the MySQL instance merger in the original server. The server script framework and deployment scheme are adjusted according to different server information to be deployed, which simplifies the operation and maintenance management of the database, thereby improving the server deployment efficiency.
[0029] like Figure 1 As shown, the server deployment method specifically includes steps S10 to S30.
[0030] Step S10: obtaining original server information of the original server, and merging the original MySQL instances in the original server based on the load information and disk usage information in the original server information to generate a set of MySQL instances to be synchronized;
[0031] Step S20: acquiring the server information to be deployed of the server to be deployed, and constructing a server script framework based on the original server information and the server information to be deployed;
[0032] Step S30: monitor each of the original MySQL instances in the set of MySQL instances to be synchronized through the server to be deployed, determine a deployment plan, and deploy the set of MySQL instances to be synchronized to the server to be deployed through the server script framework and the deployment plan.
[0033] In one embodiment, MySQL is a relational database management system. A metadata table is designed to record the original and to-be-deployed server host names, IP addresses (Internet Protocol Address), ports, domain names, instance names, MySQL versions, database roles as master or slave, task running status, etc. The MySQL instances on the original servers are merged based on the load and disk usage of the MySQL database, and the information on merging the MySQL instances of the original servers into the servers to be deployed is recorded in the metadata table. According to the MySQL version information, software is installed and initialized on the servers in the server room to be deployed. Before maintenance, turn off the monitoring status and host name of the original server to reduce alarm generation, and complete the change of the server host name. Based on the ip and port information of the original server and the ip and port information of the server to be deployed, the original replacement server script is spliced;
[0034] In the process of building the server room to be deployed, there are several states involved: recovery task not started / started, copying backup files and configuration files, normal database startup, and process end. If there is an exception in a certain state, the state value of the metadata table will be changed according to the instance information. For example, if the merged server to be deployed has been built, if it is a MySQL5 instance, the deployment strategy is determined to be MHA (Master High Availability), which is a high availability solution for MySQL database; if it is a MySQL8 instance, the deployment strategy is determined to be Orchestrator, which is an open source database automation management tool.
[0035] Replace the IP and port information of the merged original server with the IP and port information of the server to be deployed, modify the high-availability metadata and instance information basic configuration table maintained by the database administrator, and shut down the merged original server.
[0036] The present embodiment discloses a server deployment method, device, computer equipment and storage medium, wherein the server deployment method includes obtaining the original server information of the original server, merging the original MySQL instances in the original server based on the load information and disk usage information in the original server information to generate a set of MySQL instances to be synchronized; obtaining the server information to be deployed of the server to be deployed, and building a server script framework based on the original server information and the server information to be deployed; monitoring each of the original MySQL instances in the set of MySQL instances to be synchronized through the server to be deployed, determining a deployment plan, and deploying the set of MySQL instances to be synchronized to the server to be deployed through the server script framework and the deployment plan. In the above manner, the present application more effectively utilizes server resources and reduces the number of servers required by automatically processing the merging of MySQL instances in the original server. The server script framework and deployment plan are adjusted according to different server information to be deployed, which simplifies the operation and maintenance management of the database, thereby improving the efficiency of server deployment.
[0037] See also Figure 2 , Figure 2 This is a schematic flow chart of a server deployment method provided by the second embodiment of the present application. The server deployment method can be applied to the server to more effectively utilize server resources and reduce the number of required servers by automatically processing the MySQL instance merger in the original server. The server script framework and deployment scheme are adjusted according to different server information to be deployed, which simplifies the operation and maintenance management of the database, thereby improving the server deployment efficiency.
[0038] based on Figure 1 The embodiment shown, this embodiment Figure 2 As shown, step S20 includes steps S201 to S204.
[0039] Step S201, extracting the configuration information to be deployed from the server information to be deployed, and extracting the original configuration information from the original server information, wherein the configuration information to be deployed includes the IP information to be deployed and the port information to be deployed, and the original configuration information includes the original IP information and the original port information;
[0040] Step S202: determining configuration differences based on the to-be-deployed configuration information and the original configuration information;
[0041] Step S203: generating a server configuration script for the server to be deployed based on the configuration difference;
[0042] Step S204: splicing the original configuration information and the configuration information to be deployed through the server configuration script and the configuration difference to generate the server script framework.
[0043] In one embodiment, the configuration information to be deployed is extracted from the information of the server to be deployed, such as the IP information to be deployed and the port information to be deployed, and the original configuration information is extracted from the information of the original server, such as the original IP information and the original port information. The configuration information to be deployed is compared with the original configuration information to identify the following configuration differences:
[0044] IP address difference: Determine whether the IP to be deployed is the same as the original IP;
[0045] Port number difference: Determine whether the port to be deployed is the same as the original port.
[0046] Record all difference information, generate a configuration script, use the generated server configuration script and configuration differences to splice the original configuration information with the configuration information to be deployed to form a complete server script framework, integrate the original IP information, the IP information to be deployed, the original port information and the port information to be deployed into the script, and ensure that the script contains necessary comments and instructions for subsequent maintenance and understanding.
[0047] The present embodiment discloses a server deployment method, apparatus, computer equipment and storage medium. The server deployment method includes obtaining original server information of an original server, merging and processing original MySQL instances in the original server based on load information and disk usage information in the original server information to generate a set of MySQL instances to be synchronized; extracting configuration information to be deployed in the server information to be deployed, and extracting original configuration information in the original server information, wherein the configuration information to be deployed includes IP information to be deployed and port information to be deployed, and the original configuration information includes original IP information and original port information; determining configuration differences based on the configuration information to be deployed and the original configuration information; generating a server configuration script of the server to be deployed based on the configuration differences; splicing the original configuration information and the configuration information to be deployed through the server configuration script and the configuration differences to generate the server script framework; monitoring each of the original MySQL instances in the set of MySQL instances to be synchronized through the server to be deployed, determining a deployment plan, and deploying the set of MySQL instances to be synchronized to the server to be deployed through the server script framework and the deployment plan. Through the above method, this application uses server resources more efficiently and reduces the number of servers required by automating the merging of MySQL instances in the original server. The server script framework and deployment plan are adjusted according to the different information of the servers to be deployed, which simplifies the operation and maintenance of the database and improves the efficiency of server deployment.
[0048] based on Figure 2 In the embodiment shown, in this embodiment, step S204 includes:
[0049] Creating a basic script framework, wherein the basic script framework includes general server configuration information and general server security parameters;
[0050] Based on the server configuration script and the configuration difference, the general server configuration information and / or general server security parameters are added and / or modified to the basic script framework to generate the server script framework.
[0051] In one embodiment, a basic script framework is written, which will contain configuration information and security parameters common to all servers, ensuring that the framework has a modular structure to facilitate the subsequent addition, modification or deletion of specific configurations. Common server configuration information defined in the basic script framework includes system settings (such as time zone, language, etc.), network configuration (such as DNS settings, host name, etc.), and service configuration (such as database, Web server, etc.).
[0052] Define common server security parameters in the basic script framework, including firewall rules, access control lists (ACLs), password policies, security patches, and update mechanisms. Analyze the generated server configuration scripts and the identified configuration differences, and determine which configurations need to be added to the basic script framework and which need to be modified. Based on the configuration differences, add new configuration information to the basic script framework or modify existing configuration information to ensure that all modifications comply with best practices and security standards. Update the security parameters in the basic script framework based on configuration differences and security requirements to ensure that all security settings can resist potential security threats.
[0053] Integrate the specific configurations of the server to be deployed (such as IP address, port number, etc.) into the basic script framework to ensure that these configurations are compatible with the general configuration and do not cause conflicts.
[0054] The present embodiment discloses a server deployment method, apparatus, computer equipment and storage medium. The server deployment method comprises obtaining original server information of an original server, merging original MySQL instances in the original server based on load information and disk usage information in the original server information to generate a set of MySQL instances to be synchronized; extracting configuration information to be deployed in the server information to be deployed, and extracting original configuration information in the original server information, wherein the configuration information to be deployed comprises IP information to be deployed and port information to be deployed, and the original configuration information comprises original IP information and original port information; determining based on the configuration information to be deployed and the original configuration information Determine configuration differences; based on the configuration differences, generate a server configuration script for the server to be deployed; create a basic script framework, wherein the basic script framework includes general server configuration information and general server security parameters; based on the server configuration script and the configuration differences, add and / or modify the general server configuration information and / or general server security parameters to the basic script framework to generate the server script framework; monitor each of the original MySQL instances in the set of MySQL instances to be synchronized through the server to be deployed, determine the deployment plan, and deploy the set of MySQL instances to be synchronized to the server to be deployed through the server script framework and the deployment plan. Through the above-mentioned method, the present application more effectively utilizes server resources and reduces the number of servers required by automating the merging of MySQL instances in the original servers. The server script framework and deployment plan are adjusted according to different information of the servers to be deployed, which simplifies the operation and maintenance management of the database, thereby improving the efficiency of server deployment.
[0055] See also Figure 3 , Figure 3This is a schematic flow chart of a server deployment method provided by the third embodiment of the present application. The server deployment method can be applied to the server to more effectively utilize server resources and reduce the number of required servers by automatically processing the MySQL instance merger in the original server. The server script framework and deployment scheme are adjusted according to different server information to be deployed, which simplifies the operation and maintenance management of the database, thereby improving the server deployment efficiency.
[0056] based on Figure 1 The embodiment shown, this embodiment Figure 3 As shown, step S10 includes steps S101 to S104.
[0057] Step S101, monitoring the CPU usage information, memory usage information and disk I / O information of the original server, wherein the memory usage information and the CPU usage information belong to the load information, and the disk I / O information belongs to the disk usage information;
[0058] Step S102: evaluating resource requirements of each of the original MySQL instances according to the load information and the disk usage information;
[0059] Step S103: Merge the original MySQL instances that match the resource requirements to generate at least one merged MySQL instance;
[0060] Step S104: Integrate the merged MySQL instances to generate the set of MySQL instances to be synchronized.
[0061] In one embodiment, a monitoring tool or a system's built-in performance monitoring function is used to start collecting the original server's CPU usage information, memory usage information, and disk I / O information, ensuring that the monitoring tool can collect data in real time and can record historical data for a long time for analysis.
[0062] Memory usage information and disk I / O information are extracted from the monitoring tool as load information, and the collected load information and disk usage information are analyzed to evaluate the resource requirements of each original MySQL instance, determine which instances’ resource usage is close to or exceeds the threshold, and which instances have the potential for resource consolidation.
[0063] Based on the resource demand assessment results, determine which MySQL instances can be merged to optimize resource usage. Consider factors such as business impact, data consistency, and recovery time to develop a merge strategy. According to the merge strategy, merge the original MySQL instances that match the resource demand, perform database migration and data synchronization operations, and ensure data integrity and consistency.
[0064] After the merge operation is completed, at least one merged MySQL instance is generated, and all merged MySQL instances are integrated to generate a set of MySQL instances to be synchronized.
[0065] The present embodiment discloses a server deployment method, device, computer equipment and storage medium, the server deployment method includes monitoring the CPU usage information, memory usage information and disk I / O information of the original server, wherein the memory usage information and the CPU usage information belong to the load information, and the disk I / O information belongs to the disk usage information; according to the load information and the disk usage information, the resource requirements of each of the original MySQL instances are evaluated; each of the original MySQL instances matching the resource requirements is merged to generate at least one merged MySQL instance; each of the merged MySQL instances is integrated to generate the set of MySQL instances to be synchronized; the server information to be deployed of the server to be deployed is obtained, and a server script framework is constructed based on the original server information and the server information to be deployed; each of the original MySQL instances in the set of MySQL instances to be synchronized is monitored by the server to be deployed, a deployment plan is determined, and the set of MySQL instances to be synchronized is deployed to the server to be deployed through the server script framework and the deployment plan. In the above manner, the present application more effectively utilizes server resources and reduces the number of servers required by automatically processing the MySQL instance merger in the original server. The server script framework and deployment plan are adjusted according to the different information of the servers to be deployed, which simplifies the operation and maintenance of the database and improves the efficiency of server deployment.
[0066] See also Figure 4 , Figure 4 This is a schematic flow chart of a server deployment method provided by the fourth embodiment of the present application. The server deployment method can be applied to the server to more effectively utilize server resources and reduce the number of required servers by automating the merging of MySQL instances in the original server. The server script framework and deployment scheme are adjusted according to different information of the servers to be deployed, which simplifies the operation and maintenance management of the database and thus improves the efficiency of server deployment.
[0067] based on Figure 1 The embodiment shown, this embodiment Figure 4 As shown, step S30 includes steps S301 to S303.
[0068] Step S301: construct a metadata list based on the server information to be deployed and each of the original MySQL instances;
[0069] Step S302: Real-time monitoring of the status value of each of the original MySQL instances in the metadata list is performed through the server to be deployed;
[0070] Step S303: Determine the deployment plan of each of the original MySQL instances based on each of the state values.
[0071] In one embodiment, detailed information of the server to be deployed is collected, including hardware configuration, network settings, operating system, etc., and detailed information of each original MySQL instance is collected, including instance configuration, version, role (master / slave), storage engine, etc. A metadata list is created to store key information of the server to be deployed and the original MySQL instance. The metadata list should include the server's IP address, port, domain name, instance name, MySQL version, database role, etc.
[0072] The collected information of the server to be deployed and the original MySQL instance information is filled into the metadata list. The status value of each original MySQL instance in the metadata list is monitored in real time through the server to be deployed. The key performance indicators monitored may be CPU usage, memory usage, disk I / O, network traffic, etc.
[0073] Analyze the collected status values, evaluate the health and performance of each MySQL instance, and determine the best deployment plan for each original MySQL instance based on the analysis results.
[0074] The present embodiment discloses a server deployment method, device, computer equipment and storage medium, the server deployment method includes obtaining the original server information of the original server, merging the original MySQL instances in the original server based on the load information and disk usage information in the original server information to generate a set of MySQL instances to be synchronized; obtaining the server information to be deployed of the server to be deployed, and building a server script framework based on the original server information and the server information to be deployed; building a metadata list based on the server information to be deployed and the original MySQL instances; monitoring the status values of the original MySQL instances in the metadata list in real time through the server to be deployed; determining the deployment scheme of the original MySQL instances based on the status values, and deploying the set of MySQL instances to be synchronized to the server to be deployed through the server script framework and the deployment scheme. Through the above-mentioned method, the present application more effectively utilizes server resources and reduces the number of servers required by automatically processing the MySQL instance merger in the original server. The server script framework and deployment scheme are adjusted according to different server information to be deployed, which simplifies the operation and maintenance management of the database, thereby improving the efficiency of server deployment.
[0075] based on Figure 4 In the illustrated embodiment, step S303 includes:
[0076] When the state value is MySQL5, determining that the deployment scheme is the first high availability scheme;
[0077] When the status value is MySQL8, it is determined that the deployment solution is the second most available solution.
[0078] Based on any of the above embodiments, in this embodiment, after step S30, the following steps are included:
[0079] Detecting whether backup data of each of the original MySQL instances exists in the original server;
[0080] If the backup data does not exist in the original server, each of the original MySQL instances is backed up, the backup data is stored in the original server, and the original server is shut down.
[0081] See also Figure 5 , Figure 5 The embodiment of the present application provides a schematic block diagram of a server deployment device, which is used to execute the aforementioned server deployment method. The server deployment device can be configured on a server.
[0082] like Figure 5 As shown, the server deployment device 400 includes:
[0083] The module 410 for generating a set of MySQL instances to be synchronized is used to obtain original server information of an original server, and based on load information and disk usage information in the original server information, merge the original MySQL instances in the original server to generate a set of MySQL instances to be synchronized;
[0084] The server script framework construction module 420 is used to obtain the server information to be deployed of the server to be deployed, and to construct a server script framework based on the original server information and the server information to be deployed;
[0085] The server deployment module 430 is used to monitor each of the original MySQL instances in the set of MySQL instances to be synchronized through the server to be deployed, determine the deployment plan, and deploy the set of MySQL instances to be synchronized to the server to be deployed through the server script framework and the deployment plan.
[0086] Furthermore, the server script framework construction module 420 includes:
[0087] A configuration information extraction unit, used to extract the configuration information to be deployed from the server information to be deployed, and to extract the original configuration information from the original server information, wherein the configuration information to be deployed includes the IP information to be deployed and the port information to be deployed, and the original configuration information includes the original IP information and the original port information;
[0088] A configuration difference determining unit, configured to determine a configuration difference based on the to-be-deployed configuration information and the original configuration information;
[0089] A server configuration script generating unit, configured to generate a server configuration script for the server to be deployed based on the configuration difference;
[0090] The server script framework generating unit is used to splice the original configuration information and the configuration information to be deployed through the server configuration script and the configuration difference to generate the server script framework.
[0091] Furthermore, the server script framework generating unit includes:
[0092] A basic script framework creation subunit, used to create a basic script framework, wherein the basic script framework includes general server configuration information and general server security parameters;
[0093] The server script framework generating subunit is used to add and / or modify the general server configuration information and / or general server security parameters to the basic script framework based on the server configuration script and the configuration difference, so as to generate the server script framework.
[0094] Furthermore, the module 410 for generating the set of MySQL instances to be synchronized includes:
[0095] an information detection unit, used for monitoring CPU usage information, memory usage information and disk I / O information of the original server, wherein the memory usage information and the CPU usage information belong to the load information, and the disk I / O information belongs to the disk usage information;
[0096] A resource demand evaluation unit, configured to evaluate the resource demand of each of the original MySQL instances according to the load information and the disk usage information;
[0097] A merged MySQL instance generating unit, configured to merge the original MySQL instances matching the resource requirements to generate at least one merged MySQL instance;
[0098] The MySQL instance set to be synchronized generating unit is used to integrate the merged MySQL instances to generate the MySQL instance set to be synchronized.
[0099] Furthermore, the server deployment module 430 includes:
[0100] A metadata list construction unit, used to construct a metadata list based on the to-be-deployed server information and each of the original MySQL instances;
[0101] A real-time monitoring unit, used for monitoring the status value of each original MySQL instance in the metadata list in real time through the server to be deployed;
[0102] A deployment scheme determining unit is used to determine the deployment scheme of each of the original MySQL instances based on each of the state values.
[0103] Furthermore, the deployment scheme determination unit includes:
[0104] A first high availability solution determining subunit, configured to determine that the deployment solution is the first high availability solution when the state value is MySQL5;
[0105] The second high availability solution determining subunit is configured to determine that the deployment solution is the second high availability solution when the state value is MySQL8.
[0106] Furthermore, the server deployment device 400 includes:
[0107] A backup data detection module, used to detect whether the backup data of each of the original MySQL instances exists in the original server;
[0108] The original server shutdown module is used to back up each of the original MySQL instances, store the backup data in the original server, and shut down the original server if the backup data does not exist in the original server.
[0109] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0110] The above-mentioned device can be implemented in the form of a computer program. Figure 6 Runs on the computer device shown.
[0111] See also Figure 6 , Figure 6 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.
[0112] See also Figure 6 The computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0113] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any server deployment method.
[0114] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0115] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any server deployment method.
[0116] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0117] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0118] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0119] Obtaining original server information of the original server, and merging the original MySQL instances in the original server based on the load information and disk usage information in the original server information to generate a set of MySQL instances to be synchronized;
[0120] Acquire the server information to be deployed of the server to be deployed, and build a server script framework based on the original server information and the server information to be deployed;
[0121] The original MySQL instances in the set of MySQL instances to be synchronized are monitored by the server to be deployed, a deployment plan is determined, and the set of MySQL instances to be synchronized is deployed to the server to be deployed through the server script framework and the deployment plan.
[0122] In one embodiment, the server information to be deployed of the server to be deployed is obtained, and a server script framework is constructed based on the original server information and the server information to be deployed, so as to implement:
[0123] Extracting the configuration information to be deployed from the server information to be deployed, and extracting the original configuration information from the original server information, wherein the configuration information to be deployed includes the IP information to be deployed and the port information to be deployed, and the original configuration information includes the original IP information and the original port information;
[0124] Determining configuration differences based on the to-be-deployed configuration information and the original configuration information;
[0125] Based on the configuration differences, generating a server configuration script for the server to be deployed;
[0126] The original configuration information and the configuration information to be deployed are spliced together through the server configuration script and the configuration difference to generate the server script framework.
[0127] In one embodiment, the original configuration information and the configuration information to be deployed are spliced through the server configuration script and the configuration difference to generate the server script framework for implementing:
[0128] Creating a basic script framework, wherein the basic script framework includes general server configuration information and general server security parameters;
[0129] Based on the server configuration script and the configuration difference, the general server configuration information and / or general server security parameters are added and / or modified to the basic script framework to generate the server script framework.
[0130] In one embodiment, original server information of an original server is obtained, and based on load information and disk usage information in the original server information, each original MySQL instance in the original server is merged to generate a set of MySQL instances to be synchronized, so as to achieve:
[0131] Monitoring CPU usage information, memory usage information and disk I / O information of the original server, wherein the memory usage information and the CPU usage information belong to the load information, and the disk I / O information belongs to the disk usage information;
[0132] According to the load information and the disk usage information, evaluating the resource requirements of each of the original MySQL instances;
[0133] Merging the original MySQL instances that match the resource requirements to generate at least one merged MySQL instance;
[0134] The merged MySQL instances are integrated to generate the set of MySQL instances to be synchronized.
[0135] In one embodiment, the server to be deployed monitors each of the original MySQL instances in the set of MySQL instances to be synchronized to determine a deployment plan for achieving:
[0136] Building a metadata list based on the server information to be deployed and each of the original MySQL instances;
[0137] The status value of each of the original MySQL instances in the metadata list is monitored in real time by the server to be deployed;
[0138] Based on each of the status values, determine the deployment plan for each of the original MySQL instances.
[0139] In one embodiment, based on each of the state values, the deployment scheme of each of the original MySQL instances is determined to achieve:
[0140] When the state value is MySQL5, determining that the deployment scheme is the first high availability scheme;
[0141] When the status value is MySQL8, it is determined that the deployment solution is the second most available solution.
[0142] In one embodiment, the server to be deployed monitors each of the original MySQL instances in the set of MySQL instances to be synchronized, determines a deployment plan, and deploys the set of MySQL instances to be synchronized to the server to be deployed through the server script framework and the deployment plan, so as to achieve:
[0143] Detecting whether backup data of each of the original MySQL instances exists in the original server;
[0144] If the backup data does not exist in the original server, each of the original MySQL instances is backed up, the backup data is stored in the original server, and the original server is shut down.
[0145] A computer-readable storage medium is also provided in an embodiment of the present application. The computer-readable storage medium stores a computer program. The computer program includes program instructions. The processor executes the program instructions to implement any server deployment method provided in the embodiment of the present application.
[0146] The computer-readable storage medium may be an internal storage unit of the computer device described in the above embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device.
[0147] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A server deployment method, characterized in that: include: Obtaining original server information of the original server, and merging the original MySQL instances in the original server based on the load information and disk usage information in the original server information to generate a set of MySQL instances to be synchronized; Acquire the server information to be deployed of the server to be deployed, and build a server script framework based on the original server information and the server information to be deployed; The original MySQL instances in the set of MySQL instances to be synchronized are monitored by the server to be deployed, a deployment plan is determined, and the set of MySQL instances to be synchronized is deployed to the server to be deployed through the server script framework and the deployment plan.
2. The server deployment method according to claim 1, characterized in that: The step of obtaining the server information to be deployed of the server to be deployed, and constructing a server script framework based on the original server information and the server information to be deployed, includes: Extracting the configuration information to be deployed from the server information to be deployed, and extracting the original configuration information from the original server information, wherein the configuration information to be deployed includes the IP information to be deployed and the port information to be deployed, and the original configuration information includes the original IP information and the original port information; Determining configuration differences based on the to-be-deployed configuration information and the original configuration information; Based on the configuration differences, generating a server configuration script for the server to be deployed; The original configuration information and the configuration information to be deployed are spliced together through the server configuration script and the configuration difference to generate the server script framework.
3. The server deployment method according to claim 2, characterized in that: The process of combining the original configuration information and the configuration information to be deployed by using the server configuration script and the configuration difference to generate the server script framework includes: Creating a basic script framework, wherein the basic script framework includes general server configuration information and general server security parameters; Based on the server configuration script and the configuration difference, the general server configuration information and / or general server security parameters are added and / or modified to the basic script framework to generate the server script framework.
4. The server deployment method according to claim 1, characterized in that: The obtaining of original server information of the original server, and merging the original MySQL instances in the original server based on load information and disk usage information in the original server information to generate a set of MySQL instances to be synchronized, includes: Monitoring CPU usage information, memory usage information and disk I / O information of the original server, wherein the memory usage information and the CPU usage information belong to the load information, and the disk I / O information belongs to the disk usage information; According to the load information and the disk usage information, evaluating the resource requirements of each of the original MySQL instances; Merging the original MySQL instances that match the resource requirements to generate at least one merged MySQL instance; The merged MySQL instances are integrated to generate the set of MySQL instances to be synchronized.
5. The server deployment method according to claim 1, characterized in that: The monitoring of each of the original MySQL instances in the set of MySQL instances to be synchronized by the server to be deployed to determine a deployment plan includes: Building a metadata list based on the server information to be deployed and each of the original MySQL instances; The status value of each of the original MySQL instances in the metadata list is monitored in real time by the server to be deployed; Based on each of the status values, determine the deployment plan for each of the original MySQL instances.
6. The server deployment method according to claim 5, characterized in that: The step of determining the deployment scheme of each of the original MySQL instances based on each of the state values includes: When the state value is MySQL5, determining that the deployment scheme is the first high availability scheme; When the status value is MySQL8, it is determined that the deployment solution is the second most available solution.
7. The server deployment method according to any one of claims 1 to 6, characterized in that: The method includes: monitoring each of the original MySQL instances in the set of MySQL instances to be synchronized by the server to be deployed, determining a deployment plan, and deploying the set of MySQL instances to be synchronized to the server to be deployed by the server script framework and the deployment plan, including: Detecting whether backup data of each of the original MySQL instances exists in the original server; If the backup data does not exist in the original server, each of the original MySQL instances is backed up, the backup data is stored in the original server, and the original server is shut down.
8. A server deployment device, characterized in that: include: A module for generating a set of MySQL instances to be synchronized is used to obtain original server information of an original server, and based on load information and disk usage information in the original server information, merge the original MySQL instances in the original server to generate a set of MySQL instances to be synchronized; A server script framework construction module, used to obtain the to-be-deployed server information of the to-be-deployed server, and to construct a server script framework based on the original server information and the to-be-deployed server information; The server deployment module is used to monitor each of the original MySQL instances in the set of MySQL instances to be synchronized through the server to be deployed, determine the deployment plan, and deploy the set of MySQL instances to be synchronized to the server to be deployed through the server script framework and the deployment plan.
9. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is configured to execute the computer program and implement the server deployment method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the server deployment method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Structural difference processing method and system based on MYSQL
CN104881455A
Version deployment method and device, electronic equipment and storage medium
CN116931962A
Deployment method and apparatus for monitoring system, computer device and storage medium
WO2019090993A1