Operation and maintenance method and device of distributed database, electronic equipment and storage medium

By receiving operation and maintenance requests, obtaining server information, determining the target server set and automatically replacing servers in a distributed database environment, the problem of inefficient server replacement and disaster recovery management in distributed databases is solved, and efficient operation and maintenance and improvement are achieved. It improves the high availability and horizontal scalability of the system.

CN119336846APending Publication Date: 2025-01-21JINZHUAN INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411447143.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

In a distributed database environment, server replacement and disaster recovery management have problems such as inefficiency and high cost, especially when the server performance is insufficient or physically damaged, a large amount of manpower and financial resources are required to replace it, and during the replacement process, the actual disaster recovery is actually done. The node will be in a reduced state for a long time.

Method used

Provides a distributed database operation and maintenance method. By receiving target operation and maintenance requests, it obtains server information in the second server set, determines the target server set, and automatically replaces servers based on this information to reduce manpower and material expenditures and improve Operation and maintenance efficiency.

Benefits of technology

This method can automatically determine and replace the server where the distributed database node is located when receiving the target operation and maintenance request of the distributed database, which reduces the expenditure of manpower and material resources, improves the operation and maintenance efficiency of the distributed database, and enhances high availability. and horizontal scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336846A_ABST
    Figure CN119336846A_ABST
Patent Text Reader

Abstract

The invention relates to an operation and maintenance method and device for a distributed database, electronic equipment and a storage medium, and the method comprises the steps: receiving a target operation and maintenance request corresponding to the distributed database, and deploying each node of the distributed database in each first server in a first server set; obtaining server information corresponding to each second server in the second server set, wherein all first servers in the first server set belong to the second server set; for each first server in the first server set, according to the server information corresponding to each second server in the second server set, determining a target server corresponding to the first server from the second server set to obtain a target server set corresponding to the first server set; and replacing each first server in the first server set according to the determined target server set. According to the method, the expenditure of manpower and material resources is reduced, and the operation and maintenance efficiency of the distributed database is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of database technology, and in particular to a distributed database operation and maintenance method, device, electronic device and storage medium. Background Art

[0002] With the development and popularization of the Internet, the amount of data in corporate business continues to increase. Faced with real-time business needs in massive data scenarios, traditional stand-alone databases have reached performance bottlenecks. More and more companies choose to use distributed databases composed of multiple nodes to complete the storage and processing of business data.

[0003] However, it is inevitable that the production environment needs to replace servers. For example, physically damaged servers cannot be restored, and the components on the server need to be replaced with new servers; normal servers have insufficient performance and need to be replaced with high-performance servers; distributed node networking needs to be adjusted and relocated, etc. In any of the above situations, a lot of manpower and financial resources need to be invested to replace the server, and during the replacement process, the actual disaster recovery nodes will be in a reduced state for a long time. Therefore, an efficient solution for the operation and maintenance of distributed databases is needed. Summary of the invention

[0004] In view of this, in order to solve the above-mentioned technical problems or part of the technical problems, the embodiments of the present application provide a distributed database operation and maintenance method, device, electronic device and storage medium.

[0005] In a first aspect, the present application provides an operation and maintenance method of a distributed database, comprising:

[0006] receiving a target operation and maintenance request corresponding to a distributed database, wherein the target operation and maintenance request is used to replace each first server in a first server set, and each node of the distributed database is deployed in each first server in the first server set;

[0007] Acquire server information corresponding to each second server in a second server set, wherein all the first servers in the first server set belong to the second server set;

[0008] For each of the first servers in the first server set, according to the server information corresponding to each of the second servers in the second server set, determining a target server corresponding to the first server from the second server set to obtain a target server set corresponding to the first server set, wherein the target server is used to represent a server that replaces the first server;

[0009] Each of the first servers in the first server set is replaced according to the determined target server set.

[0010] In an optional implementation, the target operation and maintenance request includes a first preset screening condition corresponding to each of the first servers in the first server set;

[0011] The determining, from the second server set, a target server corresponding to the first server according to the server information corresponding to each of the second servers in the second server set includes:

[0012] According to the server information corresponding to each of the second servers in the second server set, determine from the second server set all the second servers that meet the first preset screening condition corresponding to the first server, so as to obtain a candidate server set corresponding to the first server;

[0013] For each second server in the candidate server set, scoring the second server according to the server information corresponding to the second server to obtain a target score corresponding to the second server;

[0014] A target server corresponding to the first server is determined from the candidate server set according to the target scores corresponding to all the second servers in the candidate server set.

[0015] In an optional implementation, determining a target server corresponding to the first server from the candidate server set according to the target scores corresponding to all the second servers in the candidate server set includes:

[0016] According to the target scores corresponding to all the second servers in the candidate server set, determining the second server corresponding to the maximum target score from the candidate server set;

[0017] The second server corresponding to the largest target score in the candidate server set is determined as the target server corresponding to the first server.

[0018] In an optional implementation, the replacing each of the first servers in the first server set according to the determined target server set includes:

[0019] After obtaining the target server set corresponding to the first server set, determining whether the same target server exists in the target server set;

