CN110519349B - Load balancing method and device for fixedly distributing virtual ip based on DNS (Domain name System) - Google Patents

Load balancing method and device for fixedly distributing virtual ip based on DNS (Domain name System) Download PDF

Info

Publication number
CN110519349B
CN110519349B CN201910754025.3A CN201910754025A CN110519349B CN 110519349 B CN110519349 B CN 110519349B CN 201910754025 A CN201910754025 A CN 201910754025A CN 110519349 B CN110519349 B CN 110519349B
Authority
CN
China
Prior art keywords
virtual
node
preset
stored
current
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.)
Active
Application number
CN201910754025.3A
Other languages
Chinese (zh)
Other versions
CN110519349A (en
Inventor
刘耀丹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Jinan data Technology Co ltd
Original Assignee
Inspur Jinan data Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Inspur Jinan data Technology Co ltd filed Critical Inspur Jinan data Technology Co ltd
Priority to CN201910754025.3A priority Critical patent/CN110519349B/en
Publication of CN110519349A publication Critical patent/CN110519349A/en
Application granted granted Critical
Publication of CN110519349B publication Critical patent/CN110519349B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1023Server selection for load balancing based on a hash applied to IP addresses or costs

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a load balancing method, a device, a back-end server and a computer readable storage medium for fixedly distributing virtual ip based on a DNS (domain name system), wherein the method comprises the following steps: the preset nodes collect the current virtual ip corresponding to each node; updating the respective stored virtual ip according to the current virtual ip, and respectively providing service for the respective corresponding target client; the target client is a client accessing the virtual ip stored in the preset node; therefore, the invention can realize the updating of the respective stored virtual ip by the back-end server without failure and failure restoration through the preset nodes to acquire the respective corresponding current virtual ip and update the respective stored virtual ip, thereby reducing the influence of the failure and restoration of the back-end server in the distributed file system on the service provision, improving the efficiency of the back-end server in processing the client request, further strengthening the network data processing capability and improving the flexibility and the availability of the network.

Description

Load balancing method and device for fixedly distributing virtual ip based on DNS (Domain name System)
Technical Field
The invention relates to the technical field of distributed file systems, in particular to a load balancing method and device based on DNS fixed allocation of virtual ip, a back-end server and a computer readable storage medium.
Background
With the development of modern society science and technology, the application of the distributed file system is more and more extensive.
In the prior art, load balancing strategies in a distributed file system include a polling method, a weighted polling method, a minimum connection number method, a random method, a source address hashing method and the like, and a back-end server is distributed mainly by adopting a polling method, a minimum connection number method, a random method or a source address hashing method according to a request of a client so as to achieve the purpose of load balancing; the load balancing strategy allocates a back-end server to the client for providing service, when the back-end server fails, the client can acquire the service of other back-end servers, so that back-end pressure is redistributed, and when the back-end server fails to recover, the client cannot continue to acquire the service of the back-end server, so that the waste of server resources is caused, and the efficiency of the back-end server in processing client requests is reduced.
Therefore, how to reduce the influence of the failure and recovery of the backend server in the distributed file system on the service provision, improve the efficiency of the backend server in processing the client request, further enhance the network data processing capability, and improve the flexibility and availability of the network is a problem which needs to be solved urgently today.
Disclosure of Invention
The invention aims to provide a load balancing method and device for fixedly distributing virtual ip based on a DNS (domain name system) and a back-end server, so as to improve the efficiency of processing a client request by the back-end server, further strengthen the network data processing capacity and improve the flexibility and the usability of a network.
In order to solve the above technical problem, the present invention provides a load balancing method for fixedly allocating virtual ip based on DNS, including:
the preset nodes collect the current virtual ip corresponding to each node; the preset nodes are a plurality of back-end servers corresponding to preset domain names in the distributed file system;
updating the respective stored virtual ip according to the current virtual ip, and respectively providing service for the respective corresponding target client; and the target client is a client accessing the virtual ip stored in the preset node.
Optionally, the acquiring, by the preset node, each corresponding current virtual ip includes:
after the first node fails, the second node collects the corresponding current virtual ip; the current virtual ip corresponding to the second node comprises a drift virtual ip, the drift virtual ip is a virtual ip stored before the first preset node fails, and the preset node comprises the first node and the second node.
Optionally, the acquiring, by the preset node, each corresponding current virtual ip includes:
after the fault of the first node is repaired, the first node and the second node collect the corresponding current virtual ip; the current virtual ip corresponding to the first preset node comprises the drift virtual ip, and the current virtual ip corresponding to the second preset node does not comprise the drift virtual ip.
Optionally, the acquiring, by the preset node, the current virtual ip corresponding to each preset node includes:
each preset node judges whether the current virtual ip corresponding to the preset node is successfully acquired or not;
if yes, executing the step of updating the respective stored virtual ip according to the current virtual ip so as to provide service for the client accessing the virtual ip by using the updated virtual ip;
if not, outputting an abnormal log and juxtaposing the virtual ip stored in the abnormal log.
Optionally, the updating the respective stored virtual ip according to the current virtual ip, and respectively providing services for the client accessing the respective stored virtual ip, includes:
each preset node receives a domain name access request sent by a corresponding target client;
judging whether the domain name in the domain name access request is the preset domain name or not;
and if so, selecting a corresponding virtual ip from the stored virtual ips, and returning the corresponding virtual ip to the corresponding target client.
Optionally, the acquiring, by the preset node, the current virtual ip corresponding to each preset node includes:
and the preset nodes collect the current virtual ip corresponding to each preset node according to a preset time interval.
The invention also provides a load balancing device for fixedly distributing virtual ip based on DNS, comprising:
the acquisition module is used for acquiring current virtual ip corresponding to each preset node; the preset nodes are a plurality of back-end servers corresponding to preset domain names in the distributed file system;
and the storage module is used for updating the virtual ip stored by the preset node according to the current virtual ip so as to provide service for the client accessing the virtual ip by using the updated virtual ip.
Optionally, the acquisition module is specifically configured to acquire the current virtual ip corresponding to each of the current virtual ip according to a preset time interval.
The invention also provides a back-end server, comprising:
a memory for storing a computer program;
and the processor is used for realizing the steps of the load balancing method for fixedly allocating the virtual ip based on the DNS when the computer program is executed.
In addition, the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the load balancing method for fixedly allocating virtual ip based on DNS are implemented as described above.
According to the load balancing method for fixedly distributing the virtual ip based on the DNS, the current virtual ip corresponding to each is acquired through the preset node, the virtual ip stored in each is updated, and the updating of the virtual ip stored in each is realized by the back-end server after failure and failure recovery are not generated, so that the influence of failure and recovery of the back-end server in a distributed file system on service provision is reduced, the efficiency of processing a client request by the back-end server is improved, the network data processing capacity is further enhanced, and the flexibility and the availability of a network are improved. In addition, the invention also provides a load balancing device, a back-end server and a computer readable storage medium for fixedly distributing the virtual ip based on the DNS, and the load balancing device, the back-end server and the computer readable storage medium also have the beneficial effects.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a load balancing method for fixedly allocating virtual ip based on DNS according to an embodiment of the present invention;
fig. 2 is a schematic diagram of node information display of a zz56 node provided by the embodiment of the present invention;
FIG. 3 is a schematic diagram of a node information display of a zz58 node provided by an embodiment of the invention;
FIG. 4 is a schematic diagram of a configuration file of a zz58 node provided by an embodiment of the invention;
fig. 5 is a block diagram of a structure of a load balancing apparatus for fixedly allocating a virtual ip based on a DNS according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart of a load balancing method for fixedly allocating virtual ip based on DNS according to an embodiment of the present invention. The method can comprise the following steps:
step 101: the preset nodes collect the current virtual ip corresponding to each node; the preset nodes are a plurality of back-end servers corresponding to preset domain names in the distributed file system.
It should be noted that, in this step, each preset node may be a backend server corresponding to the preset domain name in the distributed file system, that is, each preset node may provide a service for a client accessing the preset domain name. The current virtual ip corresponding to each preset node can be a virtual ip corresponding to a preset domain name which is required to be acquired by each preset terminal at the current moment.
Specifically, the specific way in which each preset node acquires the corresponding current virtual ip in this step may be set by a designer, for example, each preset node may execute a preset acquisition command, and view the virtual ip state information in a cluster formed by the preset nodes, so as to obtain a virtual ip (current virtual ip) corresponding to its current time; as shown in fig. 2, when the preset collection command is a ctdb ip command, a preset node with a host name of zz56 may display the content in fig. 2 after the ctdb ip command is executed, where a "0" is a number after a "Public IPson node" character string, and represents that a virtual ip corresponding to the preset node is 100.7.44.193, that is, a current virtual ip collected by the preset node with the host name of zz56 is 100.7.44.193. Each preset node can perform information interaction with one control server in the distributed file system, and directly receives the current corresponding virtual ip sent by the control server. As long as each preset node can acquire the corresponding current virtual ip, this embodiment does not limit this.
It can be understood that the purpose of this step may be to collect the current virtual ip corresponding to each preset node, so that the preset node may update the virtual ip stored in each preset node, and thus, after the state information of the virtual ip in the cluster formed by the preset nodes changes, that is, the virtual ip in the cluster drifts, the preset node may update the virtual ip stored in each preset node, thereby providing a service for the target client corresponding to each preset node, and avoiding the efficiency of processing the client request due to the drift of the virtual ip.
That is, this step may include the second node collecting the corresponding current virtual ip after the first node fails; the current virtual ip corresponding to the second node comprises a drift virtual ip, the drift virtual ip is a virtual ip stored by the first preset node before the first preset node fails, the preset node comprises a first node and a second node, namely the first node can be a node which fails in the preset node, and the second node can be a node in the preset node to which the virtual ip stored by the first node drifts after the virtual ip fails. As shown in fig. 2 and 3, when a preset node (first node) with host name zz56 fails, a virtual ip (100.7.44.193) corresponding to the preset node drifts, and the preset node (second node) with host name zz58 looks up that an original virtual ip (ip100.7.44.193) on the zz56 node drifts to a zz58 node through a ctdb ip command, so that the zz56 node does not acquire the virtual ip, and the zz58 node acquires two virtual ips (100.7.44.193 and 100.7.44.194), that is, the number "2" behind the "Public IPson node" character string in fig. 3 represents that the current virtual ip corresponding to the second node is 100.7.44.193 and 100.7.44.194.
Correspondingly, the step can also comprise that after the fault of the first node is repaired, the first node and the second node collect the current virtual ip corresponding to each other; the current virtual ip corresponding to the first preset node comprises a drift virtual ip, and the current virtual ip corresponding to the second preset node does not comprise a drift virtual ip. That is to say, after the fault of the first node is repaired, the first node may acquire a virtual ip that drifts back to itself after the fault is repaired, that is, a drifting virtual ip that drifts to the second node during the fault occurrence process, as shown in 100.7.44.193 in fig. 3; after the fault of the first node is repaired, the second node can acquire the virtual ip of the first node before the fault occurs in the first node, that is, no drift virtual ip drifting back to the first node exists in the acquired corresponding current virtual ip.
Specifically, the specific process of the preset nodes acquiring the respective corresponding current virtual ip in this step may be set by the designer, for example, the preset nodes may acquire the respective corresponding current virtual ip according to a preset time interval, that is, each preset node may acquire the respective corresponding current virtual ip periodically, for example, when the preset time interval is 2s, each preset node may execute a ctdb ip command every 2s to acquire the respective corresponding virtual ip (current virtual ip) acquired at the current time. Or the control may be performed only after the virtual ip drifts, for example, all the preset nodes or the preset nodes corresponding to the drifted virtual ip collect the current virtual ip corresponding to each of the preset nodes, for example, the control server may only control the second node to collect the current virtual ip corresponding to the second node after the first node fails. As long as it is ensured that the corresponding preset node can collect the current virtual ip corresponding to the preset node after the virtual ip is migrated, this embodiment does not limit this.
Furthermore, in the step, each preset node can judge whether the current virtual ip is successfully acquired during the process of acquiring the current virtual ip corresponding to the preset node, namely whether the current virtual ip corresponding to the preset node is successfully acquired; if the collection is successful, step 102 may be entered; if the acquisition is unsuccessful, outputting an abnormal log, and juxtaposing the virtual ip stored by the software developer or the client, namely outputting abnormal information in the log of the software developer or the client so as to facilitate subsequent adjustment and maintenance; by emptying the virtual ip stored in the self-storage device, the interference of the virtual ip stored in the previous storage device on other preset nodes to the service provided by the client side by the preset nodes with unsuccessful acquisition is avoided.
The preset Domain Name in this embodiment may be a Domain Name Server (DNS) that is preset and fixedly allocates a Domain Name corresponding to the virtual ip policy. If the DNS fixed allocation virtual ip policy is named as "ctdb _ ip" policy, and when the preset domain name is www.test1.com, as shown in fig. 4, < domain name ═ www.test1.com "> indicates that the domain name is www.test1.com; < policy value ═ ctdb _ ip "/> denotes that the policy is ctdb _ ip policy; the address pool represents an address pool, and the address pool has three virtual ips 100.7.44.192, 100.7.44.193, and 100.7.44.194, that is, in this step, the current virtual ip acquired by each back-end node (preset node) corresponding to the preset domain name is one or more of the three virtual ips in the address pool.
Step 102: updating the respective stored virtual ip according to the current virtual ip, and respectively providing service for the respective corresponding target client; the target client is a client accessing the virtual ip stored in each preset node.
It can be understood that, in this step, the purpose of the present step may be to update the respective stored virtual ip for each preset node by using the respective collected current virtual ip, so that each preset node may respectively provide a service for a client (target client) accessing the respective updated virtual ip. That is, when the virtual ip accessed by the client is a virtual ip stored in any preset node, the preset node can provide service for the client.
Specifically, the specific manner in which the preset nodes update the respective stored virtual ip according to the current virtual ip in this step may be set by the designer, for example, each preset node may directly replace the virtual ip stored by itself with the current virtual ip acquired by itself, for example, each preset node updates the virtual ip stored in one data structure of its memory according to the current virtual ip acquired by itself (for example, the number of virtual ip and virtual ip), so that each preset node may provide service for a client (target client) accessing the virtual ip in its data structure; each preset node can also judge whether the current virtual ip acquired by each preset node is the same as the virtual ip stored by each preset node, and if not, the virtual ip stored by each preset node is updated, and if so, the virtual ip does not need to be updated. The present embodiment does not set any limit to this.
Correspondingly, the specific way of storing the virtual ip for each preset node can be set by a designer, for example, the virtual ip (current virtual ip) collected by the designer can be stored in a data structure in the memory. As long as each preset node is guaranteed to provide services for the client accessing the virtual ip stored in the preset node, the embodiment does not limit this.
It should be noted that, specific service content provided by each preset node for the corresponding target client may be set by a designer, for example, each preset node may serve as a domain name server to provide a domain name resolution service for the corresponding target node, that is, the step may include that each preset node receives a domain name access request sent by the corresponding target client; judging whether the domain name in the domain name access request is a preset domain name or not; and if so, selecting a corresponding virtual ip from the stored virtual ips, and returning the corresponding virtual ip to the corresponding target client. As shown in fig. 3 and 4, when the virtual ip stored by the zz58 node (the preset node with host name zz 58) is two virtual ips 100.7.44.193 and 100.7.44.194, if the client sends a domain name access request including www.test.com (domain name) to the preset node corresponding to 100.7.44.193, the zz58 node may determine whether www.test1.com is a preset domain name, that is, whether the policy to which www.test1.com belongs is a ctdb _ ip policy; if yes, returning to the corresponding virtual ip selected from the stored virtual ips, such as any one of 100.7.44.193 and 100.7.44.194; if not, returning the corresponding virtual ip according to the processing mode of other strategies to which the domain name in the domain name access request belongs.
Correspondingly, as shown in fig. 4, a configuration file may be set in each preset node, and each preset node reads information in the configuration file and stores the information in the memory, and periodically acquires the number of virtual ip and ip corresponding to each preset node and stores the number of virtual ip and ip in the memory; a client configures a domain name access request, namely the client adds a nameserver ip if executing a vim/etc/resollv. conf command in the prior art, wherein the ip is a virtual ip of a preset node which the client wants to access; when the preset node receives a domain name access request of a client, the preset node searches a domain name and a corresponding strategy thereof in the domain name access request of the client in a memory, and if the domain name is the ctdb _ ip strategy, a virtual ip is found from the virtual ip stored in the memory and returned to the client; and if the policy is other, returning the virtual ip according to the processing mode of other policies.
Specifically, in this embodiment, when each preset node fails, the number of virtual ips collected and stored by each preset node may be 1, namely, the number of the back-end servers corresponding to the preset domain name is equal to the number of the virtual ips in the address pool corresponding to the preset domain name, as shown in fig. 2 and 4, when the preset nodes are the zz56 node, the zz57 node, and the zz58 node, if none of the zz56, zz57, and zz58 nodes failed and recovered, then the virtual ip collected and stored by the zz56 node may be 100.7.44.193, the virtual ip collected and stored by the zz57 node may be 100.7.44.192, and the virtual ip collected and stored by the zz58 node may be 100.7.44.194, at this time, if a client configures/etc/resolv.conf command, the nameserver ip is set to 100.7.44.193, and when the domain name access request including www.test1.com is sent to the preset node corresponding to 100.7.44.193, the zz56 node may return the virtual ip (100.7.44.193) to the client; as shown in fig. 3 and 4, after a zz56 node fails, a virtual ip (100.7.44.193) of a zz56 node drifts to a zz58 node, a virtual ip collected and stored by a zz57 node may be 100.7.44.192, and a virtual ip collected and stored by a zz58 node may be 100.7.44.193 and 100.7.44.194, at this time, if a client sends a domain name access request including www.test1.com to a preset node corresponding to 100.7.44.193, a zz58 node may select one virtual ip from two virtual ips (100.7.44.193 and 100.7.44.194) to return to the client; after the zz56 node returns to normal, the virtual ip (100.7.44.193) drifts back to the zz56 node, the virtual ip collected and stored by the zz56 node may be 100.7.44.193, the virtual ip collected and stored by the zz57 node may be 100.7.44.192, and the virtual ip collected and stored by the zz58 node may be 100.7.44.194, at this time, if the client sends a domain name access request including www.test1.com to a preset node corresponding to 100.7.44.193, the zz56 node may return a virtual ip (100.7.44.193) to the client, that is, the client no longer accesses the zz58 node.
In this embodiment, the preset nodes collect the respective corresponding current virtual ip and update the respective stored virtual ip, so that the update of the respective stored virtual ip by the back-end server without failure and failure recovery can be realized, the influence of failure and recovery of the back-end server in the distributed file system on service provision is reduced, the efficiency of processing the client request by the back-end server is improved, the network data processing capability is further enhanced, and the flexibility and availability of the network are improved.
The load balancing device based on the DNS fixedly allocating virtual ip provided in the embodiment of the present invention is introduced below, and the load balancing device based on the DNS fixedly allocating virtual ip described below and the load balancing method based on the DNS fixedly allocating virtual ip described above may be referred to each other.
Referring to fig. 5, a block diagram of a load balancing apparatus for fixedly allocating virtual ip based on DNS according to an embodiment of the present invention is shown; the device may specifically include:
the acquisition module 10 is configured to acquire current virtual ips corresponding to the preset nodes respectively; the preset nodes are a plurality of back-end servers corresponding to preset domain names in the distributed file system;
and the storage module 20 is configured to update the virtual ip stored in each of the preset nodes according to the current virtual ip, so as to provide a service for a client accessing the virtual ip by using the updated virtual ip.
Optionally, the collecting module 10 is specifically configured to collect the current virtual ip corresponding to each virtual ip according to a preset time interval.
In the embodiment of the invention, each preset node acquires the corresponding current virtual ip and updates the stored virtual ip, so that the updating of the stored virtual ip by the back-end server without failure and failure restoration can be realized, the influence of failure and restoration of the back-end server in the distributed file system on service provision is reduced, the efficiency of processing client requests by the back-end server is improved, the network data processing capacity is further enhanced, and the flexibility and the availability of the network are improved.
An embodiment of the present invention further provides a backend server, including:
a memory for storing a computer program;
and the processor is used for realizing the steps of the load balancing method for fixedly allocating the virtual ip based on the DNS when executing the computer program.
The memory in this embodiment includes at least one type of readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory may in some embodiments be an internal storage unit of the back-end server, e.g. a hard disk of the back-end server. The memory may also be an external storage device of the backend server in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the backend server. Further, the memory may also include both an internal storage unit of the back-end server and an external storage device. The memory can be used for storing application software installed in the back-end server and various data, such as: the code of a program or the like that executes a load balancing method for fixedly assigning virtual ip based on DNS may also be used to temporarily store data that has been output or is to be output.
The processor in this embodiment may be a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip in some embodiments, and is configured to run program codes stored in a memory or process data, for example, codes of a program that executes a load balancing method for fixedly allocating virtual ip based on DNS.
The embodiment of the invention also provides a distributed file system, which comprises a preset number of servers;
wherein each server may be a backend server as provided in the above embodiments.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the load balancing method based on DNS fixed allocation of virtual ips, which are provided in the foregoing embodiment, are implemented.
Wherein the computer-readable storage medium may include: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
The embodiments are described in a progressive mode in the specification, the emphasis of each embodiment is on the difference from the other embodiments, and the same and similar parts among the embodiments can be referred to each other. The device, the backend server, the distributed file system and the computer-readable storage medium disclosed by the embodiment correspond to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the description of the method part.
The load balancing method, device, backend server and computer readable storage medium for fixedly allocating virtual ip based on DNS provided by the present invention are described in detail above. The principles and embodiments of the present invention have been described herein using specific examples, which are presented only to assist in understanding the method and its core concepts of the present invention. It should be noted that, for those skilled in the art, without departing from the principle of the present invention, it is possible to make various improvements and modifications to the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.

Claims (9)

1. A load balancing method for fixedly distributing virtual ip based on DNS is characterized by comprising the following steps:
the preset nodes collect the current virtual ip corresponding to each node; the preset nodes are a plurality of back-end servers corresponding to preset domain names in the distributed file system;
updating the respective stored virtual ip according to the current virtual ip, and respectively providing service for the respective corresponding target client; the target client is a client accessing the virtual ip stored in the preset node;
wherein, the preset node collects the current virtual ip corresponding to each node, including:
each preset node judges whether the current virtual ip corresponding to the preset node is successfully acquired or not;
if yes, executing the step of updating the respective stored virtual ip according to the current virtual ip so as to provide service for the client accessing the virtual ip by using the updated virtual ip;
if not, outputting an abnormal log and juxtaposing the virtual ip stored in the abnormal log.
2. The load balancing method based on the DNS fixed allocation virtual ip according to claim 1, wherein the acquiring, by the preset node, each corresponding current virtual ip includes:
after the first node fails, the second node collects the corresponding current virtual ip; the current virtual ip corresponding to the second node comprises a drift virtual ip, the drift virtual ip is a virtual ip stored before the first node fails, and the preset node comprises the first node and the second node.
3. The load balancing method for fixedly distributing the virtual ip based on the DNS as claimed in claim 2, wherein the collecting, by the preset node, each corresponding current virtual ip includes:
after the fault of the first node is repaired, the first node and the second node collect the current virtual ip corresponding to each other; and the current virtual ip corresponding to the first node comprises the drift virtual ip, and the current virtual ip corresponding to the second node does not comprise the drift virtual ip.
4. The load balancing method for fixedly allocating virtual ip based on DNS according to claim 1, wherein the updating the respective stored virtual ip according to the current virtual ip and respectively providing services for the client accessing the respective stored virtual ip includes:
each preset node receives a domain name access request sent by a corresponding target client;
judging whether the domain name in the domain name access request is the preset domain name or not;
and if so, selecting a corresponding virtual ip from the stored virtual ip, and returning the corresponding virtual ip to the corresponding target client.
5. The load balancing method based on the DNS fixed allocation virtual ip according to any one of claims 1 to 4, wherein the preset nodes collect respective corresponding current virtual ip, and the method comprises:
and the preset nodes collect the current virtual ip corresponding to each preset node according to a preset time interval.
6. A load balancing device for fixedly distributing virtual ip based on DNS is characterized in that the load balancing device comprises:
the acquisition module is used for acquiring current virtual ip corresponding to each preset node; the preset nodes are a plurality of back-end servers corresponding to preset domain names in the distributed file system; specifically, each preset node judges whether the current virtual ip corresponding to the preset node is successfully acquired; if yes, triggering the storage module; if not, outputting an abnormal log, and juxtaposing the virtual ip stored by the abnormal log;
and the storage module is used for updating the virtual ip stored by each preset node according to the current virtual ip so as to provide service for the client accessing the virtual ip by using the updated virtual ip.
7. The load balancing device according to claim 6, wherein the acquiring module is specifically configured to acquire the current virtual ip corresponding to each of the current virtual ip at preset time intervals.
8. A back-end server, comprising:
a memory for storing a computer program;
a processor, configured to implement the steps of the method for load balancing based on DNS fixed allocation of virtual ips according to any one of claims 1 to 5 when executing the computer program.
9. A computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when executed by a processor, the computer program implements the steps of the DNS fixedly allocating virtual ip-based load balancing method according to any one of claims 1 to 5.
CN201910754025.3A 2019-08-15 2019-08-15 Load balancing method and device for fixedly distributing virtual ip based on DNS (Domain name System) Active CN110519349B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910754025.3A CN110519349B (en) 2019-08-15 2019-08-15 Load balancing method and device for fixedly distributing virtual ip based on DNS (Domain name System)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910754025.3A CN110519349B (en) 2019-08-15 2019-08-15 Load balancing method and device for fixedly distributing virtual ip based on DNS (Domain name System)

Publications (2)

Publication Number Publication Date
CN110519349A CN110519349A (en) 2019-11-29
CN110519349B true CN110519349B (en) 2022-07-15

Family

ID=68625296

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910754025.3A Active CN110519349B (en) 2019-08-15 2019-08-15 Load balancing method and device for fixedly distributing virtual ip based on DNS (Domain name System)

Country Status (1)

Country Link
CN (1) CN110519349B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115225608A (en) * 2022-07-22 2022-10-21 济南浪潮数据技术有限公司 Load balancing method, device, equipment and medium for DNS domain name resolution

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107734026A (en) * 2017-10-11 2018-02-23 郑州云海信息技术有限公司 A kind of design method, device and the equipment of network attached storage cluster
CN108494877A (en) * 2018-04-13 2018-09-04 郑州云海信息技术有限公司 A kind of NAS group systems and NAS cluster operation methods
CN108923992A (en) * 2018-08-23 2018-11-30 郑州云海信息技术有限公司 A kind of NAS cluster high availability method, system and electronic equipment and storage medium
CN109271280A (en) * 2018-08-30 2019-01-25 重庆富民银行股份有限公司 Storage failure is switched fast processing method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100639969B1 (en) * 2004-12-02 2006-11-01 한국전자통신연구원 Apparatus for abnormal traffic control and method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107734026A (en) * 2017-10-11 2018-02-23 郑州云海信息技术有限公司 A kind of design method, device and the equipment of network attached storage cluster
CN108494877A (en) * 2018-04-13 2018-09-04 郑州云海信息技术有限公司 A kind of NAS group systems and NAS cluster operation methods
CN108923992A (en) * 2018-08-23 2018-11-30 郑州云海信息技术有限公司 A kind of NAS cluster high availability method, system and electronic equipment and storage medium
CN109271280A (en) * 2018-08-30 2019-01-25 重庆富民银行股份有限公司 Storage failure is switched fast processing method

Also Published As

Publication number Publication date
CN110519349A (en) 2019-11-29

Similar Documents

Publication Publication Date Title
US11586673B2 (en) Data writing and reading method and apparatus, and cloud storage system
US8132046B2 (en) Synchronizing replicas of a database
CN106936899B (en) Configuration method of distributed statistical analysis system and distributed statistical analysis system
CN108881512B (en) CTDB virtual IP balance distribution method, device, equipment and medium
US8046458B2 (en) Method and system for balancing the load and computer resources among computers
CN107666493B (en) Database configuration method and equipment thereof
CN110730250B (en) Information processing method and device, service system and storage medium
CN112995354B (en) Domain name resolution record reconstruction method and domain name resolution method
CN111787036A (en) Solution method, device, storage medium and equipment for front-end private cloud deployment
CN109165112B (en) Fault recovery method, system and related components of metadata cluster
WO2020088170A1 (en) Domain name system configuration method and related apparatus
CN111444157A (en) Distributed file system and data access method
CN110519349B (en) Load balancing method and device for fixedly distributing virtual ip based on DNS (Domain name System)
CN117914675A (en) Method and device for constructing distributed cache system
CN116112569B (en) Micro-service scheduling method and management system
CN112492011A (en) Distributed storage system fault switching method, system, terminal and storage medium
CN114661246B (en) Storage control method and device
CN114610732A (en) Bottom-pocketing data processing method and device
CN115065664A (en) Internet protocol address recovery method, electronic equipment and storage medium
CN115687250A (en) Storage method, equipment, system and computer storage medium
CN114490186B (en) Data backup rule distribution method, node, system and storage medium
CN110532135B (en) Service migration method, system, equipment and storage medium of cluster system
CN111416884B (en) CTDB virtual IP allocation method and device and distributed storage equipment
CN115225608A (en) Load balancing method, device, equipment and medium for DNS domain name resolution
CN114338595B (en) Distributed processing method and device for message, storage medium and processor

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
GR01 Patent grant
GR01 Patent grant