CN116881229A - Database exercise environment construction method, device, equipment and storage medium - Google Patents
Database exercise environment construction method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN116881229A CN116881229A CN202310975664.9A CN202310975664A CN116881229A CN 116881229 A CN116881229 A CN 116881229A CN 202310975664 A CN202310975664 A CN 202310975664A CN 116881229 A CN116881229 A CN 116881229A
- Authority
- CN
- China
- Prior art keywords
- node
- component
- exercised
- database
- result
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000010276 construction Methods 0.000 title claims abstract description 75
- 238000003860 storage Methods 0.000 title claims abstract description 19
- 238000000034 method Methods 0.000 claims abstract description 40
- 238000005553 drilling Methods 0.000 claims abstract description 15
- 230000006870 function Effects 0.000 claims description 85
- 238000004590 computer program Methods 0.000 claims description 16
- 230000008569 process Effects 0.000 claims description 15
- 238000004891 communication Methods 0.000 description 8
- 238000012545 processing Methods 0.000 description 7
- 238000012795 verification Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 5
- 238000004519 manufacturing process Methods 0.000 description 5
- 238000011084 recovery Methods 0.000 description 5
- 238000002955 isolation Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000001360 synchronised effect Effects 0.000 description 3
- 230000002159 abnormal effect Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000004140 cleaning Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000011521 glass Substances 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
- G06F16/211—Schema design and management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a database exercise environment construction method, device, equipment and storage medium. The method comprises the following steps: determining a standby management area of a database cluster to be exercised in a distributed database; the standby management area comprises a plurality of functional component nodes under a database cluster to be exercised; selecting a main node of a component to be exercised and a slave node of the component to be exercised from the functional component nodes; constructing an exercise management node for managing node related information of a to-be-exercised component master node and a to-be-exercised component slave node; establishing link connection among the exercise management node, the to-be-exercised component master node and the to-be-exercised component slave node to obtain a link connection establishment result; and determining the construction result of the drilling environment of the database cluster to be drilled of the distributed database according to the link connection construction result. The embodiment of the invention realizes the automatic construction of the database exercise environment, reduces the manpower resources and the operation risk and improves the environment construction efficiency.
Description
Technical Field
The present invention relates to the field of database technologies, and in particular, to a method, an apparatus, a device, and a storage medium for constructing a database exercise environment.
Background
Distributed databases have long employed multi-place, multi-center networking architecture to ensure stable reliability of service and high availability of components. When a certain machine room fails or is abnormal, the service is required to be migrated to the standby machine room, so that the operation capability and the service processing capability of the standby machine room are necessary factors for ensuring stable service of the database.
In order to cope with the situation that the standby machine room can take over the service smoothly in the sudden scene, the availability of the standby machine room components can be verified by adopting a database exercise environment building mode. However, the existing exercise environment construction operation needs to be manually performed to isolate the exercise environment from the physical network of the production environment, but the manual operation mode may have risks, and needs to consume a large amount of manpower resources, so that the efficiency of environment construction is low.
Disclosure of Invention
The invention provides a database exercise environment construction method, device, equipment and storage medium, which are used for realizing automatic construction of the database exercise environment, reducing human resources and operation risks and improving environment construction efficiency.
According to an aspect of the present invention, there is provided a database exercise environment construction method, the method comprising:
Determining a standby management area of a database cluster to be exercised in a distributed database; the standby management area comprises a plurality of functional component nodes under the database cluster to be exercised;
selecting a main node of a component to be exercised and a slave node of the component to be exercised from the functional component nodes;
constructing an exercise management node for managing node related information of the to-be-exercised component master node and the to-be-exercised component slave node;
establishing link connection among the exercise management node, the to-be-exercised component master node and the to-be-exercised component slave node to obtain a link connection establishment result;
and determining the construction result of the drilling environment of the database cluster to be drilled of the distributed database according to the link connection construction result.
According to another aspect of the present invention, there is provided a database exercise environment construction apparatus, comprising:
the region determining module is used for determining a standby management region to which a database cluster to be exercised belongs in the distributed database; the standby management area comprises a plurality of functional component nodes under the database cluster to be exercised;
the component node selection module is used for selecting a component master node to be exercised and a component slave node to be exercised from the functional component nodes;
The management node construction module is used for constructing an exercise management node for managing node related information of the to-be-exercised component master node and the to-be-exercised component slave node;
the connection result determining module is used for establishing link connection among the exercise management node, the main node of the component to be exercised and the auxiliary node of the component to be exercised to obtain a link connection establishment result;
and the environment result determining module is used for determining the construction result of the exercise environment of the database cluster to be exercised of the distributed database according to the link connection establishment result.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the database exercise environment construction method according to any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to implement the database exercise environment construction method according to any one of the embodiments of the present invention when executed.
The technical scheme of the embodiment of the invention is that the standby management area of the database cluster to be exercised in the distributed database is determined; selecting a main node of a component to be exercised and a slave node of the component to be exercised from all functional component nodes in the standby management area; constructing an exercise management node for managing node related information of a to-be-exercised component master node and a to-be-exercised component slave node; establishing link connection among the exercise management node, the to-be-exercised component master node and the to-be-exercised component slave node to obtain a link connection establishment result; and determining the construction result of the drilling environment of the database cluster to be drilled of the distributed database according to the link connection construction result. According to the technical scheme, the automatic construction of the exercise environment of the distributed database is realized, more manpower is not needed in the construction process, the operation risk is reduced while the manpower resources are reduced, the physical network isolation of the exercise environment and the production environment is not needed, and the construction efficiency of the environment is improved in the construction process of the exercise environment.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a database exercise environment construction method according to a first embodiment of the present invention;
FIG. 2 is a flowchart of a database exercise environment construction method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a database exercise environment construction device according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device implementing a database exercise environment construction method according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a database exercise environment construction method according to a first embodiment of the present invention, where the method may be applied to the case of automatically constructing a database exercise environment of a distributed database, and the method may be performed by a database exercise environment construction device, where the database exercise environment construction device may be implemented in a form of hardware and/or software, and the database exercise environment construction device may be configured in an electronic device. As shown in fig. 1, the method includes:
S110, determining a standby management area of a database cluster to be exercised in a distributed database; the standby management area comprises a plurality of functional component nodes under the database cluster to be exercised.
Wherein the distributed database may comprise at least one database cluster. The database cluster to be exercised may be a database cluster to be subjected to business exercise. The database cluster to be exercised can comprise at least one functional component node, and different functional component nodes can execute different service functions. For example, the functional component node may be a data node or a computing node, etc.
Wherein, the database cluster to be exercised can have a main management area and a standby management area. When the regional node of the main management region fails or is abnormal, the regional node of the standby management region can process service data. Therefore, the exercise environment can be built in the standby management area, for example, an exercise platform can be built, and the availability of each functional component node in the standby management area is verified. Before component availability verification can be performed, an automated build or construction of the exercise environment needs to be performed in the standby management area.
For example, the standby management area to which the database cluster to be exercised in the distributed database belongs may be determined by the exercise server. The to-be-exercised cluster can be selected by related technicians according to actual requirements, and the standby management area to which the to-be-exercised database cluster belongs can be automatically determined by the exercise server according to the deployment information of the to-be-exercised database cluster related cluster. The drill server may be a host device deployed within the standby management area. There are multiple functional component nodes under the database cluster to be exercised in the standby management area, and the number of the functional component nodes with different component function types can be one or more. Component function types of the function component nodes may include data function types, computation function types, and the like. For example, if there are data nodes and computing nodes in the cluster to be exercised, the standby management area may include at least one functional component node of a data function type and at least one functional component node of a computing function type.
S120, selecting a main node of the component to be exercised and a slave node of the component to be exercised from the functional component nodes.
The functional component nodes are different in component function types, at least one functional component node can be selected from the functional component nodes of different component function types to serve as a component node to be drilled, any component node to be drilled is randomly selected from the component nodes of the same component function type to serve as a main node of the component to be drilled in the component function type, and other functional component nodes are slave nodes of the component to be drilled in the component function type.
Specifically, if the component function type a and the component function type B exist in the standby management area, the component function type a includes a functional component node A1, a functional component node A2 and a functional component node A3; component function type B includes a function component node B1, a function component node B2, a function component node B3, and a function component node B4. The preset number of functional component nodes can be selected from the functional component nodes of the component functional types respectively to serve as component nodes to be exercised. The preset number can be preset by related technicians according to actual requirements, and the preset number corresponding to the function types of different components can be the same or different. For example, the preset number of the component function types a may be set to 2, the preset number of the component function types B may be set to 3, and the component nodes to be exercised selected randomly under the component function types a are the function component node A1 and the function component node A2 correspondingly; the component nodes to be exercised selected randomly under the component function type B are a functional component node B1, a functional component node B3 and a functional component node B4. After random selection, the main node of the component to be exercised of the component function type A can be determined to be the functional component node A1, and the slave node of the component to be exercised is the functional component node A2. After random selection, the main node of the component to be exercised of the component function type B can be determined to be the functional component node B3, and the auxiliary nodes of the component to be exercised are the functional component node B1 and the functional component node B4.
S130, constructing an exercise management node for managing node related information of a to-be-exercised component master node and a to-be-exercised component slave node.
The exercise management node is used for managing node related information of the to-be-exercised component master node and the to-be-exercised component slave node. For example, node status, node alert information, etc. of the component nodes to be exercised may be collected and stored.
For example, the exercise server may construct an exercise management node on its own server, and the component master node to be exercise and the component slave node to be exercise point to the exercise management node.
And S140, establishing link connection among the exercise management node, the to-be-exercised component master node and the to-be-exercised component slave node to obtain a link connection establishment result.
For example, the component configuration addresses of the component master node to be exercised and the component slave node to be exercised may be updated to the management node address of the exercise management node; the main node of the component to be exercised and the auxiliary node of the component to be exercised can establish link connection with the exercise management node based on the updated component configuration address, and a link connection establishment result is obtained. The link connection establishment result may include connection establishment success and connection establishment failure, among others.
S150, determining the construction result of the drilling environment of the database cluster to be drilled of the distributed database according to the link connection construction result.
For example, if the link connection establishment result is that the connection establishment is successful, the exercise environment of the database cluster to be exercised of the distributed database is successfully established; if the link connection establishment result is connection establishment failure, the construction of the exercise environment of the database cluster to be exercised of the distributed database fails.
The technical scheme of the embodiment of the invention is that the standby management area of the database cluster to be exercised in the distributed database is determined; selecting a main node of a component to be exercised and a slave node of the component to be exercised from all functional component nodes in the standby management area; constructing an exercise management node for managing node related information of a to-be-exercised component master node and a to-be-exercised component slave node; establishing link connection among the exercise management node, the to-be-exercised component master node and the to-be-exercised component slave node to obtain a link connection establishment result; and determining the construction result of the drilling environment of the database cluster to be drilled of the distributed database according to the link connection construction result. According to the technical scheme, the automatic construction of the exercise environment of the distributed database is realized, more manpower is not needed in the construction process, the operation risk is reduced while the manpower resources are reduced, the physical network isolation of the exercise environment and the production environment is not needed, and the construction efficiency of the environment is improved in the construction process of the exercise environment.
Example two
Fig. 2 is a flowchart of a database exercise environment construction method according to a second embodiment of the present invention, where the present embodiment is optimized and improved based on the above technical solutions.
Further, the step of selecting a main node of the component to be exercised and a slave node of the component to be exercised from the functional component nodes is performed to 'refine' to determine the component function types of the functional component nodes; selecting a component node to be exercised from all the functional component nodes belonging to the same component function type according to the node information of all the functional component nodes; and determining a to-be-exercised component master node and a to-be-exercised component slave node in each to-be-exercised component node with the same component function type. The selection mode of the main node of the component to be exercised and the slave node of the component to be exercised is perfected.
Further, the link connection among the drilling management node, the main node of the component to be drilled and the slave node of the component to be drilled is established in the step, and the link connection establishment result is obtained and is refined into the management node address of the drilling management node, and the node link address of each node of the component to be drilled is updated; and each component node to be exercised establishes a link connection with the exercise management node based on the node link address to obtain a link connection establishment result. In order to perfect the determination of the link connection establishment result. In the embodiments of the present invention, the descriptions of other embodiments may be referred to in the portions not described in detail.
As shown in fig. 2, the method comprises the following specific steps:
s210, determining a standby management area of a database cluster to be exercised in a distributed database; the standby management area comprises a plurality of functional component nodes under the database cluster to be exercised.
S220, determining the component function type of each functional component node.
The component function types of the function component node may include a data function type, a calculation function type, a global transaction management function type, and the like.
S230, selecting the component node to be exercised from all the functional component nodes belonging to the same component function type according to the node information of all the functional component nodes.
Wherein the node information may include node identification information, which may characterize node uniqueness of the functional component node. For example, the node identification information may be a node identification serial number, and is composed of a character string.
For example, the component node to be exercised may be selected from the functional component nodes belonging to the same component function type according to the node identification information of the functional nodes. Specifically, node identification serial numbers of all function component nodes of the same component function type are sequentially ordered from high to low according to the size of four bits after the serial numbers, and the function component node with the top three bits of the serial numbers is selected as a component node to be exercised under the component function type. The sequence number ordering rule and the number of bits for selecting the ranking can be preset by related technicians according to actual requirements.
In an alternative embodiment, the node information includes node address and node port information; correspondingly, according to the node information of each functional component node, selecting the component node to be exercised from all functional component nodes belonging to the same component function type, including: determining whether functional component nodes with the same node address exist in all the functional component nodes with the same component function type; if yes, determining the component node to be exercised in all the functional component nodes with the same component function type according to the node port information of the functional component nodes with the same node address.
Illustratively, determining whether there are functional component nodes with the same node address among the functional component nodes of the same component function type; if yes, determining node port information of the same functional component node; if not, the function component nodes with preset numbers can be selected from the function component nodes with different node addresses at will to be used as the component nodes to be exercised under the component function types. If the functional component nodes with the same node address exist, node port information of the same functional component nodes is determined, functional component nodes with the same node address are ordered based on the port information and a preset ordering rule, and the functional component nodes positioned at the head or tail of the ordering are selected to serve as component nodes to be exercised with the same node address, so that the component nodes to be exercised with the same node address are respectively obtained, and further the component nodes to be exercised with the component function type are obtained.
According to the method, the device and the system for selecting the component nodes to be exercised, the component nodes to be exercised are selected in a mode of combining the node addresses and the node port information of the functional component nodes, the targeted selection of the component nodes to be exercised is achieved, and the characteristics of the component nodes are combined, so that the construction of the exercise environment is more real.
S240, determining a to-be-exercised component master node and a to-be-exercised component slave node in each to-be-exercised component node with the same component function type.
For example, any component node to be exercised can be randomly selected from the component nodes to be exercised with the same component function type as a main node of the component to be exercised with the corresponding component function type, and other component nodes to be exercised with the component function type are determined as slave nodes of the component to be exercised with the component function type.
In an alternative embodiment, determining the to-be-exercised component master node and the to-be-exercised component slave node in the to-be-exercised component nodes with the same component function type includes: determining the node data quantity of each to-be-exercised component node; and determining a to-be-exercised component master node and a to-be-exercised component slave node in each to-be-exercised component node with the same component function type according to the node data quantity.
The node data size can be the size of the data size synchronized or processed in the node of the component to be exercised.
In the exemplary embodiment, in the component nodes to be exercised with the same component function type, the component master node with the largest node data volume may be selected from the component nodes to be exercised, and the other component nodes to be exercised are used as the component slave nodes to be exercised with the corresponding component function types, so as to obtain the component master node to be exercised and the component slave node to be exercised with the component function types.
The node characteristics of the master component node and the slave component node are considered in the optional embodiment, and accurate selection of the master node and the slave node of the component to be drilled in the component nodes to be drilled with the same component function type is realized.
S250, constructing an exercise management node for managing node related information of a to-be-exercised component master node and a to-be-exercised component slave node.
And S260, updating the node link address of each component node to be exercised by adopting the management node address of the exercise management node.
It should be noted that, the original node configuration address of each component node to be exercised may be a management node address pointing to the main management area of the database cluster to be exercised.
The original node configuration address of each component node to be exercised is updated by using the management node address of the exercise management node, so as to update the node link address of each component node to be exercised, that is, the updated node link address of each component node to be exercised is the management node address of the exercise management node.
S270, each component node to be exercised establishes link connection with the exercise management node based on the node link address, and a link connection establishment result is obtained.
Illustratively, each node to be exercised establishes link connection with the exercise management node based on the node link address, and a link connection establishment result is obtained. The link connection establishment result comprises connection establishment success and connection establishment failure.
S280, determining a construction result of the drilling environment of the database cluster to be drilled of the distributed database according to the link connection construction result.
According to the technical scheme of the embodiment, the component function types of the functional component nodes are determined, the component nodes to be drilled are selected from the functional component nodes belonging to the same component function types according to the node information of the functional component nodes, and the component master node to be drilled and the component slave node to be drilled in the component nodes to be drilled of the same component function types are determined, so that the accurate determination of the component master node to be drilled and the component slave node to be drilled is realized. By adopting the management node address of the exercise management node, the node link address of each component node to be exercised is updated, and each component node to be exercised establishes link connection with the exercise management node based on the node link address, so that a link connection establishment result is obtained, and accurate determination of the link connection establishment result is realized.
After the construction of the exercise environment of the database cluster to be exercised is completed and the construction is successful, the availability of the master node of the component to be exercised and the slave node of the component to be exercised can be verified.
In an alternative embodiment, after obtaining the link connection establishment result, if the link connection establishment result is that the connection establishment is successful, sending a task execution instruction to the to-be-exercised component master node, and executing the task execution instruction by the to-be-exercised component master node to obtain a task instruction execution result; and verifying the availability of the components of the main node of the component to be exercised according to the execution result of the task instruction.
The task execution instruction may be any execution instruction, for example, may be a data addition instruction, a data deletion instruction, a data modification instruction, or a data search instruction of a database.
The task execution instruction is executed after the main node of the component to be exercised receives the task execution instruction, so as to obtain a task instruction execution result. The task instruction execution result may include success of task execution and failure of task execution. If the task execution is successful, the component availability verification of the component master node to be exercised can be indicated to pass; if the task execution fails, the component availability verification of the component master node to be exercised can be indicated to be failed.
In an alternative embodiment, if the task instruction execution result is that the instruction execution is successful, the slave node of the component to be exercised synchronizes task data generated in the process of executing the task execution instruction by the master node of the component to be exercised, so as to obtain a data synchronization result; and verifying the availability of the components to be exercised from the node according to the data synchronization result.
For example, in the process that the main node of the component to be exercised executes the task, task data are generated, and the slave node of the component to be exercised synchronizes the task data generated in the process that the main node of the component to be exercised executes the task in real time, so that a data synchronization result is obtained. If the data synchronization result is successful in data synchronization, the fact that the component availability verification of the to-be-exercised component slave node passes can be indicated; if the data synchronization result is a data synchronization failure, the component availability verification of the component slave node to be exercised is not passed.
After the exercise environment is set up and the exercise is completed, the environment can be restored to the original environment.
For example, after determining the component nodes to be exercised, metadata of each component node to be exercised may be migrated to the exercise management node, where a time of recording the current migrated data is a start time. And when the environment is restored, restoring the component node to be exercised to the state of the starting moment. Specific recovery modes can be two, rollback gtid (global transaction identifiner, global transaction identifier) and backup recovery modes. If the business contains DDL during drilling, only a backup recovery mode can be adopted, backup is performed firstly during construction, and backup files are used for recovery during recovery. Then, the drilling management node is temporarily used for cleaning metadata of the drilling management console. And finally, the pointing direction of the component node to be exercised is returned, and the address of the exercise management node pointed in the component node configuration file to be exercised is restored to the address of the management console of the original production environment.
Example III
Fig. 3 is a schematic structural diagram of a database exercise environment construction device according to a third embodiment of the present invention. The database exercise environment construction device provided by the embodiment of the invention can be suitable for the situation of automatically constructing the database exercise environment of a distributed database, and can be realized in a form of hardware and/or software, as shown in fig. 3, and the device specifically comprises: the system comprises a region determining module 301, a component node selecting module 302, a management node constructing module 303, a connection result determining module 304 and an environment result determining module 305. Wherein,,
the region determining module 301 is configured to determine a standby management region to which a database cluster to be exercised in the distributed database belongs; the standby management area comprises a plurality of functional component nodes under the database cluster to be exercised;
the component node selection module 302 is configured to select a component master node to be exercised and a component slave node to be exercised from the functional component nodes;
a management node construction module 303, configured to construct a drilling management node for managing node related information of the to-be-drilled component master node and the to-be-drilled component slave node;
The connection result determining module 304 is configured to establish a link connection among the exercise management node, the to-be-exercised component master node, and the to-be-exercised component slave node, to obtain a link connection establishment result;
and the environment result determining module 305 is configured to determine a construction result of the exercise environment of the database cluster to be exercised of the distributed database according to the link connection establishment result.
The technical scheme of the embodiment of the invention is that the standby management area of the database cluster to be exercised in the distributed database is determined; selecting a main node of a component to be exercised and a slave node of the component to be exercised from all functional component nodes in the standby management area; constructing an exercise management node for managing node related information of a to-be-exercised component master node and a to-be-exercised component slave node; establishing link connection among the exercise management node, the to-be-exercised component master node and the to-be-exercised component slave node to obtain a link connection establishment result; and determining the construction result of the drilling environment of the database cluster to be drilled of the distributed database according to the link connection construction result. According to the technical scheme, the automatic construction of the exercise environment of the distributed database is realized, more manpower is not needed in the construction process, the operation risk is reduced while the manpower resources are reduced, the physical network isolation of the exercise environment and the production environment is not needed, and the construction efficiency of the environment is improved in the construction process of the exercise environment.
Optionally, the component node selecting module 302 includes:
a function type determining unit, configured to determine a component function type of each of the function component nodes;
the drilling component node selection unit is used for selecting a component node to be drilled from all the functional component nodes belonging to the same component function type according to the node information of all the functional component nodes;
and the component node determining unit is used for determining a to-be-exercised component master node and a to-be-exercised component slave node in the to-be-exercised component nodes with the same component function type.
Optionally, the node information includes node address and node port information;
correspondingly, the exercise component node selection unit comprises:
a functional component node determining subunit, configured to determine whether a functional component node with the same node address exists in each functional component node with the same component function type;
and the node to be exercised determining subunit is used for determining the node to be exercised in all the functional component nodes with the same component function type according to the node port information of the functional component nodes with the same node address if the functional component nodes with the same node address exist.
Optionally, the component node determining unit includes:
The node data quantity determining subunit is used for determining the node data quantity of each node of the component to be exercised;
and the component node determining subunit is used for determining a to-be-exercised component master node and a to-be-exercised component slave node in each to-be-exercised component node with the same component function type according to the node data quantity.
Optionally, the connection result determining module 304 includes:
the link address updating unit is used for updating the node link address of each component node to be exercised by adopting the management node address of the exercise management node;
and the connection result determining unit is used for establishing the link connection with the exercise management node by each node of the to-be-exercised component based on the node link address to obtain a link connection establishment result.
Optionally, the apparatus further includes:
the instruction execution result determining module is used for sending a task execution instruction to the main node of the component to be exercised after the link connection establishment result is obtained, and if the link connection establishment result is that the connection establishment is successful, the main node of the component to be exercised executes the task execution instruction to obtain a task instruction execution result;
and the first component availability verification module is used for verifying the component availability of the component main node to be exercised according to the task instruction execution result.
Optionally, the apparatus further includes:
the synchronous result determining module is used for synchronizing task data generated by the main node of the component to be exercised in the process of executing the task execution instruction by the secondary node of the component to be exercised if the task instruction execution result is that the instruction execution is successful, so as to obtain a data synchronous result;
and the second component availability verification module is used for verifying the component availability of the to-be-exercised component slave node according to the data synchronization result.
The database exercise environment construction device provided by the embodiment of the invention can execute the database exercise environment construction method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example IV
Fig. 4 shows a schematic diagram of an electronic device 40 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 40 includes at least one processor 41, and a memory communicatively connected to the at least one processor 41, such as a Read Only Memory (ROM) 42, a Random Access Memory (RAM) 43, etc., in which the memory stores a computer program executable by the at least one processor, and the processor 41 may perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 42 or the computer program loaded from the storage unit 48 into the Random Access Memory (RAM) 43. In the RAM 43, various programs and data required for the operation of the electronic device 40 may also be stored. The processor 41, the ROM 42 and the RAM 43 are connected to each other via a bus 44. An input/output (I/O) interface 45 is also connected to bus 44.
Various components in electronic device 40 are connected to I/O interface 45, including: an input unit 46 such as a keyboard, a mouse, etc.; an output unit 47 such as various types of displays, speakers, and the like; a storage unit 48 such as a magnetic disk, an optical disk, or the like; and a communication unit 49 such as a network card, modem, wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 41 may be various general and/or special purpose processing components with processing and computing capabilities. Some examples of processor 41 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 41 performs the various methods and processes described above, such as a database exercise environment construction method.
In some embodiments, the database exercise environment construction method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 48. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 40 via the ROM 42 and/or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the database exercise environment construction method described above may be performed. Alternatively, in other embodiments, processor 41 may be configured to perform the database exercise environment construction method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.
Claims (10)
1. A database exercise environment construction method, comprising:
determining a standby management area of a database cluster to be exercised in a distributed database; the standby management area comprises a plurality of functional component nodes under the database cluster to be exercised;
selecting a main node of a component to be exercised and a slave node of the component to be exercised from the functional component nodes;
constructing an exercise management node for managing node related information of the to-be-exercised component master node and the to-be-exercised component slave node;
Establishing link connection among the exercise management node, the to-be-exercised component master node and the to-be-exercised component slave node to obtain a link connection establishment result;
and determining the construction result of the drilling environment of the database cluster to be drilled of the distributed database according to the link connection construction result.
2. The method of claim 1, wherein selecting the component master node to be exercised and the component slave node to be exercised from the functional component nodes comprises:
determining the component function type of each functional component node;
selecting a component node to be exercised from all the functional component nodes belonging to the same component function type according to the node information of each functional component node;
and determining a to-be-exercised component master node and a to-be-exercised component slave node in each to-be-exercised component node with the same component function type.
3. The method of claim 2, wherein the node information includes node address and node port information; correspondingly, the selecting the component node to be exercised from the functional component nodes belonging to the same component function type according to the node information of the functional component nodes comprises the following steps:
Determining whether functional component nodes with the same node address exist in all the functional component nodes with the same component function type;
if yes, determining the component node to be exercised in all the functional component nodes with the same component function type according to the node port information of the functional component nodes with the same node address.
4. The method according to claim 2, wherein determining the to-be-exercised component master node and the to-be-exercised component slave node among the to-be-exercised component nodes of the same component function type includes:
determining the node data quantity of each node of the component to be exercised;
and determining a to-be-exercised component master node and a to-be-exercised component slave node in each to-be-exercised component node with the same component function type according to the node data quantity.
5. The method according to claim 2, wherein the establishing the link connection among the exercise management node, the component master node to be exercised, and the component slave node to be exercised, to obtain a link connection establishment result, includes:
updating the node link address of each to-be-exercised component node by adopting the management node address of the exercise management node;
and each to-be-exercised component node establishes a link connection with the exercise management node based on the node link address to obtain a link connection establishment result.
6. The method according to any of claims 1-5, wherein after said obtaining a link connection establishment result, the method further comprises:
if the link connection establishment result is that the connection establishment is successful, a task execution instruction is sent to the main node of the component to be exercised, and the main node of the component to be exercised executes the task execution instruction to obtain a task instruction execution result;
and verifying the component availability of the component master node to be exercised according to the task instruction execution result.
7. The method of claim 6, wherein the method further comprises:
if the task instruction execution result is that the instruction execution is successful, synchronizing task data generated by the main node of the component to be exercised in the process of executing the task execution instruction by the secondary node of the component to be exercised to obtain a data synchronization result;
and verifying the availability of the components to be exercised from the node according to the data synchronization result.
8. A database exercise environment construction apparatus, comprising:
the region determining module is used for determining a standby management region to which a database cluster to be exercised belongs in the distributed database; the standby management area comprises a plurality of functional component nodes under the database cluster to be exercised;
The component node selection module is used for selecting a component master node to be exercised and a component slave node to be exercised from the functional component nodes;
the management node construction module is used for constructing an exercise management node for managing node related information of the to-be-exercised component master node and the to-be-exercised component slave node;
the connection result determining module is used for establishing link connection among the exercise management node, the main node of the component to be exercised and the auxiliary node of the component to be exercised to obtain a link connection establishment result;
and the environment result determining module is used for determining the construction result of the exercise environment of the database cluster to be exercised of the distributed database according to the link connection establishment result.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the database exercise environment construction method of any one of claims 1-7.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores computer instructions for causing a processor to implement the database exercise environment construction method of any one of claims 1-7 when executed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310975664.9A CN116881229A (en) | 2023-08-03 | 2023-08-03 | Database exercise environment construction method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310975664.9A CN116881229A (en) | 2023-08-03 | 2023-08-03 | Database exercise environment construction method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116881229A true CN116881229A (en) | 2023-10-13 |
Family
ID=88271508
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310975664.9A Pending CN116881229A (en) | 2023-08-03 | 2023-08-03 | Database exercise environment construction method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116881229A (en) |
-
2023
- 2023-08-03 CN CN202310975664.9A patent/CN116881229A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN116938953A (en) | Block chain-based data processing method and device, electronic equipment and storage medium | |
CN117082046A (en) | Data uploading method, device, equipment and storage medium | |
CN113691403B (en) | Topology node configuration method, related device and computer program product | |
CN114070889B (en) | Configuration method, traffic forwarding device, storage medium, and program product | |
CN114443057B (en) | Deployment of conversation model, conversation method, device, electronic equipment and storage medium | |
CN112799879B (en) | Fault processing method, device, equipment and storage medium of node | |
CN116881229A (en) | Database exercise environment construction method, device, equipment and storage medium | |
CN116028517A (en) | Fusion database system and electronic equipment | |
CN115587119A (en) | Database query method and device, electronic equipment and storage medium | |
CN113641688B (en) | Node updating method, related device and computer program product | |
CN113360689A (en) | Image retrieval system, method, related device and computer program product | |
CN117113942B (en) | Model synchronization method and device, electronic equipment and storage medium | |
CN114650222B (en) | Parameter configuration method, device, electronic equipment and storage medium | |
CN117395263B (en) | Data synchronization method, device, equipment and storage medium | |
CN115034895A (en) | Block chain node management method and device and electronic equipment | |
CN115174447B (en) | Network communication method, device, system, equipment and storage medium | |
CN113032483B (en) | Cross-platform data asset sharing method and device and electronic equipment | |
CN116049311A (en) | Data synchronization method and device, electronic equipment and storage medium | |
CN116881368A (en) | Data synchronization method and device, electronic equipment and storage medium | |
CN118245211A (en) | Preemption method, preemption device, preemption equipment and preemption medium for task terminal | |
CN118568087A (en) | Operation sequencing result generation method, device, equipment and storage medium | |
CN118152095A (en) | Device switching method, device, equipment and medium for database service | |
CN117806969A (en) | Service testing method, device, equipment and medium | |
CN116800665A (en) | Edge node management method, device, equipment and storage medium | |
CN116016545A (en) | High-availability deployment method, device and equipment for Redis cluster and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |