CN106487916B - Statistical method and device for connection number - Google Patents

Statistical method and device for connection number Download PDF

Info

Publication number
CN106487916B
CN106487916B CN201610973126.6A CN201610973126A CN106487916B CN 106487916 B CN106487916 B CN 106487916B CN 201610973126 A CN201610973126 A CN 201610973126A CN 106487916 B CN106487916 B CN 106487916B
Authority
CN
China
Prior art keywords
node
connection
current moment
sending
counting
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
CN201610973126.6A
Other languages
Chinese (zh)
Other versions
CN106487916A (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.)
Suzhou Wave Intelligent Technology Co Ltd
Original Assignee
Suzhou Wave Intelligent 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 Suzhou Wave Intelligent Technology Co Ltd filed Critical Suzhou Wave Intelligent Technology Co Ltd
Priority to CN201610973126.6A priority Critical patent/CN106487916B/en
Publication of CN106487916A publication Critical patent/CN106487916A/en
Application granted granted Critical
Publication of CN106487916B publication Critical patent/CN106487916B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network-specific arrangements or communication protocols supporting networked applications
    • H04L67/10Network-specific arrangements or communication protocols supporting networked applications in which an application is distributed across nodes in the network
    • H04L67/1097Network-specific arrangements or communication protocols supporting networked applications in which an application is distributed across nodes in the network for distributed storage of data in a network, e.g. network file system [NFS], transport mechanisms for storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements or network protocols for addressing or naming
    • H04L61/15Directories; Name-to-address mapping
    • H04L61/1505Directories; Name-to-address mapping involving standard directories or standard directory access protocols
    • H04L61/1511Directories; Name-to-address mapping involving standard directories or standard directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network-specific arrangements or communication protocols supporting networked applications
    • H04L67/10Network-specific arrangements or communication protocols supporting networked applications in which an application is distributed across nodes in the network
    • H04L67/1002Network-specific arrangements or communication protocols supporting networked applications in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers, e.g. load balancing

Abstract

The invention discloses a statistical method and a device of connection number, which are applied to a DNS service cluster with a plurality of conventional nodes and a management node, and the method comprises the following steps: counting the connection number of each conventional node at the current moment in a timing mode; and sending the counted connection number of each conventional node at the current moment to the management node for the management node to realize DNS load balancing. In the technical scheme disclosed by the application, the connection number of each conventional node is counted regularly, and the obtained connection number is sent to the management node, so that the management node can realize load balancing based on the obtained connection number; the management node does not need to acquire the connection number of each conventional node after receiving the client request, but directly selects the minimum connection number from the acquired connection numbers of each conventional node closest to the current moment when receiving the client request so as to realize DNS load balancing, thereby greatly shortening the feedback time and improving the performance of the DNS service cluster.

Description

