Server deployment method and apparatus, computer device, and storage medium
By automating the merging of MySQL instances in the original server, generating a set to be synchronized, and building a server script framework, the problem of inconsistent operation processes in server deployment systems is solved, thereby improving resource utilization efficiency and simplifying operation and maintenance management.
Patent Information
- Application Number
- CN202411563313.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2044-11-04
AI Technical Summary
In existing technologies, server deployment systems have different operating procedures for specific servers, which increases the workload of administrators and leads to redundant development, resulting in a waste of human resources and manpower. Improving server deployment efficiency has become an urgent problem to be solved.
By acquiring the original server information, merging MySQL instances to generate a set to be synchronized, building a server script framework, and determining the deployment plan based on the information of the servers to be deployed, the merging of MySQL instances is automated, reducing the number of servers and simplifying operation and maintenance management.
Effectively utilize server resources, reduce the number of servers, simplify database operation and maintenance management, and improve server deployment efficiency.
Smart Images

Figure CN119645436B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of base frame operation and maintenance, and is applied to the field of financial technology business, and in particular relates to a server deployment method and device, computer equipment and a storage medium. BACKGROUND
[0002] With the rapid development of computer technology and cloud network technology, and the rapid development requirements of various types of enterprises, the pressure on the network servers of enterprises is also increasing. For some enterprises, it is necessary to replace servers with higher configurations to relieve data storage pressure. Now various large online systems have their own set of deployment systems to complete large-scale server deployment. Generally, each deployment system can complete large-scale deployment tasks, but since these deployment systems are specific to certain servers, the operation processes are different, thereby increasing the difficulty of server management personnel's work. At the same time, a deployment system needs to be developed for the servers of each online system, thus causing a lot of repeated development, leading to serious waste of manpower and resources. Therefore, how to improve the deployment efficiency of servers has become a technical problem to be solved at present. SUMMARY
[0003] The present application provides a server deployment method, device, computer equipment and storage medium to improve the deployment efficiency of servers.
[0004] In a first aspect, the present application provides a server deployment method, which comprises:
[0005] Obtaining original server information of an original server, and based on load information and disk usage information in the original server information, performing merging processing on each original MySQL instance in the original server to generate a set of to-be-synchronized MySQL instances;
[0006] Obtaining to-be-deployed server information of a to-be-deployed server, and based on the original server information and the to-be-deployed server information, constructing a server script framework;
[0007] Monitoring each original MySQL instance in the set of to-be-synchronized MySQL instances by the to-be-deployed server, determining a deployment scheme, and deploying the set of to-be-synchronized MySQL instances to the to-be-deployed server through the server script framework and the deployment scheme.
[0008] In a second aspect, the present application further provides a server deployment device, which comprises:
[0009] The to-be-synchronized MySQL instance set generation module is configured to obtain original server information of an original server, and based on load information and disk usage information in the original server information, perform merging processing on each original MySQL instance in the original server to generate a to-be-synchronized MySQL instance set.
[0010] The server script framework construction module is configured to obtain to-be-deployed server information of a to-be-deployed server, and based on the original server information and the to-be-deployed server information, construct a server script framework.
[0011] The server deployment module is configured to monitor each original MySQL instance in the to-be-synchronized MySQL instance set by the to-be-deployed server, determine a deployment scheme, and deploy the to-be-synchronized MySQL instance set to the to-be-deployed server by the server script framework and the deployment scheme.
[0012] In a third aspect, the present application also provides a computer device, which comprises a memory and a processor; the memory is configured to store a computer program; the processor is configured 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 also provides a computer readable storage medium, which stores a computer program; the computer program is executed by a processor to make the processor implement the server deployment method as described above.
[0014] The present application discloses a server deployment method, device, computer device and storage medium. The server deployment method comprises obtaining original server information of an original server, based on load information and disk usage information in the original server information, performing merging processing on each original MySQL instance in the original server to generate a to-be-synchronized MySQL instance set; obtaining to-be-deployed server information of a to-be-deployed server, and based on the original server information and the to-be-deployed server information, constructing a server script framework; monitoring each original MySQL instance in the to-be-synchronized MySQL instance set by the to-be-deployed server, determining a deployment scheme, and deploying the to-be-synchronized MySQL instance set to the to-be-deployed server by the server script framework and the deployment scheme. In this way, the present application can automatically process the merging of MySQL instances in the original server, more effectively utilize server resources, and reduce the required number of servers. According to different to-be-deployed server information, the server script framework and the deployment scheme are adjusted, which simplifies the operation and maintenance management of the database, and further improves the server deployment efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0015] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a schematic flowchart of a server deployment method provided in the first embodiment of this application;
[0017] Figure 2 This is a schematic flowchart of a server deployment method provided in the second embodiment of this application;
[0018] Figure 3 This is a schematic flowchart of a server deployment method provided in the third embodiment of this application;
[0019] Figure 4 This is a schematic flowchart of a server deployment method provided in the fourth embodiment of this application;
[0020] Figure 5 A schematic block diagram of a server deployment apparatus provided for embodiments of this application;
[0021] Figure 6 A schematic block diagram of the structure of a computer device provided for an embodiment of this application. Detailed Implementation
[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0023] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0024] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0025] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0026] This application provides a server deployment method, apparatus, computer device, and storage medium. The server deployment method can be applied to servers, automating the merging of MySQL instances in the original server to more effectively utilize server resources and reduce the number of servers required. Adjusting the server script framework and deployment scheme according to different server information simplifies database operation and maintenance management, thereby improving server deployment efficiency. The server can be a standalone server or a server cluster.
[0027] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0028] Please see Figure 1 , Figure 1 This is a schematic flowchart illustrating a server deployment method provided in the first embodiment of this application. This server deployment method can be applied to servers to more effectively utilize server resources and reduce the required number of servers by automating the merging of MySQL instances in the original server. Adjusting the server script framework and deployment scheme according to different server information simplifies database operation and maintenance management, thereby improving server deployment efficiency.
[0029] like Figure 1 As shown, the server deployment method specifically includes steps S10 to S30.
[0030] Step S10: Obtain the original server information of the original server. Based on the 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.
[0031] Step S20: Obtain the server information to be deployed, and construct a server script framework based on the original server information and the server information to be deployed;
[0032] Step S30: Monitor each original MySQL instance 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.
[0033] In one embodiment, MySQL is a relational database management system. A metadata table is designed to record the hostname, IP address (Internet Protocol Address), port, domain name, instance name, MySQL version, database role (master or slave), task running status, etc., of the original and the server to be deployed. Based on the MySQL database load and disk usage, the MySQL instances on the original server are merged, and the information about merging the MySQL instances from the original server to the server to be deployed is recorded in the metadata table. Based on the MySQL version information, the server in the server room to be deployed is software installed and initialized. Before maintenance, the monitoring status and hostname of the original server are turned off to reduce alarm generation, and the server hostname is changed. Based on the IP and port information of the original server and the server to be deployed, the original replacement server script is concatenated.
[0034] The construction of the server room for deployment involves several states: recovery task not started / started, copying backup files and configuration files, database starts normally, and process ends. If an anomaly occurs in any state, the status value of the metadata table will be changed according to the instance information. For example, if the merged server room for deployment has been built and it is a MySQL 5 instance, the deployment strategy will be MHA (Master High Availability), a high availability solution for MySQL databases; if it is a MySQL 8 instance, the deployment strategy will be Orchestrator, an open-source database automation management tool.
[0035] Replace the original server IP and port information with the IP and port information of the server to be deployed, modify the high availability metadata and the instance information basic configuration table maintained by the database administrator, and shut down the original server that has been merged.
[0036] This embodiment discloses a server deployment method, apparatus, computer equipment, and storage medium. The server deployment method includes obtaining original server information of the original server; 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; obtaining the server information to be deployed of the server to be deployed; constructing 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 using the server script framework and the deployment plan. Through the above method, this application utilizes server resources more effectively and reduces the number of servers required by automating the merging of MySQL instances in the original server. Adjusting the server script framework and deployment plan according to different server information simplifies database operation and maintenance management, thereby improving server deployment efficiency.
[0037] Please see Figure 2 , Figure 2 This is a schematic flowchart illustrating a server deployment method provided in the second embodiment of this application. This server deployment method can be applied to servers to more effectively utilize server resources and reduce the required number of servers by automating the merging of MySQL instances in the original server. Adjusting the server script framework and deployment scheme according to different server information simplifies database operation and maintenance management, thereby improving server deployment efficiency.
[0038] based on Figure 1 The illustrated embodiment, for example Figure 2 As shown, step S20 includes steps S201 to S204.
[0039] Step S201: Extract the configuration information to be deployed from the server information to be deployed, and 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;
[0040] Step S202: Based on the configuration information to be deployed and the original configuration information, determine the configuration differences;
[0041] Step S203: Based on the configuration differences, generate the server configuration script for the server to be deployed;
[0042] Step S204: By comparing the server configuration script with the configuration, the original configuration information and the configuration information to be deployed are concatenated to generate the server script framework.
[0043] In one embodiment, the configuration information to be deployed, such as the IP address and port information to be deployed, is extracted from the information of the server to be deployed, and the original configuration information, such as the original IP address and port information, is extracted from the information of the original server. 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 discrepancies, generate a configuration script, and use the generated server configuration script and the configuration differences to concatenate the original configuration information with the configuration information to be deployed, forming 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 explanations to facilitate subsequent maintenance and understanding.
[0047] This 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 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; extracting configuration information to be deployed from the information of the server to be deployed, and extracting original configuration information from the information of the original server, 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 for the server to be deployed based on the configuration differences; concatenating the original configuration information and the configuration information to be deployed using the server configuration script and the configuration differences to generate the server script framework; monitoring each original MySQL instance in the set of MySQL instances to be synchronized using 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 using the server script framework and the deployment plan. By employing the methods described above, this application utilizes server resources more effectively and reduces the number of servers required through automated merging of MySQL instances from the original server. Adjusting the server script framework and deployment scheme according to different server information simplifies database operation and maintenance management, thereby improving server deployment efficiency.
[0048] based on Figure 2 In the illustrated embodiment, step S204 includes:
[0049] Create a basic script framework, wherein the basic script framework includes general server configuration information and general server security parameters;
[0050] Based on the differences between the server configuration script and the configuration, the general server configuration information and / or general server security parameters are added to and / or modified in the basic script framework to generate the server script framework.
[0051] In one embodiment, a basic script framework is developed. This framework contains common configuration information and security parameters for all servers, ensuring a modular structure to facilitate the subsequent addition, modification, or deletion of specific configurations. The basic script framework defines common server configuration information, including system settings (such as time zone, language, etc.), network configurations (such as DNS settings, hostname, etc.), and service configurations (such as database, web server, etc.).
[0052] The basic script framework defines common server security parameters, including firewall rules, access control lists (ACLs), password policies, security patches, and update mechanisms. It analyzes the generated server configuration scripts and identified configuration differences to determine which configurations need to be added to the basic script framework and which need to be modified. Based on the configuration differences, it adds new configuration information or modifies existing configuration information in the basic script framework, ensuring all modifications comply with best practices and security standards. Finally, it updates the security parameters in the basic script framework based on configuration differences and security requirements, ensuring all security settings can defend against 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 general configurations and do not cause conflicts.
[0054] This embodiment discloses a server deployment method, apparatus, 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; extracting the configuration information to be deployed from the information of the server to be deployed, and extracting the original configuration information from the information of the original server, 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; and determining the configuration information to be deployed based on the configuration information to be deployed and the original configuration information. The process involves: defining configuration differences; generating a server configuration script for the server to be deployed based on these differences; creating a basic script framework, which includes general server configuration information and general server security parameters; adding and / or modifying 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 differences, thereby generating the server script framework; monitoring each original MySQL instance 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 using the server script framework and the deployment plan. Through this method, this application utilizes server resources more effectively and reduces the number of servers required by automating the merging of MySQL instances in the original server. Adjusting the server script framework and deployment plan according to different information of the server to be deployed simplifies database operation and maintenance management, thereby improving server deployment efficiency.
[0055] Please see Figure 3 , Figure 3This is a schematic flowchart illustrating a server deployment method provided in the third embodiment of this application. This server deployment method can be applied to servers to more effectively utilize server resources and reduce the required number of servers by automating the merging of MySQL instances in the original server. Adjusting the server script framework and deployment scheme according to different server information simplifies database operation and maintenance management, thereby improving server deployment efficiency.
[0056] based on Figure 1 The illustrated embodiment, for example Figure 3 As shown, step S10 includes steps S101 to S104.
[0057] Step S101: Monitor the CPU utilization information, memory utilization information and disk I / O information of the original server, wherein the memory utilization information and the CPU utilization information belong to the load information, and the disk I / O information belongs to the disk utilization information;
[0058] Step S102: Based on the load information and the disk usage information, assess the resource requirements of each of the original MySQL instances;
[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, monitoring tools or the system's built-in performance monitoring functions are used to begin collecting CPU usage, memory usage, and disk I / O information from the raw server, ensuring that the monitoring tools can collect data in real time and record historical data for analysis over a long period of time.
[0062] Extract memory usage and disk I / O information from monitoring tools as load information. Analyze the collected load and disk usage information to assess the resource requirements of each raw MySQL instance, determine which instances' resource usage is close to or exceeds the threshold, and which instances have the potential for resource merging.
[0063] Based on the resource requirement assessment, determine which MySQL instances can be merged to optimize resource usage. Considering factors such as business impact, data consistency, and recovery time, formulate a merge strategy. Following this strategy, merge the original MySQL instances with matching resource requirements, 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. All merged MySQL instances are then integrated to generate a set of MySQL instances to be synchronized.
[0065] This embodiment discloses a server deployment method, apparatus, computer equipment, and storage medium. The server deployment method includes monitoring the CPU utilization, memory utilization, and disk I / O information of the original server, wherein the memory utilization and CPU utilization information are part of the load information, and the disk I / O information is part of the disk utilization information; assessing the resource requirements of each original MySQL instance based on the load information and disk utilization information; merging the original MySQL instances with matching resource requirements to generate at least one merged MySQL instance; integrating the merged MySQL instances to generate a set of MySQL instances to be synchronized; obtaining the information of the server to be deployed, and constructing a server script framework based on the original server information and the information of the server to be deployed; monitoring each original MySQL instance 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 utilizes server resources more effectively and reduces the number of servers required by automating the merging of MySQL instances in the original server. Adjusting the server script framework and deployment scheme according to different server information simplifies database operation and maintenance management, thereby improving server deployment efficiency.
[0066] Please see Figure 4 , Figure 4 This is a schematic flowchart illustrating a server deployment method provided in the fourth embodiment of this application. This server deployment method can be applied to servers to more effectively utilize server resources and reduce the required number of servers by automating the merging of MySQL instances in the original server. Adjusting the server script framework and deployment scheme according to different server information simplifies database operation and maintenance management, thereby improving server deployment efficiency.
[0067] based on Figure 1 The illustrated embodiment, for example Figure 4 As shown, step S30 includes steps S301 to S303.
[0068] Step S301: Based on the information of the server to be deployed and each of the original MySQL instances, construct a metadata list;
[0069] Step S302: Monitor the status values of each original MySQL instance in the metadata list in real time through the server to be deployed;
[0070] Step S303: Based on each of the stated status values, determine the deployment scheme for each of the original MySQL instances.
[0071] In one embodiment, detailed information about the server to be deployed is collected, including hardware configuration, network settings, operating system, etc. Detailed information about each original MySQL instance is also collected, including instance configuration, version, role (master / slave), storage engine, etc. A metadata list is created to store key information about the server to be deployed and the original MySQL instances. This metadata list should include the server's IP address, port, domain name, instance name, MySQL version, database role, etc.
[0072] The collected information on the servers to be deployed and the original MySQL instance information are populated into the metadata list. The status values of each original MySQL instance in the metadata list are monitored in real time through the servers to be deployed. Key performance indicators to be monitored can include CPU utilization, memory utilization, disk I / O, network traffic, etc.
[0073] Analyze the collected status values to evaluate the running status and performance of each MySQL instance, and determine the optimal deployment plan for each original MySQL instance based on the analysis results.
[0074] This embodiment discloses a server deployment method, apparatus, computer equipment, and storage medium. The server deployment method includes obtaining original server information of the original server; 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; 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; constructing a metadata list based on the server information to be deployed and each of the original MySQL instances; monitoring the status values of each of the original MySQL instances in the metadata list in real time through the server to be deployed; determining the deployment scheme for each 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 using the server script framework and the deployment scheme. Through the above method, this application utilizes server resources more effectively and reduces the number of servers required by automating the merging of MySQL instances in the original server. Adjusting the server script framework and deployment scheme according to different server information simplifies database operation and maintenance management, thereby improving server deployment efficiency.
[0075] based on Figure 4 In the embodiment shown, step S303 includes:
[0076] When the status value is MySQL5, the deployment scheme is determined to be the first high availability scheme;
[0077] When the status value is MySQL8, the deployment scheme is determined to be the second high availability scheme.
[0078] Based on any of the above embodiments, in this embodiment, after step S30, the following is included:
[0079] Check if backup data for each of the original MySQL instances exists in the original server;
[0080] If the backup data is not present on the original server, then each original MySQL instance is backed up, the backup data is stored on the original server, and the original server is shut down.
[0081] Please see Figure 5 , Figure 5 This is a schematic block diagram of a server deployment apparatus provided in an embodiment of the present application. The server deployment apparatus is used to perform the aforementioned server deployment method. The server deployment apparatus can be configured on a server.
[0082] like Figure 5 As shown, the server deployment device 400 includes:
[0083] The MySQL instance set generation module 410 is used to obtain the original server information of the original server, and based on the load information and disk usage information in the original server information, merge the original MySQL instances in the original server to generate a MySQL instance set to be synchronized.
[0084] The server script framework construction module 420 is used to obtain the server information to be deployed and to construct the server script framework based on the original server information and the server information to be deployed.
[0085] 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] The configuration information extraction unit is 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 determination unit is used to determine configuration differences based on the configuration information to be deployed and the original configuration information;
[0089] The server configuration script generation unit is used to generate the server configuration script for the server to be deployed based on the configuration differences.
[0090] The server script framework generation unit is used to combine the original configuration information and the configuration information to be deployed by means of the differences between the server configuration script and the configuration to generate the server script framework.
[0091] Furthermore, the server script framework generation unit includes:
[0092] A basic script framework creation sub-unit is 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 generation 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 differences between the server configuration script and the configuration, thereby generating the server script framework.
[0094] Furthermore, the MySQL instance set generation module 410 to be synchronized includes:
[0095] An information detection unit is used to monitor the CPU utilization information, memory utilization information, and disk I / O information of the original server, wherein the memory utilization information and the CPU utilization information are part of the load information, and the disk I / O information is part of the disk utilization information;
[0096] The resource requirement assessment unit is used to assess the resource requirements of each of the original MySQL instances based on the load information and the disk utilization information.
[0097] A merged MySQL instance generation unit is used to merge the original MySQL instances that match the resource requirements to generate at least one merged MySQL instance.
[0098] The unit for generating a set of MySQL instances to be synchronized is used to integrate the various merged MySQL instances to generate the set of MySQL instances to be synchronized.
[0099] Furthermore, the server deployment module 430 includes:
[0100] The metadata list construction unit is used to construct a metadata list based on the information of the server to be deployed and each of the original MySQL instances;
[0101] A real-time monitoring unit is used to monitor the status values of each original MySQL instance in the metadata list in real time through the server to be deployed;
[0102] The deployment scheme determination unit is used to determine the deployment scheme of each of the original MySQL instances based on the state values.
[0103] Furthermore, the deployment scheme determination unit includes:
[0104] The first high availability scheme determination subunit is used to determine the deployment scheme as the first high availability scheme when the status value is MySQL5;
[0105] The second high availability scheme determination subunit is used to determine the deployment scheme as the second high availability scheme when the status value is MySQL8.
[0106] Furthermore, the server deployment device 400 includes:
[0107] The backup data detection module is used to detect whether backup data for 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 on the original server, and shut down the original server if the backup data does not exist on the original server.
[0109] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the above-described apparatus and modules can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0110] The aforementioned device can be implemented as a computer program, which can be used in, for example... Figure 6 It runs on the computer device shown.
[0111] Please see Figure 6 , Figure 6 This is a schematic block diagram illustrating the structure of a computer device according to an embodiment of this application. The computer device may be a server.
[0112] SeeFigure 6 The computer device includes a processor, memory, and network interface connected via a system bus, wherein the memory may include non-volatile storage media and internal memory.
[0113] Non-volatile storage media can store operating systems and computer programs. These computer programs include program instructions that, when executed, cause the processor to perform any server deployment method.
[0114] The processor provides computing and control capabilities, supporting the operation of the entire computer device.
[0115] Internal memory provides an environment for the execution of computer programs stored in non-volatile storage media. When these computer programs are executed by a processor, the processor can perform any server deployment method.
[0116] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0117] It should be understood that the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.
[0118] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps:
[0119] Obtain the original server information of the original server, and based on the 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.
[0120] Obtain the server information to be deployed, and construct a server script framework based on the original server information and the server information to be deployed;
[0121] The server to be deployed monitors each of the original MySQL instances in the set of MySQL instances to be synchronized, determines the deployment plan, and deploys the set of MySQL instances to be synchronized to the server to be deployed using the server script framework and the deployment plan.
[0122] In one embodiment, the server information to be deployed is obtained, and based on the original server information and the server information to be deployed, a server script framework is constructed to implement:
[0123] Extract the configuration information to be deployed from the server information to be deployed, and 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;
[0124] Based on the configuration information to be deployed and the original configuration information, the configuration differences are determined;
[0125] Based on the configuration differences, a server configuration script for the server to be deployed is generated;
[0126] By combining the original configuration information and the configuration to be deployed information with the server configuration script, the server script framework is generated.
[0127] In one embodiment, the original configuration information and the configuration information to be deployed are concatenated based on the differences between the server configuration script and the configuration to generate the server script framework, which is used to achieve:
[0128] Create a basic script framework, wherein the basic script framework includes general server configuration information and general server security parameters;
[0129] Based on the differences between the server configuration script and the configuration, the general server configuration information and / or general server security parameters are added to and / or modified in the basic script framework to generate the server script framework.
[0130] In one embodiment, the original server information of the original server is obtained. Based on the load information and disk usage information in the original server information, the original MySQL instances in the original server are merged to generate a set of MySQL instances to be synchronized, which is used to achieve:
[0131] Monitor the CPU utilization information, memory utilization information, and disk I / O information of the original server, wherein the memory utilization information and the CPU utilization information are part of the load information, and the disk I / O information is part of the disk utilization information;
[0132] Based on the load information and the disk usage information, assess the resource requirements of each of the original MySQL instances;
[0133] The original MySQL instances that match the resource requirements are merged to generate at least one merged MySQL instance;
[0134] The various merged MySQL instances are integrated to generate the set of MySQL instances to be synchronized.
[0135] In one embodiment, the deployment server monitors each of the original MySQL instances in the set of MySQL instances to be synchronized to determine the deployment plan, which is used to achieve:
[0136] Based on the information of the servers to be deployed and each of the original MySQL instances, construct a metadata list;
[0137] The status values of each original MySQL instance in the metadata list are monitored in real time by the server to be deployed.
[0138] Based on the stated status values, the deployment scheme for each of the original MySQL instances is determined.
[0139] In one embodiment, based on each of the stated state values, a deployment scheme for each of the original MySQL instances is determined to achieve:
[0140] When the status value is MySQL5, the deployment scheme is determined to be the first high availability scheme;
[0141] When the status value is MySQL8, the deployment scheme is determined to be the second high availability scheme.
[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 then deploys the set of MySQL instances to be synchronized to the server to be deployed using the server script framework and the deployment plan. This is used to achieve the following:
[0143] Check if backup data for each of the original MySQL instances exists in the original server;
[0144] If the backup data is not present on the original server, then each original MySQL instance is backed up, the backup data is stored on the original server, and the original server is shut down.
[0145] The embodiments of this application also provide a computer-readable storage medium storing a computer program, the computer program including program instructions, and the processor executing the program instructions to implement any of the server deployment methods provided in the embodiments of this application.
[0146] The computer-readable storage medium can be an internal storage unit of the computer device described in the foregoing embodiments, such as the hard disk or memory of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device.
[0147] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A server deployment method, characterized in that, include: Obtain the original server information of the original server, and based on the 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. Obtain the server information to be deployed, and construct a server script framework based on the original server information and the server information to be deployed; The server to be deployed monitors each of the original MySQL instances in the set of MySQL instances to be synchronized, determines the deployment plan, and deploys the set of MySQL instances to be synchronized to the server to be deployed using the server script framework and the deployment plan. The step of obtaining the information of the server to be deployed and constructing a server script framework based on the original server information and the information of the server to be deployed includes: Extract the configuration information to be deployed from the server information to be deployed, and 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; Based on the configuration information to be deployed and the original configuration information, the configuration differences are determined; Based on the configuration differences, a server configuration script for the server to be deployed is generated; By combining the differences between the server configuration script and the configuration, the original configuration information and the configuration information to be deployed are concatenated to generate the server script framework; The step of monitoring each of the original MySQL instances in the set of MySQL instances to be synchronized through the server to be deployed, and determining the deployment plan, includes: Based on the information of the servers to be deployed and each of the original MySQL instances, construct a metadata list; The status values of each original MySQL instance in the metadata list are monitored in real time by the server to be deployed. Based on the stated status values, the deployment scheme for each of the original MySQL instances is determined.
2. The server deployment method according to claim 1, characterized in that, The step of concatenating the original configuration information and the configuration information to be deployed by comparing the server configuration script with the configuration to generate the server script framework includes: Create a basic script framework, wherein the basic script framework includes general server configuration information and general server security parameters; Based on the differences between the server configuration script and the configuration, the general server configuration information and / or general server security parameters are added to and / or modified in the basic script framework to generate the server script framework.
3. The server deployment method according to claim 1, characterized in that, The process involves obtaining the original server information, and based on the load and disk usage information within that information, merging the original MySQL instances on the original server to generate a set of MySQL instances to be synchronized, including: Monitor the CPU utilization information, memory utilization information, and disk I / O information of the original server, wherein the memory utilization information and the CPU utilization information are part of the load information, and the disk I / O information is part of the disk utilization information; Based on the load information and the disk usage information, assess the resource requirements of each of the original MySQL instances; The original MySQL instances that match the resource requirements are merged to generate at least one merged MySQL instance; The various merged MySQL instances are integrated to generate the set of MySQL instances to be synchronized.
4. The server deployment method according to claim 1, characterized in that, The step of determining the deployment scheme for each of the original MySQL instances based on each of the aforementioned state values includes: When the status value is MySQL5, the deployment scheme is determined to be the first high availability scheme; When the status value is MySQL8, the deployment scheme is determined to be the second high availability scheme.
5. The server deployment method according to any one of claims 1 to 4, characterized in that, The step of monitoring each original MySQL instance in the set of MySQL instances to be synchronized through the server to be deployed, determining the deployment plan, and then deploying the set of MySQL instances to be synchronized to the server to be deployed using the server script framework and the deployment plan includes: Check if backup data for each of the original MySQL instances exists in the original server; If the backup data is not present on the original server, then each original MySQL instance is backed up, the backup data is stored on the original server, and the original server is shut down.
6. A server deployment apparatus, characterized in that, include: The module for generating a set of MySQL instances to be synchronized is used to obtain the original server information of the original server, and based on the 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. The server script framework building module is used to obtain the server information to be deployed and to build the server script framework based on the original server information and the server information to be deployed. 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. The server script framework construction module includes: The configuration information extraction unit is 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; A configuration difference determination unit is used to determine configuration differences based on the configuration information to be deployed and the original configuration information; The server configuration script generation unit is used to generate the server configuration script for the server to be deployed based on the configuration differences. The server script framework generation unit is used to combine the original configuration information and the configuration information to be deployed by means of the differences between the server configuration script and the configuration to generate the server script framework. The server deployment module includes: The metadata list construction unit is used to construct a metadata list based on the information of the server to be deployed and each of the original MySQL instances; A real-time monitoring unit is used to monitor the status values of each original MySQL instance in the metadata list in real time through the server to be deployed; The deployment scheme determination unit is used to determine the deployment scheme of each of the original MySQL instances based on the state values.
7. 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, in executing the computer program, implement the server deployment method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to implement the server deployment method as described in any one of claims 1 to 5.
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