[0020] When the same target server exists in the target server set, determining the priority of the first server corresponding to each of the same target servers according to the priorities of all nodes of the distributed database deployed in the first server corresponding to each of the same target servers;

[0021] The target server corresponding to the first server with the highest priority is reserved, and the target servers corresponding to the same first servers are re-determined from the candidate server sets corresponding to the other same first servers in descending order of priority of the first servers, so that the updated target server set does not contain the same target server;

[0022] Each of the first servers in the first server set is replaced according to the updated target server set.

[0023] In an optional implementation, determining, from the second server set, all second servers that meet the first preset screening condition corresponding to the first server according to the server information corresponding to each second server in the second server set, to obtain a candidate server set corresponding to the first server, includes:

[0024] According to the server information corresponding to each of the second servers in the second server set, determining all the second servers that meet the first preset screening condition corresponding to the first server from the second server set;

[0025] Determine all the second servers that meet a second preset screening condition from all the determined second servers, where the second preset screening condition includes that all nodes of the distributed database deployed in the first server can be deployed in the second server;

[0026] All the second servers that meet the second preset screening condition are determined as a candidate server set corresponding to the first server.

[0027] In an optional implementation, the server information includes attribute information of each remaining resource;

[0028] Scoring the second server according to the server information corresponding to the second server to obtain a target score corresponding to the second server includes:

[0029] Determine a preset weight of each of the remaining resource attribute information corresponding to the second server;

[0030] Determine a target weight sum between all the remaining resource attribute information corresponding to the second server and all the determined preset weights;

[0031] The sum of the target weights is determined as a target score corresponding to the second server.

[0032] In an optional implementation, the receiving a target operation and maintenance request corresponding to the distributed database includes:

[0033] Display the target operation and maintenance interface corresponding to the distributed database;

[0034] When a trigger operation on a first control in the target operation and maintenance interface is detected, it is determined to receive a target operation and maintenance request corresponding to the distributed database, and the first control is used to replace each of the first servers in the first server set corresponding to the distributed database.

[0035] In a second aspect, the present application provides an operation and maintenance device for a distributed database, including:

[0036] A receiving module, configured to receive a target operation and maintenance request corresponding to a distributed database, wherein the target operation and maintenance request is used to replace each first server in a first server set, and each node of the distributed database is deployed in each first server in the first server set;

[0037] An acquisition module, configured to acquire server information corresponding to each second server in a second server set, wherein all the first servers in the first server set belong to the second server set;

[0038] a determination module, configured to determine, for each of the first servers in the first server set, a target server corresponding to the first server from the second server set according to the server information corresponding to each of the second servers in the second server set, so as to obtain a target server set corresponding to the first server set, wherein the target server is used to represent a server to be replaced with the first server;

[0039] A replacement module is used to replace each of the first servers in the first server set according to the determined target server set.

[0040] In a third aspect, the present application provides an electronic device, comprising: a processor and a memory, wherein the processor is used to execute an operation and maintenance program of a distributed database stored in the memory to implement the operation and maintenance method of the distributed database as described above.

[0041] In a fourth aspect, the present application also provides a storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the operation and maintenance method of the distributed database as described above.

[0042] The above-mentioned technical scheme provided by the embodiment of the present application has the following advantages compared with the prior art. The method provided by the embodiment of the present application includes: receiving a target operation and maintenance request corresponding to a distributed database, the target operation and maintenance request is used to replace each first server in a first server set, and each node in the distributed database is deployed in each first server in the first server set; obtaining server information corresponding to each second server in a second server set, and all first servers in the first server set belong to the second server set; for each first server in the first server set, according to the server information corresponding to each second server in the second server set, determining the target server corresponding to the first server from the second server set to obtain the target server set corresponding to the first server set, and the target server is used to represent the server that replaces the first server; and replacing each first server in the first server set according to the determined target server set. Through the above method, when the embodiment of the present application receives a target operation and maintenance request corresponding to a distributed database, it can obtain the server information corresponding to each second server in the currently existing second server set, so as to determine all target servers from the second server set that can replace each first server of the node deployed with the distributed database based on all the acquired server information, thereby automatically changing all the first servers using all the determined target servers, reducing the expenditure of manpower and material resources, improving the operation and maintenance efficiency of the distributed database, and enhancing the high availability and horizontal expansion capabilities of the distributed database. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0045] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0046] Figure 1 A schematic diagram of a flow chart of a distributed database operation and maintenance method provided in an embodiment of the present application;

[0047] Figure 2 A flowchart of another distributed database operation and maintenance method provided in an embodiment of the present application;

[0048] Figure 3 A schematic diagram of a distributed database structure provided in an embodiment of the present application;

[0049] Figure 4 A schematic diagram of the structure of an automated replacement server provided in an embodiment of the present application;

[0050] Figure 5 A flowchart of another distributed database operation and maintenance method provided in an embodiment of the present application;

[0051] Figure 6 A schematic diagram of the structure of an operation and maintenance device for a distributed database provided in an embodiment of the present application;

[0052] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0053] In the above attached figure:

[0054] 10. Receiving module; 20. Acquisition module; 30. Determination module; 40. Replacement module;