Statistical method and device for connection number
Technical Field
The invention relates to the technical field of distributed storage software, in particular to a method and a device for counting connection numbers.
Background
When using distributed storage services, a plurality of server nodes are generally used to form a cluster, and the cluster can provide DNS (Domain Name System) services, and therefore may also be referred to as a DNS service cluster.
To ensure excessive client access or server failure, DNS load balancing in a cluster is often required. In the prior art, DNS load balancing is usually implemented through a connection number policy, specifically, a node in a cluster is used as a management node, when a client sends a request, the management node determines the connection number of each node in the cluster, and returns an IP address of a node with the minimum connection number to the client for the client to access. However, since the process of receiving the request of the client to acquire the number of connections of each node requires a certain amount of time, the IP address returned to the client is slow, that is, the feedback speed is slow.
In summary, in the prior art, there is a problem that the feedback speed is slow in the process of processing the request initiated by the client.
Disclosure of Invention
The invention aims to provide a method and a device for counting the number of connections, which aim to solve the problem of low feedback speed in the process of processing a request initiated by a client in the prior art.
In order to achieve the above purpose, the invention provides the following technical scheme:
a statistical method of connection number is applied to a DNS service cluster with a plurality of conventional nodes and a management node, and comprises the following steps:
counting the connection number of each conventional node at the current moment in a timing mode;
and sending the counted connection number of each conventional node at the current moment to the management node, so that the management node can realize DNS load balancing.
Preferably, the timing statistics on the number of connections of each conventional node at the current time includes:
and timing and utilizing an nf _ conntrack _ ipv4 module of each conventional node to count the number of connections at the current moment.
Preferably, the counting of the number of connections at the current time by using the nf _ conntrack _ ipv4 module of each conventional node itself includes:
and regularly counting the number of connections corresponding to the specified service at the current time by using an nf _ conntrack _ ipv4 module of each conventional node.
Preferably, the sending the counted connection number of each conventional node at the current time to the management node includes:
and sending the counted connection number of the conventional node at the current moment to the management node by utilizing the SNMP trap of each conventional node.
Preferably, the method further comprises the following steps:
and if the statistics of the connection number of any conventional node at the current moment fails or the sending of the connection number of the conventional node at the current moment fails, sending failure information to a specified management terminal, and returning to the step of performing the statistics of the connection number of the corresponding conventional node at the current moment or returning to the step of performing the sending of the connection number of the corresponding conventional node at the current moment.
A statistical device of connection number is applied to a DNS service cluster with a plurality of regular nodes and a management node, and comprises:
the counting module is used for counting the connection number of each conventional node at the current moment in a timing mode;
and the sending module is used for sending the counted connection number of each conventional node at the current moment to the management node so as to realize DNS load balancing by the management node.
Preferably, the statistical module includes:
and the counting unit is used for counting the number of connections at the current moment by utilizing the nf _ conntrack _ ipv4 module of each conventional node.
Preferably, the statistical unit includes:
and the counting subunit is used for counting the number of connections corresponding to the specified service at the current moment by utilizing the nf _ conntrack _ ipv4 module of each conventional node.
Preferably, the sending module includes:
and the sending unit is used for sending the counted connection number of the conventional node at the current moment to the management node by utilizing the SNMP trap of each conventional node.
Preferably, the method further comprises the following steps:
and the failure reaction module is used for sending failure information to a specified management terminal if the statistics on the connection number of any conventional node at the current moment fails or the sending of the connection number of the conventional node at the current moment fails, and instructing the statistics module to perform the step of counting the connection number of the corresponding conventional node at the current moment or instructing the sending module to perform the step of sending the connection number of the corresponding conventional node at the current moment.
The invention provides a statistical method and a device of connection number, which are applied to a DNS service cluster with a plurality of conventional nodes and a management node, wherein the method comprises the following steps: counting the connection number of each conventional node at the current moment in a timing mode; and sending the counted connection number of each conventional node at the current moment to the management node, so that the management node can realize DNS load balancing. In the technical scheme disclosed by the application, the connection number of each conventional node is counted regularly, and the obtained connection number is sent to the management node, so that the management node can realize load balancing based on the obtained connection number; compared with the prior art, in the technical scheme disclosed by the application, the management node does not need to acquire the connection number of each conventional node after receiving the client request, but directly selects the minimum connection number from the acquired connection numbers of each conventional node closest to the current moment when receiving the client request so as to realize DNS load balancing, so that the feedback time is greatly shortened, and the performance of the DNS service cluster is improved.
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 description of the embodiments or the prior art 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 method for counting connection numbers according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a device for counting connection numbers according to an embodiment of the present invention.
Detailed Description
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 only a part of the embodiments of the present invention, 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 invention.
Referring to fig. 1, a flowchart of a method for counting connection numbers according to an embodiment of the present invention is shown, where the method is applied to a DNS service cluster having a plurality of regular nodes and a management node, and may include:
s11: and counting the number of connections of each conventional node at the current moment in a timing mode.
The regular nodes are other nodes except the management node in the DNS service cluster. The timing in the present application may specifically be a preset time period, and then the connection number of each conventional node at the current time is counted every time the time period passes, or each conventional node has a corresponding time period, and the time periods corresponding to different conventional nodes may be the same or different, and thus, for any conventional node, the connection number is counted every time the corresponding time period passes. It should be noted that the number of connections of any conventional node is the sum of the connections of the conventional node with the client and the connections with other nodes, and specifically, such connections may include TCP-based connections and UDP-based connections, and may be determined according to actual needs, which is within the protection scope of the present invention.
S12: and sending the counted connection number of each conventional node at the current moment to the management node for the management node to realize DNS load balancing.
After the connection number of the conventional node is obtained through statistics, the connection number is sent to the management node, therefore, when a client initiates a request, the management node does not need to count the connection number of each conventional node, but directly selects the minimum connection number from the obtained connection numbers of each conventional node closest to the current moment to realize DNS load balancing, and the feedback time is greatly shortened.
In the technical scheme disclosed by the application, the connection number of each conventional node is counted regularly, and the obtained connection number is sent to the management node, so that the management node can realize load balancing based on the obtained connection number; compared with the prior art, in the technical scheme disclosed by the application, the management node does not need to acquire the connection number of each conventional node after receiving the client request, but directly selects the minimum connection number from the acquired connection numbers of each conventional node closest to the current moment when receiving the client request so as to realize DNS load balancing, so that the feedback time is greatly shortened, and the performance of the DNS service cluster is improved.
The method for counting the number of connections provided in the embodiment of the present invention is a method for counting the number of connections of each conventional node at a certain time, and may include:
the timing utilizes the nf _ conntrack _ ipv4 module of each regular node to count the number of connections at the current moment.
The linux kernel can be used by each node in the application, and the existing linux kernel provides a module for counting the number of connections under the current node, namely nf _ conntrack, nf _ conntrack _ ipv4 and nf _ conntrack _ ipv 6. The nf _ conntrack module is a basic module, on the basis of the basic module, the nf _ conntrack _ ipv4 module is used for counting the number of connections of the corresponding conventional node, the counted number of connections can be stored in a/proc/net/nf _ conntrack file in a memory sharing mode, and the corresponding number of connections and the source IP and the destination IP corresponding to each connection are obtained by intercepting the file. Therefore, statistics of the connection number is realized quickly and efficiently by using a module carried by the linux kernel, and the speed of acquiring the connection number is further improved.
The method for counting the number of connections provided in the embodiment of the present invention, which regularly utilizes the nf _ conntrack _ ipv4 module of each conventional node to count the number of connections at the current time, may include:
and (4) counting the number of connections corresponding to the specified service at the current time by utilizing an nf _ conntrack _ ipv4 module which each conventional node has.
The specified services may include nfs, cifs, and the like, and other settings are specifically performed according to actual needs, and the number of connections corresponding to the specified services is the number of connections that need to be implemented when the specified services are implemented. Therefore, the statistics of the connection number can be the statistics of the connection number corresponding to the specified service, so that when the connection number corresponding to the specified service needs to be counted, the connection number corresponding to the specified service can be only counted, the connection number corresponding to other services does not need to be counted, and the speed of counting the connection number is greatly increased.
The method for counting the number of connections provided in the embodiment of the present invention sends the counted number of connections of each regular node at the current time to the management node, and may include:
and sending the counted connection number of the conventional node at the current moment to a management node by utilizing the SNMP trap of each conventional node.
The SNMP trap is a certain entry in the prior art, and is not described herein again; the access can automatically send the connection number to the management node after counting the connection number of the conventional node, thereby realizing the real-time sending of information and improving the accuracy of information transmission.
The method for counting the number of connections provided by the embodiment of the invention can further comprise the following steps:
and if the statistics of the connection number of any conventional node at the current moment fails or the sending of the connection number of the conventional node at the current moment fails, sending failure information to a specified management terminal, and returning to the step of performing the statistics of the connection number of the corresponding conventional node at the current moment or returning to the step of performing the sending of the connection number of the corresponding conventional node at the current moment.
If the statistics of the connection number of any conventional node at the current moment fails, the step of acquiring the connection number of the conventional node is returned to be executed, if the sending of the connection number of any conventional node at the current moment fails, the step of sending the connection number of the conventional node is returned to be executed, failure information is sent to a designated terminal under the two failure conditions, and the designated terminal is a preset terminal corresponding to a manager.
In addition, the management node can also realize the statistics of the number of its own connections according to the above manner, and the difference between the management node and the conventional node is that the management node adds a function of realizing the balancing of the DNS load, and when the management node receives a request from a client to select the node with the minimum number of connections, the selected node also includes the management node itself.
An embodiment of the present invention further provides a device for counting connection numbers, which is applied to a DNS service cluster having a plurality of conventional nodes and a management node, and as shown in fig. 2, the device may include:
the statistical module 11 is configured to periodically count the connection number of each conventional node at the current time;
and the sending module 12 is configured to send the counted connection number of each conventional node at the current time to the management node, so that the management node can implement DNS load balancing.
It should be noted that the statistical device for the connection number provided in the embodiment of the present invention may be disposed in each conventional node, or may be disposed separately, and specifically, may be set according to actual needs, and all of them are within the protection scope of the present invention.
In the device for counting the number of connections provided in the embodiment of the present invention, the counting module may include:
and the counting unit is used for counting the connection number of the current time by utilizing the nf _ conntrack _ ipv4 module of each conventional node.
In the device for counting connection numbers provided in the embodiment of the present invention, the counting unit may include:
and the counting subunit is used for counting the number of connections corresponding to the specified service at the current moment by utilizing the nf _ conntrack _ ipv4 module of each conventional node.
In the device for counting connection numbers provided in the embodiment of the present invention, the sending module may include:
and the sending unit is used for sending the counted connection number of the conventional node at the current moment to the management node by utilizing the SNMP trap of each conventional node.
The device for counting the number of connections provided in the embodiment of the present invention may further include:
and the failure reaction module is used for sending failure information to the specified management terminal if the statistics on the connection number of any conventional node at the current moment fails or the sending of the connection number of the conventional node at the current moment fails, and instructing the statistics module to execute the step of counting the connection number of the corresponding conventional node at the current moment or instructing the sending module to execute the step of sending the connection number of the corresponding conventional node at the current moment.
For a description of a relevant part in the device for counting the number of connections provided in the embodiment of the present invention, reference is made to detailed descriptions of a corresponding part in the method for counting the number of connections provided in the embodiment of the present invention, and details are not repeated here.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (2)

