Resource migration method, device, equipment and medium
Through fuzzy matching rules and load information monitoring, the problem of IP resource migration failure caused by inconsistent network card names was solved, and the stability and flexibility of cluster services were achieved.
Patent Information
- Application Number
- CN202410865539.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2044-06-28
AI Technical Summary
In the cluster, inconsistent network card names prevent the migration of network card IP resources, affecting the stability of cluster services.
Fuzzy matching rules are used to identify multiple migratable network cards in the cluster, their real-time load information is monitored, and the network cards are arranged according to the load information, and the node with the smallest load is selected for resource migration.
It realizes the mutual migration of network card IP resources between different nodes, ensures the stability and flexibility of cluster services, and reduces service interruptions caused by network failures.
Smart Images

Figure CN118740923B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a resource migration method, apparatus, device, and medium. Background Art
[0002] During cluster operation, issues such as node failures and network latency can cause system performance degradation or service interruption. The network interface cards (NICs) on all nodes in the cluster must have the same name. Otherwise, the NIC IP resources cannot be migrated between nodes, affecting cluster service stability.
[0003] Therefore, how to solve the problem that the network card IP resources cannot be migrated due to inconsistent network card names is a problem that those skilled in the art need to solve. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a resource migration method, device, equipment and medium to solve the problem of network card IP resource migration failure caused by inconsistent network card names. The specific solution is as follows:
[0005] In a first aspect, the present application provides a resource migration method, comprising:
[0006] Determine multiple migratable network cards in the cluster using fuzzy matching rules; the fuzzy matching rules perform partial field matching on the network card names;
[0007] Monitoring real-time load information of the plurality of migratable network cards;
[0008] If the real-time load information of the target migratable network card meets the migration condition, the multiple migratable network cards are arranged according to the real-time load information of the multiple migratable network cards to obtain a target sequence; the target migratable network card is any one of the multiple migratable network cards;
[0009] A node where the migratable network card with the smallest real-time load information is located is selected in the target sequence as a destination node, and configuration resources of the target migratable network card are migrated to the destination node.
[0010] Optionally, determining multiple migratable network adapters in the cluster by using a fuzzy matching rule includes:
[0011] Collecting the configuration resources of the network cards in each node included in the cluster to obtain a resource set;
[0012] Setting the filter items in the fuzzy matching rule; the filter items include: at least one or a combination of the network card name, gateway address and subnet mask;
[0013] The plurality of migratable network cards that meet the filter items are selected from the resource set by using the fuzzy matching rule.
[0014] Optionally, it also includes:
[0015] After the cluster is started, obtaining real-time operation information of the multiple migratable network cards;
[0016] According to the real-time operation information of the multiple migratable network cards, the multiple migratable network cards are sequentially recorded as a resource linked list;
[0017] Wherein, each node of the resource linked list is each migratable network card, and the attributes of each node are the network card name, gateway address and subnet mask of each migratable network card.
[0018] Optionally, obtaining real-time operating information of the multiple migratable network adapters includes:
[0019] Obtaining the traffic size and bandwidth size of the multiple migratable network cards within a preset time period;
[0020] The real-time operation information of the plurality of migratable network cards is calculated according to the duration of the preset time period, the traffic volume, and the bandwidth volume.
[0021] Optionally, calculating and obtaining the real-time operation information of the plurality of migratable network adapters according to the duration of the preset time period, the traffic volume, and the bandwidth volume includes:
[0022] Obtaining real-time operating information of the plurality of migratable network cards by calculating according to a target formula;
[0023] Among them, the target formula is: Li=Mi / (Si×T), Li represents the real-time operation information of the migratable network card i, the duration of the preset time period is represented by T, Mi represents the traffic size of the migratable network card i within the duration T, and Si represents the bandwidth size of the migratable network card i within the duration T.
[0024] Optionally, arranging the multiple migratable network cards according to real-time load information of the multiple migratable network cards to obtain a target sequence includes:
[0025] Arrange the multiple migratable network cards in descending order according to the real-time load information of the multiple migratable network cards to obtain the target sequence;
[0026] Accordingly, selecting the node where the migratable network card with the smallest real-time load information is located in the target sequence as the destination node includes:
[0027] The node where the migratable network adapter at the end of the target sequence is located is used as the destination node; or
[0028] Arranging the plurality of migratable network cards according to real-time load information of the plurality of migratable network cards to obtain a target sequence includes:
[0029] Arrange the multiple migratable network cards in ascending order according to the real-time load information of the multiple migratable network cards to obtain the target sequence;
[0030] Accordingly, selecting the node where the migratable network card with the smallest real-time load information is located in the target sequence as the destination node includes:
[0031] The node where the migratable network card at the first position in the target sequence is located is used as the destination node.
[0032] Optionally, the real-time load information of the target migratable network card meets the migration condition, including: the real-time load information of the target migratable network card is greater than a preset load threshold; or the real-time load information of the target migratable network card is reported as an error;
[0033] Accordingly, migrating the configuration resources of the target migratable network card to the destination node includes:
[0034] Selecting an available network card in the destination node;
[0035] Allocate the configuration resources of the target migratable network card to the available network card;
[0036] Starting the available network card;
[0037] Stop the target migratable network card from running.
[0038] In a second aspect, the present application provides a resource migration device, comprising:
[0039] A determination module, configured to determine a plurality of migratable network cards in a cluster using a fuzzy matching rule; the fuzzy matching rule performs partial field matching on the network card name;
[0040] A monitoring module, configured to monitor real-time load information of the plurality of migratable network cards;
[0041] a sorting module configured to, if the real-time load information of the target migratable network card meets the migration condition, arrange the multiple migratable network cards according to the real-time load information of the multiple migratable network cards to obtain a target sequence; the target migratable network card is any one of the multiple migratable network cards;
[0042] The migration module is configured to select a node where the migratable network card with the smallest real-time load information is located in the target sequence as a destination node, and migrate the configuration resources of the target migratable network card to the destination node.
[0043] Optionally, the determination module is specifically configured to:
[0044] Collecting the configuration resources of the network cards in each node included in the cluster to obtain a resource set;
[0045] Setting the filter items in the fuzzy matching rule; the filter items include: at least one or a combination of the network card name, gateway address and subnet mask;
[0046] The plurality of migratable network cards that meet the filter items are selected from the resource set by using the fuzzy matching rule.
[0047] Optionally, it also includes:
[0048] A storage module is used to obtain real-time operating information of the multiple migratable network cards after the cluster is started and operated; according to the real-time operating information of the multiple migratable network cards, the multiple migratable network cards are recorded in sequence as a resource list; wherein each node of the resource list is each migratable network card, and the attributes of each node are the network card name, gateway address and subnet mask of each migratable network card.
[0049] Optionally, the storage module is specifically used to:
[0050] Obtaining the traffic size and bandwidth size of the multiple migratable network cards within a preset time period;
[0051] The real-time operation information of the plurality of migratable network cards is calculated according to the duration of the preset time period, the traffic volume, and the bandwidth volume.
[0052] Optionally, the storage module is specifically used to:
[0053] Obtaining real-time operating information of the plurality of migratable network cards by calculating according to a target formula;
[0054] Among them, the target formula is: Li=Mi / (Si×T), Li represents the real-time operation information of the migratable network card i, the duration of the preset time period is represented by T, Mi represents the traffic size of the migratable network card i within the duration T, and Si represents the bandwidth size of the migratable network card i within the duration T.
[0055] Optionally, the sorting module is specifically used to: arrange the multiple migratable network cards in descending order according to the real-time load information of the multiple migratable network cards to obtain the target sequence; accordingly, the migration module is specifically used to: take the node where the migratable network card at the end of the target sequence is located as the destination node.
[0056] Optionally, the sorting module is specifically used to: arrange the multiple migratable network cards in ascending order according to the real-time load information of the multiple migratable network cards to obtain the target sequence; accordingly, the migration module is specifically used to: take the node where the migratable network card in the first position in the target sequence is located as the destination node.
[0057] Optionally, the real-time load information of the target migratable network card meets the migration condition, including: the real-time load information of the target migratable network card is greater than a preset load threshold; or the real-time load information of the target migratable network card reports an error.
[0058] Optionally, the migration module is specifically used to:
[0059] Selecting an available network card in the destination node;
[0060] Allocate the configuration resources of the target migratable network card to the available network card;
[0061] Starting the available network card;
[0062] Stop the target migratable network card from running.
[0063] In a third aspect, the present application provides an electronic device, comprising:
[0064] memory for storing computer programs;
[0065] The processor is configured to execute the computer program to implement the resource migration method disclosed above.
[0066] In a fourth aspect, the present application provides a non-volatile storage medium for storing a computer program, wherein the computer program implements the aforementioned disclosed resource migration method when executed by a processor.
[0067] In a fifth aspect, the present application provides a computer program product, comprising a computer program / instruction, which implements the steps of the aforementioned disclosed resource migration method when executed by a processor.
[0068] From the above scheme, it can be seen that the present application provides a resource migration method, including: using fuzzy matching rules to determine multiple migratable network cards in a cluster; the fuzzy matching rules perform partial field matching on the network card name; monitoring the real-time load information of the multiple migratable network cards; if the real-time load information of the target migratable network card meets the migration conditions, then according to the real-time load information of the multiple migratable network cards, the multiple migratable network cards are arranged to obtain a target sequence; the target migratable network card is any one of the multiple migratable network cards; in the target sequence, the node where the migratable network card with the smallest real-time load information is located is selected as the destination node, and the configuration resources of the target migratable network card are migrated to the destination node.
[0069] It can be seen that the present application uses fuzzy matching rules to screen out multiple migratable network cards in the cluster; monitors the real-time load information of multiple migratable network cards; if the real-time load information of the target migratable network card meets the migration conditions, then arranges the multiple migratable network cards according to the real-time load information of the multiple migratable network cards to obtain a target sequence; the target migratable network card is any one of the multiple migratable network cards; in the target sequence, the node where the migratable network card with the smallest real-time load information is located is selected as the destination node, and the configuration resources of the target migratable network card are migrated to the destination node. This solution uses fuzzy matching rules to match some fields of the network card name, which solves the problem of being unable to migrate due to inconsistent network card names, and can realize the mutual migration of IP resources of network cards with inconsistent names between different nodes in the cluster, ensuring the stability of cluster services.
[0070] Correspondingly, the resource migration device, equipment and medium provided by this application also have the above-mentioned technical effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0072] Figure 1 A flow chart of a resource migration method disclosed in this application;
[0073] Figure 2 A schematic diagram of a cluster disclosed in this application;
[0074] Figure 3 This is a flow chart of another resource migration method disclosed in this application;
[0075] Figure 4This is a flow chart of another resource migration method disclosed in this application;
[0076] Figure 5 This is a schematic diagram of a resource migration device disclosed in this application;
[0077] Figure 6 A server structure diagram provided for this application;
[0078] Figure 7 This is a terminal structure diagram provided for this application. DETAILED DESCRIPTION
[0079] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments of this application, all other examples obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0080] Currently, during cluster operation, issues such as node failures and network latency can cause system performance degradation or service interruptions. Currently, the network interface cards (NICs) of all nodes in a cluster must have the same name. Otherwise, the NIC IP resources cannot be migrated between nodes, impacting the stability of cluster services. To address this issue, this application provides a resource migration solution that resolves the issue of NIC IP resource migration failures caused by inconsistent NIC names.
[0081] See also Figure 1 As shown, the embodiment of the present application discloses a resource migration method, including:
[0082] S101. Determine multiple migratable network cards in a cluster using fuzzy matching rules.
[0083] In this embodiment, the cluster can be a distributed storage system, comprising multiple nodes. Each node includes multiple network cards, some of which are used to provide external access services, some of which are used for inter-node communication, and some of which are used to provide external access services. Fuzzy matching rules perform partial field matching on network card names. For example, if the fuzzy matching rule sets the matching field for network card names to eth*, network card names such as eth0, eth, eth1, and ethx will be matched.
[0084] In one embodiment, using fuzzy matching rules to identify multiple migratable network cards in a cluster includes: collecting configuration resources of network cards in each node of the cluster to obtain a resource set; setting filter items in the fuzzy matching rules; the filter items include: at least one or a combination of network card name, gateway address, and subnet mask; and using the fuzzy matching rules to select multiple migratable network cards from the resource set that meet the filter items to select network cards for providing external access services. The configuration resources of these network cards can be migrated between different nodes, thereby enabling one node to replace another in providing external access services.
[0085] S102: Monitor real-time load information of multiple migratable network cards.
[0086] After the cluster is started, real-time operating information of multiple migratable network cards is obtained. Based on this real-time operating information, the multiple migratable network cards are sequentially recorded in a resource linked list. Each node in the resource linked list represents a migratable network card, and each node's attributes are the card name, gateway address, and subnet mask of the migratable network card. Using the resource linked list, the real-time operating information of the migratable network cards is stored sequentially.
[0087] In one embodiment, obtaining real-time operating information of multiple migratable network cards includes: obtaining traffic volume and bandwidth volume of the multiple migratable network cards within a preset time period; and calculating the real-time operating information of the multiple migratable network cards based on the duration of the preset time period, the traffic volume, and the bandwidth volume. The real-time operating information is specifically real-time load information, i.e., real-time load volume.
[0088] The real-time operation information of the plurality of migratable network cards is calculated based on the duration, traffic volume, and bandwidth of the preset time period, including: obtaining the real-time operation information of the plurality of migratable network cards according to a target formula; wherein the target formula is: Li=Mi / (Si×T), Li represents the real-time operation information of the migratable network card i, the duration of the preset time period is represented by T, Mi represents the traffic volume of the migratable network card i within the duration T, and Si represents the bandwidth volume of the migratable network card i within the duration T.
[0089] S103: If the real-time load information of the target migratable network card meets the migration condition, the multiple migratable network cards are arranged according to their real-time load information to obtain a target sequence.
[0090] The target migratable network card is any one of the multiple migratable network cards.
[0091] In one embodiment, arranging multiple migratable network cards according to their real-time load information to obtain a target sequence includes: arranging the multiple migratable network cards in descending order according to their real-time load information to obtain the target sequence; accordingly, selecting the node containing the migratable network card with the smallest real-time load information in the target sequence as the destination node, including: selecting the node containing the migratable network card at the end of the target sequence as the destination node. Alternatively, arranging the multiple migratable network cards according to their real-time load information to obtain a target sequence includes: arranging the multiple migratable network cards in ascending order according to their real-time load information to obtain the target sequence; accordingly, selecting the node containing the migratable network card with the smallest real-time load information in the target sequence as the destination node, including: selecting the node containing the migratable network card at the beginning of the target sequence as the destination node.
[0092] S104 : Select the node where the migratable network card with the smallest real-time load information is located in the target sequence as the destination node, and migrate the configuration resources of the target migratable network card to the destination node.
[0093] In one embodiment, the real-time load information of the target migratable network card meets the migration conditions, including: the real-time load information of the target migratable network card is greater than a preset load threshold; or the real-time load information of the target migratable network card is reported as an error; accordingly, the configuration resources of the target migratable network card are migrated to the destination node, including: selecting an available network card in the destination node; configuring the configuration resources of the target migratable network card to the available network card; starting the available network card to run; and stopping the target migratable network card to run.
[0094] It can be seen that this embodiment uses fuzzy matching rules to screen out multiple migratable network cards in the cluster; monitors the real-time load information of multiple migratable network cards; if the real-time load information of the target migratable network card meets the migration conditions, the multiple migratable network cards are arranged according to the real-time load information of the multiple migratable network cards to obtain a target sequence; the target migratable network card is any one of the multiple migratable network cards; the node where the migratable network card with the smallest real-time load information is located is selected as the destination node in the target sequence, and the configuration resources of the target migratable network card are migrated to the destination node. This solution uses fuzzy matching rules to match some fields of the network card name, solving the problem of being unable to migrate due to inconsistent network card names, and can realize the mutual migration of IP resources of network cards with inconsistent names between different nodes in the cluster, ensuring the stability of cluster services.
[0095] In one example, cluster deployment generally requires the following configuration operations: The cluster provides a unified management portal for external services, through which cluster services can be accessed. For example, in Pacemaker, IPaddr services are used for management. Pacemaker is a cluster resource manager in a high-availability cluster, used to manage and monitor resources in a cluster environment to ensure maximum availability of cluster services. See Figure 2 ,The cluster includes two servers, each server has cluster services deployed on it. The client accesses the cluster and its ,security configuration, storage, etc. through the daemon process.
[0096] In Pacemaker, IP resources are primarily managed through the IPaddr service. This includes allocating, monitoring, and troubleshooting IP addresses for cluster nodes. Because cluster services typically require network access, the availability and stability of IP addresses are crucial to their proper operation.
[0097] See Figure 3 , the management of IPaddr services includes:
[0098] Define IP resource services: In the Pacemaker configuration file or through command line configuration, the administrator needs to define IP resource information, including IP address, subnet mask, network interface, gateway address, and other information. This configuration information tells Pacemaker how to allocate and manage IP addresses.
[0099] Resource allocation service: When the cluster service starts, Pacemaker will allocate IP resources to one or more nodes based on the configuration information. This usually involves executing network configuration commands on the nodes and binding the IP addresses to the corresponding network interfaces.
[0100] Monitoring and Failure Recovery Services: Pacemaker continuously monitors the status of nodes and resource usage in the cluster. If a node or IP resource fails, Pacemaker detects this change and triggers appropriate recovery actions. This may include migrating IP resources from the failed node to other healthy nodes to ensure service continuity.
[0101] Resource management service: Receives signals from the pacemaker daemon and performs different operations based on the signals; resource operation methods include starting resources, stopping resources, obtaining resource status, etc.
[0102] Clustered storage systems store service and user data, and can use network storage models such as SANs (Storage Area Networks). A SAN is a high-speed, dedicated network primarily used to connect computer systems and independent storage subsystems. In a SAN, storage devices (such as hard drives) are not directly connected to any single server. Instead, they form a separate network, allowing these storage devices to communicate with multiple servers at high speed and reliability.
[0103] The cluster provides MySQL and Apache services. The cluster's security configuration ensures data security and cluster system stability, using methods such as corosync, arbitration, and isolation. If a network failure occurs in the cluster, the Pacemaker daemon detects the problem and invokes the resource management module to migrate IP resources. During this migration, Pacemaker selects other functioning nodes in the cluster to set IP addresses, restoring normal cluster communication.
[0104] The IP resource migration solution provided in this embodiment includes a resource definition module, a resource management module, and a resource monitoring module. These management modules can achieve the following: the migration process does not require manual intervention or configuration of redundant network cards, and active migration occurs when the network card is overloaded. IP resource migration no longer relies on the Pacemaker daemon, making resource migration more flexible and controllable. This can effectively reduce the instability of cluster services caused by inaccessibility due to cluster network failures, ensuring the normal operation of the entire cluster and the normal use of services.
[0105] See Figure 4 ,The resource definition module in the IP resource migration solution: supports flexible and dynamic configuration by managers, and supports full matching and fuzzy matching rules, so that IP resources can be migrated between nodes with different operating systems or different network card types.
[0106] Resource management module: This module is used to receive signals from cluster management software daemons, such as the Pacemaker daemon, and perform different operations based on the signal type. Resource operations include starting resources, stopping resources, and obtaining resource status. Resource status includes online resources and offline resources.
[0107] Resource monitoring module: This module is used to monitor the status of cluster IP resources, maintain cluster resource information according to the resource configuration rules given by the resource definition module, and send signals to the pacemaker daemon process based on resource status information to perform resource operations.
[0108] In the resource definition module, the IP resource information that needs to be configured includes: network card name (such as eth0), IP address (such as 192.168.122.111), gateway address (such as 192.168.122.1), subnet mask (such as 255.255.0.0), etc. Among them, the network card name supports full match rules and fuzzy match rules. When matching with the full match rule, the network card name must be exactly the same as the name of the network card to be set; when matching with the fuzzy match rule, regular matching is used. For example, if the network card name is set to eth and fuzzy matching is used, then eth0, eth, eth1, ethx, and other network cards can be matched.
[0109] The next step is to use fuzzy matching rules to filter all eligible network interface cards in the cluster and store this information in a pre-set data structure. The filtering criteria require that the network interface card name, gateway address, and subnet mask all match successfully. The purpose of this filtering is to eliminate the need to search the cluster during migration. After the cluster is started, the eligible network interfaces are sorted by load and their information is stored in a linked list, resulting in an IP resource linked list. This stored information primarily includes the network interface card name, IP address, gateway address, and subnet mask.
[0110] The resource monitoring module monitors the information of all qualified network cards in the cluster in real time and updates it to the IP resource list in the resource definition module; it monitors the cluster network information in real time. If the network card fails or the load is too large (for example, the load reaches 90%, and network lag may occur at this time), the order in the list is adjusted and a signal (including migration source node and destination node) is actively sent to the daemon process, so that the daemon process can perform IP resource migration.
[0111] When sorting resources in the IP resource list, the sorting rule is based on network card load size, with nodes with lower loads prioritized, indicating that they are preferred destination nodes during IP resource migration. Load size can be obtained through system commands, and is not limited to the following calculation steps: Network card traffic size is obtained by periodically executing the system command ifconfig, with traffic size represented by M and time represented by T; network card bandwidth is obtained through the ethtool command, with bandwidth represented by S; and load is represented by L, where L = M / (S×T). A larger L indicates a heavier load, and vice versa.
[0112] The resource management module's operations on resources include stopping resources, starting resources, and obtaining resource status. It also receives signals from the cluster management software daemon and performs different operations based on the signal type, mainly including the following three types: Resource startup: mainly receiving cluster management software daemon signals and setting the IP address according to the IP resource list in the resource definition module. This process can be performed through operating system commands (ifconfig or ip) to perform IP configuration operations, such as: ifconfig eth0 192.168.1.10 netmask 255.255.255.0 up. Resource stop: mainly refers to the stop of IP resources. This process can be performed through basic operating system commands to delete IP operations, such as: ip addr del192.168.1.100 / 24dev eth0. Resource status acquisition: This module mainly obtains the current running status of resources, which includes online and offline. In one example, after selecting an available network card in the destination node, the configuration resources of the target migratable network card are configured to the available network card through the ifconfig command or the ip configuration command, so that the available network card starts running; the configuration resources of the target migratable network card are deleted through the operating system command, so that the target migratable network card stops running.
[0113] In this embodiment, the daemon process receives the migration signal from the resource monitoring module, making the resource regulation more flexible, that is, by judging the system load size, timely regulating the resources, making the system resource utilization more reasonable, resource allocation more reasonable, and giving full play to the performance of the cluster. It can also migrate resources in different operating systems or when the network card names are not unified. The migration is more flexible and ensures the stability of the cluster.
[0114] The following introduces a resource migration device provided in an embodiment of the present application. The resource migration device described below can be referenced with other embodiments described in this document.
[0115] See also Figure 5 As shown, the embodiment of the present application discloses a resource migration device, including:
[0116] Determination module 501, for determining multiple migratable network cards in the cluster using fuzzy matching rules; the fuzzy matching rules perform partial field matching on the network card names;
[0117] Monitoring module 502, used to monitor real-time load information of multiple migratable network cards;
[0118] a sorting module 503 configured to sort the multiple migratable network cards according to their real-time load information to obtain a target sequence if the real-time load information of the target migratable network card meets the migration condition; the target migratable network card is any one of the multiple migratable network cards;
[0119] The migration module 504 is configured to select the node where the migratable network card with the smallest real-time load information is located in the target sequence as the destination node, and migrate the configuration resources of the target migratable network card to the destination node.
[0120] In one embodiment, the determination module is specifically configured to:
[0121] Collect the configuration resources of the network cards in each node included in the cluster to obtain a resource set;
[0122] Set the filter items in the fuzzy matching rule; the filter items include: at least one or a combination of network card name, gateway address and subnet mask;
[0123] A fuzzy matching rule is used to select multiple migratable network cards that meet the filter items in the resource collection.
[0124] In one embodiment, it further includes:
[0125] The storage module is used to obtain real-time operation information of multiple migratable network cards after the cluster is started and run; according to the real-time operation information of the multiple migratable network cards, the multiple migratable network cards are recorded in sequence as a resource list; wherein each node of the resource list is each migratable network card, and the attributes of each node are the network card name, gateway address and subnet mask of each migratable network card.
[0126] In one embodiment, the storage module is specifically configured to:
[0127] Obtain the traffic volume and bandwidth of multiple migratable network cards within a preset time period;
[0128] According to the duration of the preset time period, the traffic volume and the bandwidth size, the real-time operation information of multiple migratable network cards is calculated.
[0129] In one embodiment, the storage module is specifically configured to:
[0130] The real-time operation information of multiple migratable network cards is obtained according to the target formula;
[0131] The target formula is: Li = Mi / (Si × T), where Li represents the real-time operating information of the migratable network card i, the duration of the preset time period is represented by T, Mi represents the traffic size of the migratable network card i within the duration T, and Si represents the bandwidth size of the migratable network card i within the duration T.
[0132] In one embodiment, the sorting module is specifically used to: arrange the multiple migratable network cards in descending order according to the real-time load information of the multiple migratable network cards to obtain a target sequence; accordingly, the migration module is specifically used to: take the node where the migratable network card at the end of the target sequence is located as the destination node.
[0133] In one embodiment, the sorting module is specifically used to: arrange multiple migratable network cards in ascending order according to their real-time load information to obtain a target sequence; accordingly, the migration module is specifically used to: take the node where the migratable network card at the first position in the target sequence is located as the destination node.
[0134] In one embodiment, the real-time load information of the target migratable network card meets the migration condition, including: the real-time load information of the target migratable network card is greater than a preset load threshold; or the real-time load information of the target migratable network card reports an error.
[0135] In one embodiment, the migration module is specifically configured to:
[0136] Select an available network card in the destination node;
[0137] Allocate the configuration resources of the target migratable network card to the available network card;
[0138] Enable the available network cards to start running;
[0139] Decommission the target migratable network card.
[0140] Among them, for more specific working processes of each module and unit in this embodiment, reference can be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.
[0141] It can be seen that this embodiment provides a resource migration device that can use fuzzy matching rules to match partial fields of the network card name, thereby solving the problem of inability to migrate due to inconsistent network card names. It can realize the mutual migration of IP resources of network cards with inconsistent names between different nodes in the cluster, thereby ensuring the stability of cluster services.
[0142] An electronic device provided in an embodiment of the present application is introduced below. The electronic device described below can be referenced with other embodiments described herein.
[0143] The present application discloses an electronic device, including:
[0144] Memory, used to store computer programs;
[0145] A processor is used to execute the computer program to implement the method disclosed in any of the above embodiments.
[0146] In this embodiment, when the processor executes the computer program stored in the memory, it can specifically implement the following steps: using fuzzy matching rules to determine multiple migratable network cards in the cluster; performing partial field matching on the network card name using the fuzzy matching rules; monitoring the real-time load information of multiple migratable network cards; if the real-time load information of the target migratable network card meets the migration condition, then arranging the multiple migratable network cards according to the real-time load information of the multiple migratable network cards to obtain a target sequence; the target migratable network card is any one of the multiple migratable network cards; selecting the node where the migratable network card with the smallest real-time load information is located in the target sequence as the destination node, and migrating the configuration resources of the target migratable network card to the destination node.
[0147] In this embodiment, when the processor executes the computer program stored in the memory, it can specifically implement the following steps: collect the configuration resources of the network cards in each node included in the cluster to obtain a resource set; set the filter items in the fuzzy matching rules; the filter items include: at least one or a combination of the network card name, gateway address and subnet mask; use the fuzzy matching rules to select multiple migratable network cards that meet the filter items in the resource set.
[0148] In this embodiment, when the processor executes the computer program stored in the memory, it can specifically implement the following steps: after the cluster starts running, obtain the real-time operation information of multiple migratable network cards; according to the real-time operation information of the multiple migratable network cards, record the multiple migratable network cards in sequence as a resource list; wherein each node of the resource list is each migratable network card, and the attributes of each node are the network card name, gateway address and subnet mask of each migratable network card.
[0149] In this embodiment, when the processor executes the computer program stored in the memory, it can specifically implement the following steps: obtain the traffic size and bandwidth size of multiple migratable network cards within a preset time period; and calculate the real-time operation information of multiple migratable network cards based on the length of the preset time period, the traffic size, and the bandwidth size.
[0150] In this embodiment, when the processor executes the computer program stored in the memory, it can specifically implement the following steps: calculate the real-time operation information of multiple migratable network cards according to a target formula; wherein the target formula is: Li = Mi / (Si×T), Li represents the real-time operation information of the migratable network card i, the duration of the preset time period is represented by T, Mi represents the traffic size of the migratable network card i within the duration T, and Si represents the bandwidth size of the migratable network card i within the duration T.
[0151] In this embodiment, when the processor executes the computer program stored in the memory, it can specifically implement the following steps: select an available network card in the destination node; configure the configuration resources of the target migratable network card to the available network card; start the available network card; and stop the target migratable network card.
[0152] Furthermore, the embodiment of the present application also provides an electronic device. The electronic device can be Figure 6 The server shown can also be Figure 7 Terminal shown. Figure 6 and Figure 7 Each of the diagrams is a structural diagram of an electronic device according to an exemplary embodiment, and the contents in the diagrams cannot be considered as any limitation on the scope of use of the present application.
[0153] Figure 6 This is a schematic diagram of the structure of a server provided in an embodiment of the present application. The server may specifically include: at least one processor, at least one memory, a power supply, a communication interface, an input / output interface, and a communication bus. The memory is used to store a computer program, which is loaded and executed by the processor to implement the relevant steps of resource migration disclosed in any of the aforementioned embodiments.
[0154] In this embodiment, the power supply is used to provide operating voltage for each hardware device on the server; the communication interface can create a data transmission channel between the server and external devices. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface is used to obtain external input data or output data to the outside world. The specific interface type can be selected according to specific application needs and is not specifically limited here.
[0155] In addition, the memory as a carrier for resource storage can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon include operating system, computer programs and data, etc. The storage method can be temporary storage or permanent storage.
[0156] The operating system is used to manage and control the hardware devices and computer programs on the server to enable the processor to operate and process data in the memory. It can be Windows Server, NetWare, Unix, Linux, etc. In addition to including computer programs capable of implementing the resource migration method disclosed in any of the aforementioned embodiments, computer programs can further include computer programs capable of performing other specific tasks. Data can include data such as application update information and data such as application developer information.
[0157] Figure 7This is a schematic diagram of the structure of a terminal provided in an embodiment of the present application. The terminal may specifically include but is not limited to a smartphone, tablet computer, laptop computer or desktop computer.
[0158] Generally, the terminal in this embodiment includes: a processor and a memory.
[0159] The processor may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0160] The memory may include one or more computer non-volatile storage media, which may be non-transitory. The memory may also include high-speed random access memory, and non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory is used to store at least the following computer program, wherein, after the computer program is loaded and executed by the processor, it can implement the relevant steps in the resource migration method performed by the terminal side disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory may also include operating systems and data, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system may include Windows, Unix, Linux, etc. The data may include but is not limited to update information of the application.
[0161] In some embodiments, the terminal may further include a display screen, an input and output interface, a communication interface, a sensor, a power supply, and a communication bus.
[0162] Those skilled in the art will understand that Figure 7The structure shown in the figure does not constitute a limitation to the terminal, and may include more or fewer components than shown in the figure.
[0163] A non-volatile storage medium provided in an embodiment of the present application is introduced below. The non-volatile storage medium described below can be referenced with other embodiments described herein.
[0164] A non-volatile storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the resource migration method disclosed in the aforementioned embodiment. The non-volatile storage medium is a computer-readable non-volatile storage medium that, as a carrier for resource storage, may be a read-only memory, random access memory, a magnetic disk, or an optical disk. The resources stored thereon include an operating system, a computer program, and data, and the storage method may be either temporary or permanent.
[0165] A computer program product provided in an embodiment of the present application is introduced below. The computer program product described below can be referenced with other embodiments described herein.
[0166] A computer program product includes a computer program / instruction, which implements the steps of the resource migration method disclosed above when executed by a processor.
[0167] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0168] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of non-volatile storage medium known in the art.
[0169] This document uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A resource migration method, characterized in that: include: Use fuzzy matching rules to identify multiple migratable network cards in the cluster; The fuzzy matching rule performs partial field matching on the network card name; Monitoring real-time load information of the plurality of migratable network cards; If the real-time load information of the target migratable network card meets the migration condition, the multiple migratable network cards are arranged according to the real-time load information of the multiple migratable network cards to obtain a target sequence; The target migratable network card is any one of the multiple migratable network cards; A node where the migratable network card with the smallest real-time load information is located is selected in the target sequence as a destination node, and configuration resources of the target migratable network card are migrated to the destination node.
2. The method according to claim 1, characterized in that Determining multiple migratable network cards in the cluster by using fuzzy matching rules includes: Collecting the configuration resources of the network cards in each node included in the cluster to obtain a resource set; Setting the filter items in the fuzzy matching rule; the filter items include: at least one or a combination of the network card name, gateway address and subnet mask; The plurality of migratable network cards that meet the filter items are selected from the resource set by using the fuzzy matching rule.
3. The method according to claim 1, characterized in that Also includes: After the cluster is started, obtaining real-time operation information of the multiple migratable network cards; According to the real-time operation information of the multiple migratable network cards, the multiple migratable network cards are sequentially recorded as a resource linked list; Wherein, each node of the resource linked list is each migratable network card, and the attributes of each node are the network card name, gateway address and subnet mask of each migratable network card.
4. The method according to claim 3, characterized in that Acquiring real-time operating information of the multiple migratable network adapters, including: Obtaining the traffic size and bandwidth size of the multiple migratable network cards within a preset time period; The real-time operation information of the plurality of migratable network cards is calculated according to the duration of the preset time period, the traffic volume, and the bandwidth volume.
5. The method according to claim 4, characterized in that Calculating and obtaining real-time operating information of the plurality of migratable network adapters according to the duration of the preset time period, the traffic volume, and the bandwidth volume includes: Obtaining real-time operating information of the plurality of migratable network cards by calculating according to a target formula; Among them, the target formula is: Li=Mi / (Si×T), Li represents the real-time operation information of the migratable network card i, the duration of the preset time period is represented by T, Mi represents the traffic size of the migratable network card i within the duration T, and Si represents the bandwidth size of the migratable network card i within the duration T.
6. The method according to any one of claims 1 to 5, characterized in that Arranging the plurality of migratable network cards according to real-time load information of the plurality of migratable network cards to obtain a target sequence includes: Arrange the multiple migratable network cards in descending order according to the real-time load information of the multiple migratable network cards to obtain the target sequence; Accordingly, selecting the node where the migratable network card with the smallest real-time load information is located in the target sequence as the destination node includes: The node where the migratable network card at the end of the target sequence is located is used as the destination node; or Arranging the plurality of migratable network cards according to real-time load information of the plurality of migratable network cards to obtain a target sequence includes: Arrange the multiple migratable network cards in ascending order according to the real-time load information of the multiple migratable network cards to obtain the target sequence; Accordingly, selecting the node where the migratable network card with the smallest real-time load information is located in the target sequence as the destination node includes: The node where the migratable network card at the first position in the target sequence is located is used as the destination node.
7. The method according to any one of claims 1 to 5, characterized in that The real-time load information of the target migratable network card meets the migration condition, including: the real-time load information of the target migratable network card is greater than a preset load threshold; or the real-time load information of the target migratable network card is reported as an error; Accordingly, migrating the configuration resources of the target migratable network card to the destination node includes: Selecting an available network card in the destination node; Allocate the configuration resources of the target migratable network card to the available network card; Starting the available network card; Stop the target migratable network card from running.
8. A resource migration device, characterized in that: include: A determination module, used to determine multiple migratable network cards in the cluster using fuzzy matching rules; The fuzzy matching rule performs partial field matching on the network card name; A monitoring module, configured to monitor real-time load information of the plurality of migratable network cards; a sorting module configured to arrange the plurality of migratable network cards according to the real-time load information of the plurality of migratable network cards to obtain a target sequence if the real-time load information of the target migratable network card meets the migration condition; The target migratable network card is any one of the multiple migratable network cards; The migration module is configured to select a node where the migratable network card with the smallest real-time load information is located in the target sequence as a destination node, and migrate the configuration resources of the target migratable network card to the destination node.
9. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to execute the computer program to implement the method according to any one of claims 1 to 7.
10. A non-volatile storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Virtual service migration method based on fuzzy logic
CN105743985A
ISCSI access load balancing method
CN108055338A