[0055] 700, electronic device; 701, processor; 702, memory; 7021, operating system; 7022, application; 703, user interface; 704, network interface; 705, bus system. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings 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 making creative work are within the scope of protection of this application.

[0057] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0058] refer to Figure 1 , Figure 1 A schematic diagram of a flow chart of a distributed database operation and maintenance method provided in an embodiment of the present application. The distributed database operation and maintenance method provided in the present application comprises the following steps:

[0059] S101: Receive a target operation and maintenance request corresponding to a distributed database.

[0060] In this embodiment, the target operation and maintenance request is used to replace each first server in the first server set, and each node of the distributed database is deployed in each first server in the first server set. Figure 3 As shown in the schematic diagram of the distributed database structure, the distributed database can be composed of data nodes, management nodes, computing nodes, global transaction nodes and middleware nodes. Each node of the above distributed database is deployed in each first server in the first server set.

[0061] The target operation and maintenance request corresponding to the distributed database may be determined by:

[0062] Display the target operation and maintenance interface corresponding to the distributed database;

[0063] When a trigger operation on a first control of a target operation and maintenance interface is detected, it is determined that a target operation and maintenance request corresponding to a distributed database is received, and the first control is used to replace each first server in a first server set corresponding to the distributed database.

[0064] Specifically, the target operation and maintenance interface is actually an interface for automatically replacing each first server in the first server set. A first control is provided in the target operation and maintenance interface. When the database administrator triggers the first control in the target operation and maintenance interface, the target operation and maintenance request corresponding to the distributed database can be automatically triggered, so that when the target operation and maintenance request corresponding to the distributed database is received, each first server in the first server set can be automatically replaced.

[0065] It should be noted that the execution subject of the method is a server, which can be composed of a collection module, a management module, an optimization module, a concurrent processing module and an execution module. Figure 4The schematic diagram of the structure of the automatic replacement of the server is shown. Step S101 in this embodiment is executed by the management module. After the management module is executed, information is exchanged with the acquisition module, the optimization module, the concurrent processing module and the execution module in the server to automatically complete the replacement of each first server in the first server set. Specifically, the management module provides an operation and maintenance website entrance to provide operation and maintenance functions such as metadata management, operation and maintenance request response, configuration management and statistical management.

[0066] S102: Obtain server information corresponding to each second server in the second server set.

[0067] In this embodiment, the second server set is composed of all second servers in the production environment, and all first servers in the first server set belong to the second server set. The acquisition module mentioned above is distributed on each second server in the second server set in an agent manner to collect server information of each second server. Among them, the server information may include current usage, node deployment, physical information (memory information, disk information, network card information and structure information), memory usage, disk usage, CPU binding information, the city where the server is located, the available zone and rack, etc. All second servers in the second server set except the first server set are used to replace each first server in the first server set to ensure that the distributed database has high availability and horizontal expansion capabilities.

[0068] The collection module collects server information corresponding to each second server in the second server set at regular intervals, and maintains the server information corresponding to each second server in the second server set in the management module.

[0069] S103: For each first server in the first server set, according to server information corresponding to each second server in the second server set, determine a target server corresponding to the first server from the second server set to obtain a target server set corresponding to the first server set.

[0070] In this embodiment, after the management module obtains the server information corresponding to each second server in the second server set, the management module may send the server information corresponding to each second server in the second server set to the optimization module, so that the optimization module optimizes the replacement plan of each first server in the first server set according to the server information corresponding to each second server in the second server information set, so as to improve the stability and overall performance of the system.

[0071] Specifically, the target server is used to represent the server that replaces the first server. In this embodiment, the first server can be regarded as the server to be changed, and the target server can be regarded as the new server that replaces the first server. The mapping relationship between the first server and the target server is maintained in the management module. Specifically, the mapping relationship is maintained in the management module in the form of a key-value pair. The key is the first server, and the value is the target server. After the optimization module determines the target server corresponding to each first server in the first server set, the correspondence between each first server and the target server can be sent to the management module, so that the management module updates the above mapping relationship, so that the management module can implement the change of each first server in the first server set according to the updated mapping relationship.

[0072] S104: Replace each first server in the first server set according to the determined target server set.

[0073] In this embodiment, after the management module completes the update of the mapping relationship, the management module sends the updated mapping relationship to the concurrent processing module, so that the concurrent processing module can establish a link with the proxy process in the corresponding destination node according to the request content and the request destination, and then concurrently send the execution module to the destination node. After the execution module is distributed to the destination node, the destination node is reduced or expanded to achieve the purpose of replacing the server.

[0074] Among them, after the execution module reaches the destination node, if the execution module is on the first server, the components corresponding to all nodes on the first server will be deleted; if the execution module is on the target server, the components corresponding to the nodes will be rebuilt according to the node deployment information on the corresponding first server. These components include stateless components and stateful components. Stateful components such as data nodes will be restored to their original state by backup and recovery after the reconstruction is completed. After the execution of the execution module is completed, the execution module returns the execution progress at a fixed time. After the management module finds that the execution of the execution module is completed, the task is terminated.