1. A statistical method of connection number is applied to a DNS service cluster with a plurality of conventional nodes and a management node, and is characterized by comprising the following steps:
counting the connection number of each conventional node at the current moment in a timing mode;
sending the counted connection number of each conventional node at the current moment to the management node for the management node to realize DNS load balancing;
and counting the connection number of each conventional node at the current moment in a timing mode, wherein the counting comprises the following steps:
regularly utilizing an nf _ conntrack _ ipv4 module of each conventional node to count the number of connections corresponding to the specified service at the current time;
sending the counted connection number of each conventional node at the current moment to the management node, wherein the sending comprises the following steps:
sending the counted connection number of the conventional node at the current moment to the management node by utilizing the SNMP trap of each conventional node;
the method further comprises the following steps:
and if the statistics of the connection number of any conventional node at the current moment fails or the sending of the connection number of the conventional node at the current moment fails, sending failure information to a specified management terminal, and returning to the step of performing the statistics of the connection number of the corresponding conventional node at the current moment or returning to the step of performing the sending of the connection number of the corresponding conventional node at the current moment.
2. A device for counting the number of connections, applied to a DNS service cluster having a plurality of regular nodes and a management node, comprising:
the counting module is used for counting the connection number of each conventional node at the current moment in a timing mode;
the sending module is used for sending the counted connection number of each conventional node at the current moment to the management node so that the management node can realize DNS load balancing;
the statistic module comprises:
the counting subunit is used for counting the number of connections corresponding to the specified service at the current moment by utilizing the nf _ conntrack _ ipv4 module of each conventional node;
the sending module comprises:
the sending unit is used for sending the counted connection number of the conventional node at the current moment to the management node by utilizing the SNMP trap of each conventional node;
the device further comprises:
and the failure reaction module is used for sending failure information to a specified management terminal if the statistics on the connection number of any conventional node at the current moment fails or the sending of the connection number of the conventional node at the current moment fails, and instructing the statistics module to perform the step of counting the connection number of the corresponding conventional node at the current moment or instructing the sending module to perform the step of sending the connection number of the corresponding conventional node at the current moment.
CN201610973126.6A 2016-11-04 2016-11-04 Statistical method and device for connection number Active CN106487916B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610973126.6A CN106487916B (en) 2016-11-04 2016-11-04 Statistical method and device for connection number

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610973126.6A CN106487916B (en) 2016-11-04 2016-11-04 Statistical method and device for connection number

