Disclosure of Invention
Based on the above problems, the present application provides a load balancing configuration method and a related device, so as to expand the application range of the DNS server and enable the DNS server to have a load balancing function.
The embodiment of the application discloses the following technical scheme:
in a first aspect, the present application provides a load balancing configuration method, including:
configuring a first main configuration file, a first extension file and a forward analysis file at a first node to realize the configuration of a main domain name system; configuring a second main configuration file and a second extension file at a second node, and synchronizing the forward parsing file with the main domain name system to realize the configuration of the slave domain name system; the forward direction analysis file is used for analyzing the transmission passwords of the master domain name system and the slave domain name system.
As a possible implementation manner, the configuring, at the first node, the first master configuration file specifically includes:
and adding the IP of the second node in the first main configuration file.
As a possible implementation manner, the configuring, at the first node, the first extension file specifically includes:
and adding the IP of the second node in the first extension file, and setting to allow the master domain name system and the slave domain name system to perform data transmission.
As a possible implementation manner, the configuring, at the first node, the forward parsing file specifically includes:
setting a password reference format; the password reference format is used for comparing with the analyzed format of the transmission password, and if the format of the transmission password is correct and is consistent with the password reference format, the master domain name system can correctly analyze the data from the slave domain name system.
As a possible implementation manner, the configuring, at the second node, the second master configuration file specifically includes:
and adding the IP of the first node in the second main configuration file.
As a possible implementation manner, the configuring, at the second node, the second extension file specifically includes:
and adding the IP of the first node in the second extension file, and setting to allow the slave domain name system and the master domain name system to perform data transmission.
As a possible implementation, the method further includes:
and carrying out syntax check on the first main configuration file, the first extension file, the forward parsing file, the second main configuration file and the second extension file.
As a possible implementation manner, after the syntax checking is performed on the first main configuration file, the first extension file, the forward parsing file, the second main configuration file, and the second extension file, the method further includes:
and starting named service for the master domain name system, and starting named service for the slave domain name system.
In a second aspect, the present application provides a load balancing configuration apparatus, including:
the main domain name system configuration module is used for configuring a first main configuration file, a first extension file and a forward analysis file at a first node to realize the configuration of a main domain name system;
the slave domain name system configuration module is used for configuring a second main configuration file and a second extension file at a second node, and synchronizing the forward parsing file with the main domain name system to realize the configuration of the slave domain name system; the forward direction analysis file is used for analyzing the transmission passwords of the master domain name system and the slave domain name system.
Compared with the prior art, the scheme has the following beneficial effects:
according to the load balancing configuration method, a first main configuration file, a first extension file and a forward parsing file are configured at a first node, so that the configuration of a main domain name system is realized; configuring a second main configuration file and a second extension file at a second node, and synchronizing the forward parsing file with the main domain name system to realize the configuration of the slave domain name system; the forward direction analysis file is used for analyzing the transmission passwords of the master domain name system and the slave domain name system.
The method adaptively configures the slave domain name system according to the configuration of the master domain name system, thereby realizing load balancing. By configuring the extension files on the first node and the second node respectively, redundant configuration is realized on the master DNS and the slave DNS respectively. The application range of the DNS server is expanded, so that the DNS server has a load balancing function. When the access amount of the network application is continuously increased and a single processing unit cannot meet the load requirement and the network application flow is about to have a bottleneck, the DNS server can play a load balancing role through the configuration mode. Thereby improving the overall performance of the system.
The DNS load balancing can effectively solve the problems of overlarge data flow and overweight network load, and a server with excellent performance is purchased without spending expensive expenses, so that the existing equipment is fully utilized, and the loss of the data flow caused by single-point failure of the server is avoided. Even if the existing server is expanded and upgraded, a new server is simply added to the service group without changing the existing network structure and stopping the existing service. The problem of network congestion is solved, the response speed of the server is improved, the service is provided nearby, and better access quality is achieved. Load balancing is built on the existing network structure, throughput is increased, network data processing capacity is enhanced, and flexibility and usability of the network are improved.
In addition, the forward analysis file can analyze the transmission passwords of the master domain name system and the slave domain name system, so that the load balancing configuration system can realize the safety of load balancing data transmission.
Detailed Description
In view of the foregoing technical problems, the present application provides a load balancing configuration method and a related apparatus. In order to make the technical solutions of the present invention better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Method embodiment
Referring to fig. 1, the figure is a flowchart of a load balancing configuration method according to an embodiment of the present application.
As shown in fig. 1, the load balancing configuration method provided in this embodiment includes:
step 101: and configuring a first main configuration file, a first extension file and a forward parsing file at the first node to realize the configuration of the main domain name system.
Wherein the forward direction analysis file is used for analyzing the transmission passwords of the master domain name system and the slave domain name system
Step 102: and configuring a second main configuration file and a second extension file at a second node, and synchronizing the forward parsing file with the main domain name system to realize the configuration of the slave domain name system.
In this embodiment, step 102 may be executed simultaneously with step 101, or may be executed later than step 101. In this embodiment, the specific execution sequence of steps 101 and 102 is not limited.
The configuring of the first master configuration file at the first node may specifically include: and adding the IP of the second node in the first main configuration file.
For example, if the IP of the second node is 180.180.0.122, then in the first master profile, the following are added:
notify yes;
also notify{180.180.0.122;};
the configuring of the first extension file at the first node may specifically include: and adding the IP of the second node in the first extension file, and setting to allow the master domain name system and the slave domain name system to perform data transmission.
In connection with the above example, the following are added to the first extension file:
allow-transfer{180.180.0.122;};
the configuring of the forward parsing file at the first node may specifically include: setting a password reference format; the password reference format is used for comparing with the analyzed format of the transmission password, and if the format of the transmission password is correct and is consistent with the password reference format, the master domain name system can correctly analyze the data from the slave domain name system.
The configuring, at the second node, the second master configuration file may specifically include: and adding the IP of the first node in the second main configuration file.
The configuring of the second extension file at the second node may specifically include: and adding the IP of the first node in the second extension file, and setting to allow the slave domain name system and the master domain name system to perform data transmission.
For example, if the IP of the first node is 180.180.0.121, the following is added to the second extension file:
Masters{180.180.0.121;};
the load balancing configuration method provided in the embodiments of the present application is described above. The method adaptively configures the slave domain name system according to the configuration of the master domain name system, thereby realizing load balancing. By configuring the extension files on the first node and the second node respectively, redundant configuration is realized on the master DNS and the slave DNS respectively. When the access amount of the network application is continuously increased and a single processing unit cannot meet the load requirement and the network application flow is about to have a bottleneck, the DNS server can play a load balancing role through the configuration mode. Thereby improving the overall performance of the system.
The DNS load balancing can effectively solve the problems of overlarge data flow and overweight network load, and a server with excellent performance is purchased without spending expensive expenses, so that the existing equipment is fully utilized, and the loss of the data flow caused by single-point failure of the server is avoided. Even if the existing server is expanded and upgraded, a new server is simply added to the service group without changing the existing network structure and stopping the existing service. The problem of network congestion is solved, the response speed of the server is improved, the service is provided nearby, and better access quality is achieved. Load balancing is built on the existing network structure, throughput is increased, network data processing capacity is enhanced, and flexibility and usability of the network are improved.
In addition, the forward analysis file can analyze the transmission passwords of the master domain name system and the slave domain name system, so that the load balancing configuration system can realize the safety of load balancing data transmission.
Optionally, to ensure that the files configured for the master DNS and the slave DNS in the method can normally operate, the method may further include:
and carrying out syntax check on the first main configuration file, the first extension file, the forward parsing file, the second main configuration file and the second extension file.
Therefore, through the grammar check of the file, the correctness of the file grammar is improved, and the DNS load balance is convenient to realize.
Optionally, in order to enable the configured DNS service to be started normally, after the syntax checking is performed on the first main configuration file, the first extension file, the forward parsing file, the second main configuration file, and the second extension file, the method may further include:
and starting named service for the master domain name system, and starting named service for the slave domain name system.
Furthermore, after normal boot of named service, the master DNS and the slave DNS can be started normally, and load balancing service is provided.
Based on the load balancing configuration method provided by the foregoing embodiment, correspondingly, the present application provides a load balancing configuration apparatus. The following describes in detail an implementation of the apparatus with reference to embodiments and drawings.
Device embodiment
Referring to fig. 2, the figure is a schematic structural diagram of a load balancing configuration apparatus according to an embodiment of the present application.
As shown in fig. 2, the load balancing configuration apparatus provided in this embodiment includes:
a master domain name system configuration module and a slave domain name system configuration module.
The system comprises a main domain name system configuration module, a forward analysis module and a second node, wherein the main domain name system configuration module is used for configuring a first main configuration file, a first extension file and a forward analysis file at a first node to realize the configuration of a main domain name system;
the slave domain name system configuration module is used for configuring a second main configuration file and a second extension file at a second node, and synchronizing the forward parsing file with the main domain name system to realize the configuration of the slave domain name system; the forward direction analysis file is used for analyzing the transmission passwords of the master domain name system and the slave domain name system.
The load balancing configuration device provided in the embodiments of the present application is described above. The device adaptively configures the slave domain name system according to the configuration of the master domain name system, thereby realizing load balancing. By configuring the extension files on the first node and the second node respectively, redundant configuration is realized on the master DNS and the slave DNS respectively. The application range of the DNS server is expanded, so that the DNS server has a load balancing function. When the access amount of the network application is continuously increased and a single processing unit cannot meet the load requirement and the network application flow is about to have a bottleneck, the DNS server can play a load balancing role through the configuration mode. Thereby improving the overall performance of the system.
The DNS load balancing can effectively solve the problems of overlarge data flow and overweight network load, and a server with excellent performance is purchased without spending expensive expenses, so that the existing equipment is fully utilized, and the loss of the data flow caused by single-point failure of the server is avoided. Even if the existing server is expanded and upgraded, a new server is simply added to the service group without changing the existing network structure and stopping the existing service. The problem of network congestion is solved, the response speed of the server is improved, the service is provided nearby, and better access quality is achieved. Load balancing is built on the existing network structure, throughput is increased, network data processing capacity is enhanced, and flexibility and usability of the network are improved.
In addition, the forward analysis file can analyze the transmission passwords of the master domain name system and the slave domain name system, so that the load balancing configuration system can realize the safety of load balancing data transmission.
As a possible implementation manner, the main domain name system configuration module may specifically include:
a first configuration unit, configured to add the IP of the second node in the first master configuration file.
As a possible implementation manner, the main domain name system configuration module may specifically include:
and the second configuration unit is used for adding the IP of the second node in the first extension file and setting permission for the data transmission between the master domain name system and the slave domain name system.
As a possible implementation manner, the main domain name system configuration module may specifically include:
a third configuration unit for setting a password reference format; the password reference format is used for comparing with the analyzed format of the transmission password, and if the format of the transmission password is correct and is consistent with the password reference format, the master domain name system can correctly analyze the data from the slave domain name system.
As a possible implementation manner, the slave domain name system configuration module may specifically include:
a fourth configuration unit, configured to add the IP of the first node to the second master configuration file.
As a possible implementation manner, the main domain name system configuration module may specifically include:
a fifth configuration unit, configured to add the IP of the first node to the second extension file, and set to allow the slave domain name system to perform data transmission with the master domain name system.
Optionally, the load balancing configuration apparatus may further include:
and the grammar checking module is used for carrying out grammar checking on the first main configuration file, the first extension file, the forward parsing file, the second main configuration file and the second extension file.
Therefore, through the grammar check of the file, the correctness of the file grammar is improved, and the DNS load balance is convenient to realize.
Optionally, the load balancing configuration apparatus may further include:
and the service starting module is used for starting named service for the master domain name system and starting named service for the slave domain name system.
Furthermore, after normal boot of named service, the master DNS and the slave DNS can be started normally, and load balancing service is provided.
It should be noted that, in the present specification, all the embodiments are described in a progressive manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus and system embodiments, since they are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described embodiments of the apparatus and system are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts suggested as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only one specific embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present application should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.