[0075] The present embodiment provides an operation and maintenance method for a distributed database. When a target operation and maintenance request corresponding to the distributed database is received, server information corresponding to each second server in the currently existing second server set can be obtained, so as to determine all target servers from the second server set that can replace each first server of the node deployed with the distributed database based on all the acquired server information, thereby automatically changing all the first servers using all the determined target servers, reducing the expenditure of manpower and material resources, improving the operation and maintenance efficiency of the distributed database, and enhancing the high availability and horizontal expansion capability of the distributed database.

[0076] refer to Figure 2 , Figure 2 A schematic diagram of a flow chart of another distributed database operation and maintenance method provided in an embodiment of the present application. The present application provides a distributed database operation and maintenance method, comprising the following steps:

[0077] S201: Receive a target operation and maintenance request corresponding to a distributed database.

[0078] S202: Obtain server information corresponding to each second server in the second server set.

[0079] In this embodiment, step S201 is consistent with the above-mentioned step S101, and step S202 is consistent with the above-mentioned step S102. For details, please refer to the above-mentioned step S101 and step S102, which will not be described in detail in this embodiment.

[0080] S203: For each first server in the first server set, according to the server information corresponding to each second server in the second server set, determine from the second server set all second servers that meet the first preset screening condition corresponding to the first server, so as to obtain a candidate server set corresponding to the first server.

[0081] In this embodiment, the target operation and maintenance request includes a first preset filtering condition corresponding to each first server in the first server set. The first preset filtering condition can be pre-set according to the server information, and the first preset filtering condition can be set according to actual needs, which is not limited in this embodiment. For example, the first preset filtering condition may be an available rack, a target computer room, and a lower limit of the number of idle CPU cores. After obtaining the server information corresponding to each second server in the second server set, for each first server in each first server set, the first preset filtering condition corresponding to the first server and all the determined server information can be used to determine from the second server set all the second servers whose server information meets the first preset condition, so as to determine all the determined second servers as the candidate server set corresponding to the first server.

[0082] After obtaining the candidate server set corresponding to each first server in the first server set, for each first server in the first server set, each second server in the candidate server set can be scored according to the server information corresponding to each second server in the candidate server set corresponding to the first server, so as to obtain the target score corresponding to each second server in the candidate server set, and according to the target scores corresponding to all the second servers in the candidate server set, determine the second server that can replace the first server from the candidate server set, and determine the second server as the target server.

[0083] In this embodiment, in order to accurately determine the candidate server set corresponding to the first server, thereby ensuring the subsequent successful replacement of the first server, in step S203 of this embodiment, all second servers that meet the first preset screening condition corresponding to the first server are determined from the second server set according to the server information corresponding to each second server in the second server set, so as to obtain the candidate server set corresponding to the first server, specifically including:

[0084] According to the server information corresponding to each second server in the second server set, determining all second servers that meet the first preset screening condition corresponding to the first server from the second server set;

[0085] Determine all second servers that meet a second preset screening condition from all the determined second servers, where the second preset screening condition includes that all nodes of the distributed database deployed on the first server can be deployed on the second server;

[0086] All second servers that meet the second preset condition are determined as a candidate server set corresponding to the first server.

[0087] Among them, the method for determining all the second servers that meet the first preset screening condition corresponding to the first server can refer to the above description, and will not be repeated in this embodiment. In order to avoid the target server finally determined to be unsuitable for deploying the node of the distributed database, thereby affecting the high availability of the distributed database, so, in this embodiment, after obtaining all the second servers that meet the first preset screening condition corresponding to the first server, all the second servers that can deploy the same nodes as the nodes of the distributed data deployed in the first server are determined from all the determined second servers, so that all the second servers screened again are determined as the candidate server set. It should be noted that the above steps are performed by the optimization module.

[0088] S204: For each second server in the candidate server set, score the second server according to the server information corresponding to the second server to obtain a target score corresponding to the second server.

[0089] In this embodiment, the server information may also include various remaining resource attribute information. Among them, the remaining resource attribute information may include remaining memory, remaining disk space, and remaining number of CPU cores. In the above, according to the server information corresponding to the second server, the second server is scored to obtain the target score corresponding to the second server, specifically including:

[0090] Determine the preset weight of each remaining resource attribute information corresponding to the second server;

[0091] Determine a target weight sum between all remaining resource attribute information corresponding to the second server and all determined preset weights;

[0092] The target weights and the target score corresponding to the second server are determined.

[0093] Specifically, the preset weight corresponding to the remaining resource attribute information can be set according to actual needs, and is not limited in this embodiment. After obtaining the remaining resource attribute information corresponding to the second server, the remaining resource attribute information can be standardized to ensure that the data is compared in the same dimension. After standardizing the remaining resource attribute information, the target weight sum between each standardized remaining resource attribute information and all the determined preset weights is determined, thereby obtaining the target score corresponding to the second server. For example. The remaining resource attribute information corresponding to the second server is A, B and C, and the remaining resource attribute information A is standardized to obtain A1, the remaining resource attribute information B is standardized to obtain B1, and the remaining resource information C is standardized to obtain C1. The preset weight corresponding to the remaining resource attribute information A is w1, the preset weight corresponding to the remaining resource attribute information B is w2, and the preset weight corresponding to the remaining resource attribute information C is w3. Then the target score corresponding to the second server is A1*w1+B1*w2+C1*w3.