Publications (2)

Publication Number Publication Date
CN106487916A CN106487916A (en) 2017-03-08
CN106487916B true CN106487916B (en) 2020-01-10

Family

ID=58271977

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610973126.6A Active CN106487916B (en) 2016-11-04 2016-11-04 Statistical method and device for connection number

Country Status (1)

Country Link
CN (1) CN106487916B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20110000996A (en) * 2009-06-29 2011-01-06 주식회사 모임 Apparatus and method for presenting personalized contents information based on artificial intelligence, and recording medium thereof
CN102638457A (en) * 2012-03-23 2012-08-15 苏州阔地网络科技有限公司 Method and system for automatically allocating server resource
CN105007337A (en) * 2015-08-20 2015-10-28 浪潮(北京)电子信息产业有限公司 Cluster system load balancing method and system thereof
CN105721552A (en) * 2016-01-22 2016-06-29 深圳市瑞驰信息技术有限公司 Method for implementing dynamic load balancing based on domain name system (DNS) and DNS

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5157472B2 (en) * 2008-01-22 2013-03-06 富士通株式会社 Load distribution apparatus having bandwidth control function and setting method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20110000996A (en) * 2009-06-29 2011-01-06 주식회사 모임 Apparatus and method for presenting personalized contents information based on artificial intelligence, and recording medium thereof
CN102638457A (en) * 2012-03-23 2012-08-15 苏州阔地网络科技有限公司 Method and system for automatically allocating server resource
CN105007337A (en) * 2015-08-20 2015-10-28 浪潮(北京)电子信息产业有限公司 Cluster system load balancing method and system thereof
CN105721552A (en) * 2016-01-22 2016-06-29 深圳市瑞驰信息技术有限公司 Method for implementing dynamic load balancing based on domain name system (DNS) and DNS