[0094] S205: Determine a target server corresponding to the first server from the candidate server set according to the target scores corresponding to all second servers in the candidate server set.

[0095] In this embodiment, after obtaining the target scores corresponding to all second servers in the candidate server set, the target scores corresponding to all second servers in the candidate server set can be compared, so as to determine the second server that can replace the first server from the candidate server set, and determine the determined second server as the target server.

[0096] Wherein, in step S205, determining the target server corresponding to the first server from the candidate server set according to the target scores corresponding to all the second servers in the candidate server set includes:

[0097] According to the target scores corresponding to all second servers in the candidate server set, determining the second server corresponding to the maximum target score from the candidate server set;

[0098] The second server corresponding to the largest target score in the candidate server set is determined as the target server corresponding to the first server.

[0099] Specifically, in order to successfully replace the first server, after obtaining the target scores corresponding to all second servers in the candidate server set, the second server corresponding to the largest target score is determined from the candidate server set. The second server corresponding to the largest target score has a sufficiently good deployment environment relatively speaking, so the second server corresponding to the largest target score is regarded as the target server to achieve successful replacement of the first server.

[0100] S206: Replace each first server in the first server set according to the determined target server set.

[0101] In this embodiment, in order to avoid the target servers for replacing the first servers in the first server set from intersecting and thus affecting the subsequent successful replacement of the target servers, in step S206 of this embodiment, the first servers in the first server set are replaced according to the determined target server set, specifically including:

[0102] After obtaining the target server set corresponding to the first server set, determining whether there is an identical target server in the target server set;

[0103] When there is no identical target server in the target server set, each first server in the first server set is replaced according to the determined target server set;

[0104] When the same target server exists in the target server set, the priority of the first server corresponding to each of the same target servers is determined according to the priorities of all nodes of the distributed database deployed in the first server corresponding to each of the same target servers;

[0105] The target server corresponding to the first server with the highest priority is reserved, and the target servers corresponding to the same first servers are re-determined from the candidate server sets corresponding to the other same first servers in descending order of priority of the first servers, so that there is no same target server in the updated target server set;

[0106] Each first server in the first server set is replaced according to the updated target server set.

[0107] Among them, when there are no identical target servers in the target server set, it indicates that there is no intersection in the determined target server set, and the determined target server set can be used at this time without affecting the replacement of each first server in the first server set. When there are identical target servers in the target server set, it indicates that there is an intersection in the determined target server set, and the use of the determined target server set may affect the replacement of each first server in the first server set, so it is necessary to update the target server set to ensure that there is no intersection in the updated target server set, so that the use of the updated target server set will not affect the replacement of each first server in the first server set.

[0108] Specifically, when updating the target server set, for each identical target server in the target server set, first determine the priority of all nodes in the first server corresponding to the target server deployed in the distributed database, and then use the node priority as the priority of the first server, and compare the priorities of each identical target server to determine the first server with the highest priority, and retain the target server corresponding to the first server with the highest priority. For first servers of other priorities, reselect the target server corresponding to the first server from the candidate server set corresponding to the first server in order from high to low priority, so that there are no identical target servers in the target server set, thereby completing the update of the target server set, and then use the updated target server set to replace each first server in the first server set.

[0109] In the above, the priority of the node can be set according to actual needs, and the node priority setting method is not described in detail in this embodiment. For example, there are three identical target servers in the target server set, the first server corresponding to one target server is A, the first server corresponding to one target server is B, and the first server corresponding to one target server is C. The priority of the first server A is higher than the priority of the first server B, and the priority of the first server B is higher than the priority of the first server C, so the target server corresponding to the first server A is retained, and the second server corresponding to the second largest target score is determined from the candidate server set corresponding to the first server B as the target server corresponding to the first server B, and the second server that is different from the target servers corresponding to the first server A and the first server B is determined from the candidate server set corresponding to the first server C in order of target scores from high to low as the target server corresponding to the first server C, thereby completing the update of the target server set.

[0110] The present embodiment provides an operation and maintenance method for a distributed database. When a target operation and maintenance request corresponding to the distributed database is received, server information corresponding to each second server in the currently existing second server set can be obtained, so as to determine all target servers from the second server set that can replace each first server of the node deployed with the distributed database based on all the acquired server information, thereby automatically changing all the first servers using all the determined target servers, reducing the expenditure of manpower and material resources, improving the operation and maintenance efficiency of the distributed database, and enhancing the high availability and horizontal expansion capability of the distributed database.

[0111] As an example, refer to Figure 5 As shown in the figure, the operation and maintenance process of the entire distributed database is introduced in detail as follows:

[0112] (1) The DBA (distributed database administrator) receives an instruction to replace the server.

[0113] (2) The DBA configures the list of servers to be replaced through the distributed database operation and maintenance page. The components deployed on these servers include any combination of the following: data nodes, computing nodes, management nodes, global transaction nodes, and middleware. Some of these nodes are stateful and some are stateless.

[0114] (3) The DBA manually configures the new server corresponding to the server to be replaced, and the management module maintains the mapping relationship. The mapping relationship is maintained in the management module in the form of key-value pairs. The key is the IP address of the server to be replaced, and the value is the new server corresponding to the server to be replaced. The management module maintains all the information of the server pointed to by the key and value, which will be used in the server replacement process.

[0115] (4) If the DBA is configured to automatically select the optimal server, the DBA only needs to provide the first preset screening condition corresponding to the server to be replaced, and the management module will automatically select a new server and form a mapping relationship through the automatically deployed optimization module. The mapping relationship is maintained in the management module in the form of a key-value pair. The key is the IP address of the server to be replaced, and the value is the optimal new server generated according to the rules. The new server selection rules are as follows:

[0116] The management module maintains the information of all servers (hosts) inside. These hosts are stored in the host pool. The hosts in the pool contain a series of tags, including current usage, component deployment, physical information of the host (memory information, disk information, network card information, architecture information), memory usage, disk usage, CPU binding, host city, availability zone (AZ), rack, etc. When the change request is passed to the optimization module, the optimization module first filters out candidate hosts according to the first preset screening condition in the request. The module will maintain a list of candidate service hosts for each server to be replaced. These conditions can be: available rack, target computer room and lower limit of idle cores, etc. Secondly, the optimization module will sort the hosts according to the remaining resources of the hosts. The sorting method refers to the remaining memory, remaining disk space, remaining CPU cores, network congestion, etc. After standardizing these indicators, ensure that the data is compared on the same dimension, and finally calculate the candidate host score through a fixed weight. The optimization module selects the host with the highest score for the server to be replaced while meeting the minimum hardware requirements. In addition, there are also some preconditions (and the second preset screening conditions), that is, the hard condition that the components of some nodes cannot be deployed on a host at the same time, which will be screened out by the optimization module during screening. In a replacement request, the host score will only appear once. After the optimization module obtains the score, if there is an intersection in the candidate host lists of multiple servers to be replaced. A new host will be assigned to it according to the priority of the node deployed on the server to be replaced, and the optimization module will finally obtain the mapping relationship.

[0117] (5) The mapping relationship is passed to the concurrent processing module, which builds a link with the agent process in the corresponding destination node based on the request content and request destination, and then sends the execution module concurrently. The agent process is deployed on all hosts, monitors the host resource utilization in real time, and builds a link with the collection module. The collection module collects the status information of each host regularly and allows the management module to maintain it in its own data source.

[0118] (6) After the execution module is sent to the destination node, the destination node is scaled down or expanded to achieve the purpose of replacing the server with a component. After the execution module arrives at the target node, it performs corresponding actions based on the initial request to replace the server and the host where it is located. That is, when the execution module is on the replacement server, it will delete all corresponding database components on the server; when it is on the new server, it will rebuild the database components based on the deployment information on the old server. These components include stateless components and stateful components. Stateful components such as data nodes will be restored to their original state by backup and recovery after the reconstruction is completed.

[0119] (7) The execution module returns the execution progress at regular intervals.

[0120] (8) When the management module finds that all execution modules have completed their execution, it ends the task. After the execution modules complete their tasks, the management module will perform cleanup work, including updating the host pool status and performing automated inspections on new servers.

[0121] refer to Figure 6 , Figure 6 A structural diagram of an operation and maintenance device for a distributed database provided in an embodiment of the present application. An operation and maintenance device for a distributed database provided in an embodiment of the present application includes: a receiving module 10, an acquisition module 20, a determination module 30, and a replacement module 40. The receiving module 10 is used to receive a target operation and maintenance request corresponding to a distributed database, and the target operation and maintenance request is used to replace each first server in a first server set, and each node of the distributed database is deployed in each first server in the first server set; the acquisition module 20 is used to obtain server information corresponding to each second server in a second server set, and all the first servers in the first server set belong to the second server set; the determination module 30 is used to determine the target server corresponding to the first server from the second server set according to the server information corresponding to each second server in the second server set for each first server in the first server set, so as to obtain a target server set corresponding to the first server set, and the target server is used to represent the server to be replaced with the first server; the replacement module 40 is used to replace each first server in the first server set according to the determined target server set.

[0122] In this embodiment, the target operation and maintenance request includes a first preset screening condition corresponding to each of the first servers in the first server set.

[0123] In this embodiment, the determination module 30 is further configured to:

[0124] According to the server information corresponding to each of the second servers in the second server set, determine from the second server set all the second servers that meet the first preset screening condition corresponding to the first server, so as to obtain a candidate server set corresponding to the first server;

[0125] For each second server in the candidate server set, scoring the second server according to the server information corresponding to the second server to obtain a target score corresponding to the second server;

[0126] A target server corresponding to the first server is determined from the candidate server set according to the target scores corresponding to all the second servers in the candidate server set.

[0127] In this embodiment, the determination module 30 is further configured to:

[0128] According to the target scores corresponding to all the second servers in the candidate server set, determining the second server corresponding to the maximum target score from the candidate server set;