Also Published As

Publication number Publication date
CN106487916A (en) 2017-03-08

Similar Documents

Publication Publication Date Title
US9554276B2 (en) System and method for on the fly protocol conversion in obtaining policy enforcement information
CN103825975A (en) Cdn node distribution server and system
US20200195511A1 (en) Network management method and related device
US20120102192A1 (en) Network system
US10470017B2 (en) Identity information processing method, database control system, and related device
US10182033B1 (en) Integration of service scaling and service discovery systems
US10021176B2 (en) Method and server for managing traffic-overload on a server
US10637748B2 (en) Method and apparatus for establishing interface between VNFMS, and system
CN106487916B (en) Statistical method and device for connection number
CN103795581A (en) Address processing method and address processing device
US10951732B2 (en) Service processing method and device
CN107317880B (en) Method and device for realizing load balance
CN107508760B (en) Method for load distribution based on line source IP
CN106470193A (en) A kind of anti-DoS of DNS recursion server, the method and device of ddos attack
CN106034166A (en) Method and apparatus for configuring network parameters of local area network,
EP2656591A1 (en) Dns proxy service for multi-core platforms
US10135916B1 (en) Integration of service scaling and external health checking systems
CN105978815B (en) Method for obtaining network distribution of routing equipment
EP3672203A1 (en) Distribution method for distributed data computing, device, server and storage medium
EP3435615B1 (en) Network service implementation method, service controller, and communication system
WO2021098407A1 (en) Mec-based service node allocation method and apparatus, and related server
US9960957B2 (en) Methods for prioritizing failover of logical interfaces (LIFs) during a node outage and devices thereof
WO2020253266A1 (en) Method for providing edge service, apparatus and device
WO2019079967A1 (en) Method for allocating task manager in distributed crawler system and system
CN109002296A (en) A kind of method for downloading software, device and base station

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20191121

Address after: 215100 No. 1 Guanpu Road, Guoxiang Street, Wuzhong Economic Development Zone, Suzhou City, Jiangsu Province

Applicant after: Suzhou Wave Intelligent Technology Co., Ltd.

Address before: 450018 Henan province Zheng Dong New District of Zhengzhou City Xinyi Road No. 278 16 floor room 1601

Applicant before: Zhengzhou Yunhai Information Technology Co. Ltd.

Effective date of registration: 20191121

Address after: 215100 No. 1 Guanpu Road, Guoxiang Street, Wuzhong Economic Development Zone, Suzhou City, Jiangsu Province

Applicant after: Suzhou Wave Intelligent Technology Co., Ltd.

Address before: 450018 Henan province Zheng Dong New District of Zhengzhou City Xinyi Road No. 278 16 floor room 1601

Applicant before: Zhengzhou Yunhai Information Technology Co. Ltd.

GR01 Patent grant
GR01 Patent grant