[0129] The second server corresponding to the largest target score in the candidate server set is determined as the target server corresponding to the first server.

[0130] In this embodiment, the replacement module 40 is also used for:

[0131] After obtaining the target server set corresponding to the first server set, determining whether the same target server exists in the target server set;

[0132] When the same target server exists in the target server set, determining the priority of the first server corresponding to each of the same target servers according to the priorities of all nodes of the distributed database deployed in the first server corresponding to each of the same target servers;

[0133] The target server corresponding to the first server with the highest priority is reserved, and the target servers corresponding to the same first servers are re-determined from the candidate server sets corresponding to the other same first servers in descending order of priority of the first servers, so that the updated target server set does not contain the same target server;

[0134] Each of the first servers in the first server set is replaced according to the updated target server set.

[0135] In this embodiment, the determination module 30 is further configured to:

[0136] According to the server information corresponding to each of the second servers in the second server set, determining all the second servers that meet the first preset screening condition corresponding to the first server from the second server set;

[0137] Determine all the second servers that meet a second preset screening condition from all the determined second servers, where the second preset screening condition includes that all nodes of the distributed database deployed in the first server can be deployed in the second server;

[0138] All the second servers that meet the second preset screening condition are determined as a candidate server set corresponding to the first server.

[0139] In this embodiment, the server information includes attribute information of each remaining resource.

[0140] In this embodiment, the determination module 30 is further configured to:

[0141] Determine a preset weight of each of the remaining resource attribute information corresponding to the second server;

[0142] Determine a target weight sum between all the remaining resource attribute information corresponding to the second server and all the determined preset weights;

[0143] The sum of the target weights is determined as a target score corresponding to the second server.

[0144] In this embodiment, the receiving module 10 is further used for:

[0145] Display the target operation and maintenance interface corresponding to the distributed database;

[0146] When a trigger operation on a first control in the target operation and maintenance interface is detected, it is determined to receive a target operation and maintenance request corresponding to the distributed database, and the first control is used to replace each of the first servers in the first server set corresponding to the distributed database.

[0147] The present embodiment provides an operation and maintenance device for a distributed database. When receiving a target operation and maintenance request corresponding to the distributed database, the device can obtain server information corresponding to each second server in the currently existing second server set, so as to determine all target servers from the second server set that can replace each first server of the node deployed with the distributed database based on all the acquired server information, thereby automatically changing all the first servers using all the determined target servers, reducing the expenditure of manpower and material resources, improving the operation and maintenance efficiency of the distributed database, and enhancing the high availability and horizontal expansion capability of the distributed database.

[0148] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7 The electronic device 700 shown includes: at least one processor 701, a memory 702, at least one network interface 704 and other user interfaces 703. The various components in the electronic device 700 are coupled together via a bus system 705. It is understood that the bus system 705 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 705 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 705 is not described in detail. Figure 7 Various buses are labeled as bus system 705.

[0149] The user interface 703 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touch pad, or a touch screen).

[0150] It can be understood that the memory 702 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct RAM bus random access memory (DRRAM). The memory 702 described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0151] In some implementations, the memory 702 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 7021 and an application 7022 .

[0152] The operating system 7021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application 7022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. The program for implementing the method of the embodiment of the present application can be included in the application 7022.

[0153] In the embodiment of the present application, by calling the program or instructions stored in the memory 702, specifically, the program or instructions stored in the application 7022, the processor 701 is used to execute the method steps provided by each method embodiment.

[0154] The method disclosed in the above embodiment of the present application can be applied to the processor 701, or implemented by the processor 701. The processor 701 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 701 or the instruction in the form of software. The above processor 701 can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software units in the decoding processor can be executed. The software unit can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 702, and the processor 701 reads the information in the memory 702 and completes the steps of the above method in combination with its hardware.

[0155] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPDevice, DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application, or a combination thereof.

[0156] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0157] The electronic device provided in this embodiment may be Figure 7 The electronic device shown in FIG. 1 may perform the following steps: Figure 1 , Figure 2 and Figure 5 All steps of the distributed database operation and maintenance method in Figure 1 , Figure 2 and Figure 5 For details, please refer to the technical effects of the distributed database operation and maintenance method shown in Figure 1 , Figure 2 and Figure 5 For the sake of brevity, the relevant description is not repeated here.

[0158] The embodiment of the present application also provides a storage medium (computer-readable storage medium). The storage medium here stores one or more programs. The storage medium may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state drive; the memory may also include a combination of the above-mentioned types of memory.

[0159] When one or more programs in the storage medium can be executed by one or more processors, the distributed database operation and maintenance method executed on the operation and maintenance device side of the distributed database is implemented.

[0160] The processor is used to execute the distributed database operation and maintenance program stored in the memory to implement the following steps of the distributed database operation and maintenance method executed on the distributed database operation and maintenance device side.

[0161] The professionals should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0162] It should be noted that the phrases "one implementation", "an embodiment", "an exemplary embodiment", "some embodiments", etc. mentioned in the specification indicate that the described embodiments may include certain features, structures or characteristics, but not every embodiment may include the certain features, structures or characteristics. In addition, such phrases do not necessarily refer to the same embodiment. In addition, when describing certain features, structures or characteristics in conjunction with an embodiment, it is within the knowledge of those skilled in the art to implement such features, structures or characteristics in conjunction with other embodiments, whether explicitly or not explicitly described.

[0163] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0164] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A distributed database operation and maintenance method, characterized in that: include: receiving a target operation and maintenance request corresponding to a distributed database, wherein the target operation and maintenance request is used to replace each first server in a first server set, and each node of the distributed database is deployed in each first server in the first server set; Acquire server information corresponding to each second server in a second server set, wherein all the first servers in the first server set belong to the second server set; For each of the first servers in the first server set, according to the server information corresponding to each of the second servers in the second server set, determining a target server corresponding to the first server from the second server set to obtain a target server set corresponding to the first server set, wherein the target server is used to represent a server that replaces the first server; Each of the first servers in the first server set is replaced according to the determined target server set.

2. The method according to claim 1, characterized in that: The target operation and maintenance request includes a first preset screening condition corresponding to each of the first servers in the first server set; The determining, from the second server set, a target server corresponding to the first server according to the server information corresponding to each of the second servers in the second server set includes: According to the server information corresponding to each of the second servers in the second server set, determine from the second server set all the second servers that meet the first preset screening condition corresponding to the first server, so as to obtain a candidate server set corresponding to the first server; For each second server in the candidate server set, scoring the second server according to the server information corresponding to the second server to obtain a target score corresponding to the second server; A target server corresponding to the first server is determined from the candidate server set according to the target scores corresponding to all the second servers in the candidate server set.

3. The method according to claim 2, characterized in that The determining, from the candidate server set, a target server corresponding to the first server according to the target scores corresponding to all the second servers in the candidate server set, comprises: According to the target scores corresponding to all the second servers in the candidate server set, determining the second server corresponding to the maximum target score from the candidate server set; The second server corresponding to the largest target score in the candidate server set is determined as the target server corresponding to the first server.

4. The method according to claim 1, characterized in that: The replacing each of the first servers in the first server set according to the determined target server set includes: After obtaining the target server set corresponding to the first server set, determining whether the same target server exists in the target server set; When the same target server exists in the target server set, determining the priority of the first server corresponding to each of the same target servers according to the priorities of all nodes of the distributed database deployed in the first server corresponding to each of the same target servers; The target server corresponding to the first server with the highest priority is reserved, and the target servers corresponding to the same first servers are re-determined from the candidate server sets corresponding to the other same first servers in descending order of priority of the first servers, so that the updated target server set does not contain the same target server; Each of the first servers in the first server set is replaced according to the updated target server set.

5. The method according to claim 2, characterized in that: The determining, from the second server set according to the server information corresponding to each of the second servers in the second server set, all the second servers that meet the first preset screening condition corresponding to the first server to obtain a candidate server set corresponding to the first server includes: According to the server information corresponding to each of the second servers in the second server set, determining all the second servers that meet the first preset screening condition corresponding to the first server from the second server set; Determine all the second servers that meet a second preset screening condition from all the determined second servers, where the second preset screening condition includes that all nodes of the distributed database deployed in the first server can be deployed in the second server; All the second servers that meet the second preset screening condition are determined as a candidate server set corresponding to the first server.

6. The method according to claim 2, characterized in that The server information includes attribute information of each remaining resource; Scoring the second server according to the server information corresponding to the second server to obtain a target score corresponding to the second server includes: Determine a preset weight of each of the remaining resource attribute information corresponding to the second server; Determine a target weight sum between all the remaining resource attribute information corresponding to the second server and all the determined preset weights; The sum of the target weights is determined as a target score corresponding to the second server.

7. The method according to claim 1, characterized in that The receiving a target operation and maintenance request corresponding to the distributed database includes: Display the target operation and maintenance interface corresponding to the distributed database; When a trigger operation on a first control in the target operation and maintenance interface is detected, it is determined to receive a target operation and maintenance request corresponding to the distributed database, and the first control is used to replace each of the first servers in the first server set corresponding to the distributed database.

8. An operation and maintenance device for a distributed database, characterized in that: include: A receiving module, configured to receive a target operation and maintenance request corresponding to a distributed database, wherein the target operation and maintenance request is used to replace each first server in a first server set, and each node of the distributed database is deployed in each first server in the first server set; An acquisition module, configured to acquire server information corresponding to each second server in a second server set, wherein all the first servers in the first server set belong to the second server set; a determination module, configured to determine, for each of the first servers in the first server set, a target server corresponding to the first server from the second server set according to the server information corresponding to each of the second servers in the second server set, so as to obtain a target server set corresponding to the first server set, wherein the target server is used to represent a server to be replaced with the first server; A replacement module is used to replace each of the first servers in the first server set according to the determined target server set.

9. An electronic device, characterized in that: include: A processor and a memory, wherein the processor is used to execute a distributed database operation and maintenance program stored in the memory to implement the distributed database operation and maintenance method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the distributed database operation and maintenance method according to any one of claims 1 to 7.