CN106713503B - Method and device for acquiring service server information in real time - Google Patents

Method and device for acquiring service server information in real time Download PDF

Info

Publication number
CN106713503B
CN106713503B CN201710086789.0A CN201710086789A CN106713503B CN 106713503 B CN106713503 B CN 106713503B CN 201710086789 A CN201710086789 A CN 201710086789A CN 106713503 B CN106713503 B CN 106713503B
Authority
CN
China
Prior art keywords
server
domain name
service server
service
directory
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
CN201710086789.0A
Other languages
Chinese (zh)
Other versions
CN106713503A (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.)
Beijing Qunar Software Technology Co Ltd
Original Assignee
Beijing Qunar Software 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 Beijing Qunar Software Technology Co Ltd filed Critical Beijing Qunar Software Technology Co Ltd
Priority to CN201710086789.0A priority Critical patent/CN106713503B/en
Publication of CN106713503A publication Critical patent/CN106713503A/en
Application granted granted Critical
Publication of CN106713503B publication Critical patent/CN106713503B/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
    • 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

Landscapes

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

Abstract

The invention discloses a method and a device for acquiring service server information in real time. Wherein, the method comprises the following steps: the domain name server sends a query instruction to the directory server; the domain name server receives the address and state information of the service server returned by the directory server; the domain name server filters the service server state information meeting the preset conditions according to the preset conditions; and the domain name server returns the filtered address information of the service server to the client terminal. The invention solves the technical problem of continuous reduction of the performance of the service server caused by continuous large number of requests.

Description

Method and device for acquiring service server information in real time
Technical Field
The invention relates to the field of servers, in particular to a method and a device for acquiring service server information in real time.
Background
Currently, a Server DNS (Domain Name Server) is a Server that converts a Domain Name (Domain Name) and an IP address (IP address) corresponding to the Domain Name; a table of domain names and corresponding IP addresses (IP addresses) is stored in the DNS to resolve the domain name of the message; the domain name is the name of a computer or a group of computers on the Internet, and is used for identifying the electronic position (sometimes also referred to as the geographical position) of the computer during data transmission; domain names are composed of a string of names separated by dots, usually containing the name of an organization, and always include a two to three letter suffix to indicate the type of organization or country or region in which the domain is located.
DNS is an abbreviation of computer Domain Name System (Domain Name Service), which is composed of a Domain Name resolver and a Domain Name server; the domain name server is a server which stores domain names and corresponding IP addresses of all hosts in the network and has the function of converting the domain names into the IP addresses; the domain name must correspond to an IP address, one IP address can have a plurality of domain names, and the IP address does not necessarily have the domain name; the domain name system adopts a hierarchical structure similar to a directory tree; the domain name server is usually the server side in a client/server model, and has two main forms: a main server and a forwarding server. The process of mapping the domain name to the IP address is called a DNS server which can sense the domain name resolution, can sense the state of a service server in real time, updates the record A in real time and provides reliable customized load balancing DNS resolution service.
At present, aiming at the problems of load increase, response time increase, performance reduction and the like of a service server caused by burst access of the service server, at the moment, a domain name server cannot sense the change of the service server, still analyzes a client request to the service server, and the pressure of the server is increased.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a method and a device for acquiring service server information in real time, which solve the technical problem of continuous reduction of service server performance caused by continuous large requests.
According to an aspect of the embodiments of the present invention, a method for acquiring information of a service server in real time is provided, including: the domain name server sends a query instruction to a directory server, wherein at least one service server is registered in the directory server; the domain name server receives the address and state information of the service server returned by the directory server; the domain name server filters the service server state information meeting the preset conditions according to the preset conditions; and the domain name server returns the filtered address information of the service server to the client terminal.
Further, the state information of the service server includes: the processor utilization rate, the available memory space, the available disk space and the communication state of the network interface of the service server.
Further, the domain name server filters the service server state information meeting the predetermined condition according to the configuration predetermined condition, including: whether processor usage is greater than or equal to a predetermined efficiency value; whether the available space of the memory is larger than or equal to a first preset space value or not; whether the available space of the disk is larger than or equal to a second preset space value; whether the communication state of the network interface is an idle state.
Further, before the domain name server sends out the query instruction to the directory server, the method further comprises: starting at least one service server; the business server creates an appointed node on the directory server; the appointed node is a service storage space created by the service server under the directory server, and the appointed node corresponds to the domain name information of the service server one by one; the service server stores the self address and the state information to the appointed node.
Further, after the business server creates the appointment node on the directory server, the method further comprises: the domain name server accesses the directory server and subscribes to an appointment node, wherein the appointment node is used for receiving notification information of the state change of the service server.
Further, after the domain name server returns the address information of the service server satisfying the predetermined condition to the client terminal, the method further includes: under the condition that a service server meeting a preset condition fails, a directory server senses the failure of the service server; the directory server deletes the state information of the service server under the appointed node according to the fault information; and the directory server informs the domain name server, and the domain name server pulls the latest state information of the currently available service server of the directory server.
Further, before the domain name server sends out the query instruction to the directory server, the method further comprises: starting a domain name server; the domain name server subscribes an appointed node corresponding to the domain name from the directory server.
According to another aspect of the embodiments of the present invention, there is provided an apparatus for acquiring information of a service server in real time, including: the domain name server sends a query instruction to the directory server, wherein at least one service server is registered in the directory server; the receiving module is used for receiving the address and the state information of the service server returned by the directory server by the domain name server; the filtering module is used for filtering the state information of the service server meeting the preset conditions by the domain name server according to the preset conditions; and the return module is used for returning the filtered address information of the service server to the client terminal by the domain name server.
Further, the receiving module includes: the state information of the service server includes: the processor utilization rate, the available memory space, the available disk space and the communication state of the network interface of the service server.
Further, a filtration module comprising: the first judging module is used for judging whether the utilization rate of the processor is greater than or equal to a preset efficiency value or not; the second judgment module is used for judging whether the available space of the memory is larger than or equal to a first preset space value or not; the third judgment module is used for judging whether the available space of the disk is larger than or equal to a second preset space value or not; and the fourth judging module is used for judging whether the communication state of the network interface is an idle state.
Further, the issuing module further comprises: the first starting module is used for starting at least one service server; the creating module is used for creating an appointed node on the directory server by the service server; the appointed node is a service storage space created by the service server under the directory server, and the appointed node corresponds to the domain name information of the service server one by one; and the storage module is used for storing the self address and the state information to the appointed node by the service server.
Further, the creating module further comprises: and the access module is used for accessing the directory server by the domain name server and subscribing the appointed node, wherein the appointed node is used for receiving the notification information of the state change of the service server.
Further, the return module further comprises: the sensing module is used for sensing the fault of the service server and deleting the state information of the service server under the appointed node by the directory server under the condition that the service server meeting the preset condition has the fault; and the pull module is used for the directory server to inform the domain name server, and the domain name server pulls the latest information of the current available service server registered by the directory server.
Further, the issuing module further comprises: the second starting module is used for starting the domain name server; and the subscription module is used for subscribing the appointed node corresponding to the domain name from the directory server by the domain name server.
In the embodiment of the invention, a mode that a domain name server sends a query instruction to a directory server is adopted, the domain name server receives the address and state information of a service server returned by the directory server, the domain name server filters the state information of the service server meeting the preset conditions according to the preset conditions, and the domain name server returns the filtered address information of the service server to a client terminal, so that the purposes that the domain name server can sense the state of the service server in real time and update records and provide reliable and customized load balancing DNS resolution service are achieved, the technical effect of improving the concurrent access quantity of a service server cluster is realized, and the technical problem that the performance of the service server is continuously reduced due to continuous large number of requests is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a flowchart of a method for obtaining service server information according to an embodiment of the present invention;
fig. 2 is a flowchart of an alternative method for domain name resolution in a normal scenario according to an embodiment of the present invention;
FIG. 3 is a flow diagram of an alternative method of handling traffic server overload, according to an embodiment of the invention;
fig. 4 is a flowchart of an alternative method for obtaining service server information according to an embodiment of the present invention;
fig. 5 is a flowchart of an alternative method for obtaining service server information according to an embodiment of the present invention;
FIG. 6 is a flow diagram of an alternative method of service server failure in accordance with an embodiment of the present invention;
fig. 7 is a flowchart of an alternative method for obtaining service server information according to an embodiment of the present invention;
fig. 8 is a flowchart of an alternative method for obtaining service server information according to an embodiment of the present invention; and
fig. 9 is a schematic diagram of an alternative apparatus for acquiring service server information according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, 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.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
In accordance with an embodiment of the present invention, there is provided an embodiment of a method for obtaining information of a service server in real time, it is noted that the steps illustrated in the flowchart of the drawings may be executed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described may be executed in an order different from that herein.
Fig. 1 is a method for acquiring information of a service server in real time according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S102, the domain name server sends out a query instruction to a directory server, wherein at least one service server is registered in the directory server.
Specifically, in the above steps, the domain name server may refer to a server that performs domain name and IP address translation corresponding to the domain name; the directory server is a server capable of registering a service server and a domain name server; the service server is a server capable of performing file sharing and management operation, data storage backup and service program integration; the query instruction comprises request time, request node address and number of service request servers.
In an alternative embodiment, the domain name server a issues an instruction to query the directory server B, wherein the query instruction includes: the request time is 2016, 12 months, 25 days, the number of the service request servers is 1, and the query domain name is the domain name configured by the domain name server A; meanwhile, the domain name server A subscribes to the corresponding domain name node.
Through the step S102, the directory server can realize the purpose of notifying the directory server of the state change in real time by the domain name server according to the subscription information of the domain name server.
Step S104, the domain name server receives the address and state information of the service server returned by the directory server;
specifically, in the above steps, the domain name server receives all the service server IP addresses and status information returned by the directory server; the state information includes processor utilization rate, available memory space, available disk space and communication state of network interface of the service server.
In an optional embodiment, the directory server B returns addresses and state information of all service servers under the domain name node according to the domain name in the query instruction, including the service server 1, the service server 2 and the service server 3, wherein the IP address information 192.168.1.2 of the service server 1, the processor utilization rate of the service server 1 may be 10%, the available memory space may be 300MB, the available disk space may be 500MB, and the communication state of the network interface may be idle; the IP address information 192.168.1.3 of the service server 2, the processor utilization rate of the service server 2 may be 5%, the available memory space may be 200MB, the available disk space may be 200MB, and the communication state of the network interface may be idle; the IP address information 192.168.1.4 of the service server 3, the processor utilization rate of the service server 3 may be 9%, the memory available space is 250B, the disk available space may be 400MB, and the communication status of the network interface may be space.
The purpose that the domain name server receives the address and the state information of the service server returned by the directory server can be realized through the step S104.
And step S106, the domain name server filters the service server state information meeting the preset conditions according to the preset conditions.
Specifically, in the above steps, the domain name server filters whether the processor utilization rate is greater than or equal to a predetermined efficiency value according to a configuration predetermined condition; whether the available space of the memory is larger than or equal to a first preset space value or not; whether the available space of the disk is larger than or equal to a second preset space value; whether the communication state of the network interface is the service server state information of the idle state or not;
in an optional embodiment, the domain name server a filters the service server state information of the service server whose processor utilization is greater than or equal to the predetermined efficiency value of 10%, the memory available space is greater than or equal to the first predetermined space value of 200MB, the disk available space is greater than or equal to the second predetermined space value of 200MB, and the communication state of the network interface is an idle state.
The purpose of filtering the service server state information meeting the predetermined condition according to the configuration predetermined condition by the domain name server can be realized through the step S106.
Step S108, the domain name server returns the address information of the filtered service server to the client terminal.
Specifically, in the above step, the domain name server returns the filtered address information of the service server to the client terminal.
In an alternative embodiment, the domain name server a returns address information of the address information 192.168.1.3 of the service server 2 and the address information 192.168.1.4 of the service server 3 to the client terminal.
In the solutions disclosed in the above steps S102 to S108 of the present invention, in the embodiment of the present invention, a mode that a domain name server sends a query instruction to a directory server is adopted, an address and state information of a service server returned by the directory server are received by the domain name server, the domain name server filters the state information of the service server meeting a predetermined condition according to a configuration predetermined condition, and the domain name server returns the filtered address information of the service server to a client terminal, so that the domain name server can sense the state of the service server in real time and update records, and provide a reliable and customized load balancing DNS resolution service, thereby achieving a technical effect of improving a concurrent access volume of a service server cluster, and further solving a technical problem of continuous performance degradation of the service server due to a large number of continuous requests.
The domain name resolution scheme in the normal scenario is described in detail with reference to the embodiment of fig. 2, in which the information of the service server is obtained in real time, as follows:
step S202, the service server is started, and the registration information is registered to/server/www.qunar.com/own ip address path, wherein the registration information also comprises service server state information.
Specifically, the service server 1 registers to the/server/www.qunar.com/192.168.1.2 path; the service server 2 is registered under the/server/www.qunar.com/192.168.1.3 path; the service server 3 registers to the/server/www.qunar.com/192.168.1.4 path.
Step S204, the client sends an address resolution command to the domain name server, the domain name server sends a query command to the directory server after receiving the resolution request command, and the directory server returns/server/www.qunar.com/registration information of all service servers under the node to the domain name server.
Specifically, the client sends an address resolution www.qunar.com instruction to the domain name server, the domain name server sends a query instruction to the directory server after receiving the resolution request instruction, and the directory server returns/server/www.qunar.com/registration information of the service server 1, the service server 2 and the service server 3 under the node to the domain name server, wherein the registration information includes: IP address information of the service server, processor utilization rate of the service server, available space of a memory, available space of a disk and communication state of a network interface.
In step S206, the domain name server returns the registration information of the service server, and calculates the preset condition, where the calculation result is www.qunar.com corresponding to the IP address.
Specifically, the preset condition may include whether the domain name server will satisfy that the processor usage rate is greater than or equal to a predetermined efficiency value; whether the available space of the memory is larger than or equal to a first preset space value or not; whether the available space of the disk is larger than or equal to a second preset space value; whether the communication state of the network interface is an idle state.
In step S208, the domain name server returns the calculation result to the IP address 192.168.1.3 of the service server 2 and the IP address 192.168.1.4 of the service server 3 to the client.
The purpose of domain name resolution can be realized in a conventional scenario through the above steps S202 to S208.
In an optional embodiment, the state information of the service server includes: the processor utilization rate, the available memory space, the available disk space and the communication state of the network interface of the service server.
Specifically, the processor utilization rate may refer to the service server CPU utilization operation efficiency, the memory available space may refer to the service server memory free space, and the disk available space may refer to the service server disk free space.
In an alternative embodiment, the filtering, by the domain name server, the service server state information meeting the predetermined condition according to the configured predetermined condition includes: whether processor usage is greater than or equal to a predetermined efficiency value; whether the available space of the memory is larger than or equal to a first preset space value or not; whether the available space of the disk is larger than or equal to a second preset space value; whether the communication state of the network interface is an idle state or not, wherein the preset efficiency value is the average value of the utilization rates of the processors in all the service servers; the first preset space value is an average value of free space in the internal memory of the service server; the second predetermined space value is an average value of the free space of the disk in the service server.
Specifically, in the first scenario, the predetermined condition is whether the processor utilization is greater than or equal to a predetermined efficiency value; in a second scenario, the predetermined condition is whether the available memory space is greater than or equal to a first predetermined space value; in a third scenario, the predetermined condition is whether the available space of the disk is greater than or equal to a second predetermined space value; in a fourth scenario, the predetermined condition is whether the communication state of the network interface is an idle state.
It should be noted here that, in the first scenario, the predetermined condition is whether the processor utilization rate is greater than or equal to a predetermined efficiency value of 3%; in a second scenario, the predetermined condition is whether the available space of the memory is greater than or equal to a first predetermined space value of 200 MB; in a third scenario, the predetermined condition is whether the available space of the disk is greater than or equal to a second predetermined space value of 200 MB; in a fourth scenario, the predetermined condition is whether the communication state of the network interface is an idle state.
The steps of the embodiment can realize the purpose that the domain name server filters the service server state information meeting the preset conditions according to the preset conditions.
The embodiment of obtaining the service server information in real time shown in fig. 3 is used to describe the service server overload scheme in detail as follows:
step S302, the user A sends an analysis www.qunar.com instruction to the domain name server, and the domain name server returns the IP address 192.168.1.2 of the service server 1 to the client;
step S304, the request amount of the service server 1 is too large, and the load of a CPU is increased; the directory server updates the information of the service 1 and informs the domain name server to pull the latest information of the current available service server from the directory server;
step S306, the domain name server updates the mapping relation of the local domain name according to the predefined logic, and when the user B sends the resolving www.qunar.com instruction to the domain name server again, the domain name server returns the IP address 192.168.1.3 of the service server 2 meeting the predetermined condition to the user B.
The purpose of returning the service server in the available state to the user when the load of the service server is too high can be realized through the steps S302 to S306.
In an alternative embodiment, the predetermined efficiency value is an average of the processor usage in all traffic servers; the first preset space value is an average value of available space in a memory in the service server; the second predetermined space value is an average value of the space available in the disk in the service server.
The steps of the embodiment can realize the purpose that the domain name server filters the service server state information meeting the preset conditions according to the preset conditions.
In an alternative embodiment, as shown in fig. 4, before the domain name server issues the query to the directory server, the method further includes:
step S402, starting at least one service server;
step S404, at least one service server creates an appointed node on a directory server; the appointed node is a service storage space created by the service server under the directory server; the appointed nodes correspond to the domain name information of the service server one by one;
step S406, the service server saves its own address and status information to the appointed node.
Specifically, the specific format of the created path of the service server in the directory server is as follows: the method comprises the steps that a domain name a configured by a domain name server, an IP address of the service server and state information of the service server are stored, a stored appointed node refers to the domain name a configured by the domain name server, all service servers serving the same domain name a store the mapping relation between the address of the service server and the state information in a service storage space under the domain name a node, wherein the mapping relation refers to the relation between the domain name configured by the domain name server and the domain name a stored by a directory server.
It should be noted here that the domain name server is responsible for resolving is/server/www.qunar.com/, and the node that the service server creates on the directory server is also/domain name a/server/www.qunar.com/; for a service server serving the same domain name, it needs to register under a domain name node corresponding to a directory server, such as: the service server 1 is registered under the node path of/server/www.qunar.com/192.168.1.2, and the service server state is available; the service server 2 is registered under the node path of the/server/www.qunar.com/192.168.1.3, and the service server state is available; the service server 3 registers under the/server/www.qunar.com/192.168.1.4 node path.
The method can realize the purposes that the business server creates the appointed node on the directory server and stores the self address and the state information to the appointed node.
In an alternative embodiment, after the service server creates the appointment node on the directory server, the method further comprises: the domain name server accesses the directory server and subscribes to an appointment node, wherein the appointment node is used for receiving notification information of the state change of the service server.
It should be noted here that the domain name server a accesses the directory server B through the query command, and subscribes to the appointment node/server/www.qunar.com/; the nodes of the service server 1, the service server 2 and the service server 3 under the appointed node acquired by the domain name server are/server/www.qunar.com/192.168.1.2,/server/www.qunar.com/192.168.1.3 and/server/www.qunar.com/192.168.1.4 respectively.
The purposes that the domain name server accesses the directory server and subscribes the appointed node can be achieved through the steps.
In an alternative embodiment, as shown in fig. 5, after the domain name server returns the address information of the service server satisfying the predetermined condition to the client terminal, the method further includes:
step S502, under the condition that the service server meeting the preset conditions fails, the directory server senses the failure of the service server and deletes the state information of the service server under the appointed node;
step S504, the directory server notifies the domain name server, and the domain name server pulls the latest state information of the currently available service server of the directory server.
Specifically, if the service server fails, the state information of the service server under the node is deleted, so that the directory server acquires the fault state of the service server in real time and analyzes the state information of other available service servers meeting preset conditions; after the directory server notifies the domain name server, the domain name server repeatedly receives the latest status information of the currently available service servers of the directory server.
It should be noted here that, if the service server 1 fails, the directory server deletes the node of the service server 1 as/server/www.qunar.com/192.168.1.2 in the service storage space after receiving the failure notification message, so that the directory server obtains the failure state of the service server 1 in real time and analyzes the other states as available states and state information of the service server meeting the preset condition.
Through the steps of the embodiment, the aim that the directory server deletes the state information of the service server under the appointed node according to the fault information under the condition that the service server has a fault can be achieved.
The embodiment of acquiring the service server information in real time shown in fig. 6 is described in detail as follows:
step S602, when the business server 1 fails, the directory server detects that the connection signal with the business server 1 is interrupted, and deletes the registration information of the directory server 1 under the www.qunar.com node in the directory server;
step S604, the directory server informs the domain name server to pull the latest information of the current available service server registered by the directory server from the directory server according to the subscription information of www.qunar.com;
step S606, the domain name server pulls the latest information under www.qunar.com, updates the mapping relation between the local domain name and the address of the service server, and acquires the registration information of the service server meeting the preset conditions from the current available service server;
step S608, the client sends the resolved www.qunar.com address, and returns the ip address 192.168.1.3 of the service server 2 that meets the predetermined condition to the client.
Through the steps S602 to S608, when the service server fails, the domain name server sends the service server meeting the condition to the client through the directory server.
In an alternative embodiment, as shown in fig. 7, before the domain name server issues the query to the directory server, the method further includes:
step S702, starting a domain name server;
in step S704, the domain name server subscribes to an appointment node corresponding to the domain name from the directory server.
Specifically, the domain name server subscribes to an appointment node from the directory server, and the appointment node is used for receiving notification information of state change of the service server.
The method and the device can achieve the purpose that the domain name server subscribes the appointed node corresponding to the domain name to the directory server.
Based on the solutions provided in the above embodiments, aiming at the technical problem that the performance of the service server is continuously reduced due to a large number of continuous requests, the alternative or preferred embodiment provided in the present invention can achieve the technical effect of increasing the concurrent access volume of the service server cluster. Therefore, the following describes in detail an implementation of the present invention with reference to an embodiment of fig. 8 for acquiring information of a service server in real time:
step S802, the service server starts, and registers the node in the directory server.
Specifically, the IP address of the service server I is 192.168.1.2, the IP address of the service server II is 192.168.1.3, the node registered by the service server I on the directory server is/server/www.qunar.com/192.168.1.2, the node registered by the service server II on the directory server is/server/www.qunar.com/192.168.1.3, and the domain name server subscribes/server/www.qunar.com, so that the service servers capable of providing services are 192.168.1.2 and 192.168.1.3 in real time.
Step S804, if the service server I fails, the directory server deletes the node registered by the service server I.
Specifically, the directory server and the service server I keep communication through a heartbeat protocol, and whether the state of the service server I is available is confirmed; the service server I sends a fault notification to the directory server, and the directory server deletes the node registered by the service server I, so that the domain name server obtains the current service server state in real time and analyzes the IP addresses of other available service servers.
Step S806, the service server registers the node in the directory server and can write its own status data.
Specifically, the self state data comprises a service server state, a service server CPU idle rate, a service server memory idle space and a service server network IO speed, so that more data can be analyzed for a domain name server; for example, the domain name server analyzes the following data, and performs personalized analysis service according to the data;
is/server/www.qunar.com/192.168.1.3? The CPU load is 40& memory is 50& netio is 20, wherein the CPU idle rate of the domain name server resolution service server II is 40%, the free space of the memory is 50MB, and the network IO speed is 20 bps.
Example 2
According to the embodiment of the invention, the embodiment of the device for acquiring the information of the service server in real time is also provided. The method for acquiring the service server information in real time in embodiment 1 of the present invention may be implemented in the apparatus in embodiment 2 of the present invention.
Fig. 9 is a schematic structural diagram of an apparatus for acquiring service server information in real time according to an embodiment of the present invention, where the apparatus includes: an issue module 90, a receive module 92, a filter module 94, and a return module 96.
The sending module is used for sending a query instruction to a directory server by a domain name server, wherein at least one service server is registered in the directory server; the receiving module is used for receiving the address and the state information of the service server returned by the directory server by the domain name server; the filtering module is used for filtering the state information of the service server meeting the preset conditions by the domain name server according to the preset conditions; and the return module is used for returning the filtered address information of the service server to the client terminal by the domain name server.
In the solution disclosed in the above embodiment of the present invention, a manner that the sending module 90 sends an inquiry instruction to the directory server is adopted, the receiving module 92 receives the address and state information of the service server returned by the directory server, the filtering module 94 filters the state information of the service server satisfying the predetermined condition, and the returning module 96 returns the address information of the service server filtered by the returning module 96 to the client terminal, so that the domain name server can sense the state of the service server in real time and update records, and provide reliable and customized load balancing DNS resolution service, thereby achieving the technical effect of improving the concurrent access volume of a service server cluster, and further solving the technical problem of continuous performance degradation of the service server due to a large number of continuous requests.
Optionally, the receiving module 92 includes: the state information of the service server includes: the processor utilization rate, the available memory space, the available disk space and the communication state of the network interface of the service server.
Optionally, the filtering module 94 includes: the first judging module is used for judging whether the utilization rate of the processor is greater than or equal to a preset efficiency value or not; the second judgment module is used for judging whether the available space of the memory is larger than or equal to a first preset space value or not; the third judgment module is used for judging whether the available space of the disk is larger than or equal to a second preset space value or not; and the fourth judging module is used for judging whether the communication state of the network interface is an idle state.
Optionally, the issuing module 90 further includes: the first starting module is used for starting at least one service server; the creating module is used for creating an appointed node on the directory server by the service server; the appointed node is a service storage space created by the service server under the directory server, and the appointed node corresponds to the domain name information of the service server one by one; and the storage module is used for storing the self address and the state information to the appointed node by the service server.
Optionally, the creating module further includes: and the access module is used for accessing the directory server by the domain name server and subscribing the appointed node, wherein the appointed node is used for receiving the notification information of the state change of the service server.
Optionally, the returning module 96 further includes: the sensing module is used for sensing the fault of the service server and deleting the state information of the service server under the appointed node by the directory server under the condition that the service server meeting the preset condition has the fault; and the pull module is used for the directory server to inform the domain name server, and the domain name server pulls the latest information of the current available service server registered by the directory server.
Optionally, the issuing module 90 further includes: the second starting module is used for starting the domain name server; and the subscription module is used for subscribing the appointed node corresponding to the domain name from the directory server by the domain name server.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (12)

1. A method for acquiring service server information in real time is characterized by comprising the following steps:
the domain name server sends a query instruction to a directory server, wherein at least one service server is registered in the directory server;
the domain name server receives the address and state information of the service server returned by the directory server;
the domain name server filters the state information of the service server meeting the preset conditions according to the preset conditions;
the domain name server returns the filtered address information of the service server to the client terminal;
before the domain name server issues a query instruction to the directory server, the method further includes:
starting at least one service server;
the business server creates an appointed node on the directory server; the appointed node is a service storage space created by a service server under the directory server, and the appointed node corresponds to domain name information of the service server one by one;
and the service server stores the self address and the state information to the appointed node.
2. The method of claim 1, wherein the status information of the service server comprises: the processor utilization rate, the available memory space, the available disk space and the communication state of the network interface of the service server.
3. The method of claim 1, wherein the predetermined condition comprises:
whether processor usage is greater than or equal to a predetermined efficiency value; whether the available space of the memory is larger than or equal to a first preset space value or not; whether the available space of the disk is larger than or equal to a second preset space value; whether the communication state of the network interface is an idle state.
4. The method of claim 1, wherein after the business server creates the appointment node on the directory server, the method further comprises:
and the domain name server accesses the directory server and subscribes the appointed node, wherein the appointed node is used for receiving notification information of the state change of the service server.
5. The method according to claim 1, wherein after the domain name server returns the filtered address information of the service server to the client terminal, the method further comprises:
under the condition that the service server meeting the preset condition fails, the directory server senses the failure of the service server;
the directory server deletes the state information of the service server under the appointed node according to the fault information;
and the directory server informs a domain name server, and the domain name server pulls the latest information of the currently available service server of the directory server.
6. The method according to any one of claims 1 to 5, wherein before the domain name server issues the query instruction to the directory server, the method further comprises:
starting the domain name server;
and the domain name server subscribes an appointed node corresponding to the domain name to the directory server.
7. An apparatus for acquiring information of a service server in real time, comprising:
the domain name server comprises an issuing module, a searching module and a searching module, wherein the issuing module is used for issuing a query instruction to a directory server by the domain name server, and at least one service server is registered in the directory server;
the receiving module is used for receiving the address and the state information of the service server returned by the directory server by the domain name server;
the filtering module is used for filtering the state information of the service server meeting the preset conditions by the domain name server according to the preset conditions;
a return module, configured to return, by the domain name server, the filtered address information of the service server to a client terminal;
before the domain name server sends out the query instruction to the directory server, the method further comprises the following steps:
starting at least one service server;
the business server creates an appointed node on the directory server; the appointed node is a service storage space created by a service server under the directory server, and the appointed node corresponds to domain name information of the service server one by one;
and the service server stores the self address and the state information to the appointed node.
8. The apparatus of claim 7, wherein the status information of the service server comprises: the processor utilization rate, the available memory space, the available disk space and the communication state of the network interface of the service server.
9. The apparatus of claim 7, wherein the predetermined condition comprises:
whether processor usage is greater than or equal to a predetermined efficiency value;
whether the available space of the memory is larger than or equal to a first preset space value or not;
whether the available space of the disk is larger than or equal to a second preset space value;
whether the communication state of the network interface is an idle state.
10. The apparatus of claim 7, further comprising:
and the access module is used for the domain name server to access the directory server and subscribe the appointed node, wherein the appointed node is used for receiving notification information of the state change of the service server.
11. The apparatus according to claim 7, further comprising, after the domain name server returns the filtered address information of the service server to the client terminal:
under the condition that the service server meeting the preset conditions fails, the directory server senses the failure of the service server and deletes the state information of the service server under the appointed node;
and the directory server informs a domain name server, and the domain name server pulls the latest information of the current available service server registered by the directory server.
12. The apparatus of any one of claims 7 to 11, wherein the issuing module further comprises:
the second starting module is used for starting the domain name server;
and the subscription module is used for subscribing the appointed node corresponding to the domain name from the directory server by the domain name server.
CN201710086789.0A 2017-02-17 2017-02-17 Method and device for acquiring service server information in real time Active CN106713503B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710086789.0A CN106713503B (en) 2017-02-17 2017-02-17 Method and device for acquiring service server information in real time

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710086789.0A CN106713503B (en) 2017-02-17 2017-02-17 Method and device for acquiring service server information in real time

Publications (2)

Publication Number Publication Date
CN106713503A CN106713503A (en) 2017-05-24
CN106713503B true CN106713503B (en) 2020-05-12

Family

ID=58911846

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710086789.0A Active CN106713503B (en) 2017-02-17 2017-02-17 Method and device for acquiring service server information in real time

Country Status (1)

Country Link
CN (1) CN106713503B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190044816A1 (en) * 2017-08-04 2019-02-07 Hewlett Packard Enterprise Development Lp Filtering responses to discovery requests
CN109451090B (en) * 2018-11-13 2021-08-10 郑州云海信息技术有限公司 Domain name resolution method and device
CN112689027A (en) * 2020-12-11 2021-04-20 北京北信源软件股份有限公司 Addressing method and device for accessing dynamic address server by APP user

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7188094B2 (en) * 2002-07-08 2007-03-06 Sun Microsystems, Inc. Indexing virtual attributes in a directory server system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030078937A1 (en) * 2001-05-29 2003-04-24 David Boreham Method and system for nesting roles in a directory system
CN102045411A (en) * 2009-10-13 2011-05-04 中国移动通信集团公司 Method, server and system for domain name resolution
CN105323290B (en) * 2014-08-04 2019-02-26 中国移动通信集团公司 A kind of content scheduling method and device based on customer flow distribution characteristics
CN105721552B (en) * 2016-01-22 2019-05-17 深圳市瑞驰信息技术有限公司 A kind of method and DNS system for realizing dynamic load leveling based on DNS

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7188094B2 (en) * 2002-07-08 2007-03-06 Sun Microsystems, Inc. Indexing virtual attributes in a directory server system

Also Published As

Publication number Publication date
CN106713503A (en) 2017-05-24

Similar Documents

Publication Publication Date Title
CN106534328B (en) Node connection method and distributed computing system
CN106210147B (en) Load balancing method and device based on polling
US7779157B2 (en) Recovering a blade in scalable software blade architecture
US7873696B2 (en) Scalable software blade architecture
CN110324177B (en) Service request processing method, system and medium under micro-service architecture
US9246780B2 (en) System and method for supporting port multiplexing in a server environment
CN106713503B (en) Method and device for acquiring service server information in real time
US20070101022A1 (en) Sharing data in scalable software blade architecture
CN105827687A (en) Cluster management method and management system thereof
CN112422309B (en) System and method for distributed service discovery, storage medium and terminal
CN104426728A (en) Communications device utilizing a central discovery mechanism, and respective method
US10817203B1 (en) Client-configurable data tiering service
JP2014508350A (en) Site-aware access to distributed file systems from outside the corporate network
CN108924215A (en) A kind of service discovery processing method and processing device based on tree structure
US11461053B2 (en) Data storage system with separate interfaces for bulk data ingestion and data access
CN106897421B (en) Memory database read and write abruption system and method based on sentry's mode
CN104714923B (en) A kind of method and apparatus for realizing collaborative share
CN101686244A (en) Method and system for transmitting service information
US20150113619A1 (en) Methods for monitoring and controlling a storage environment and devices thereof
US8972535B2 (en) Automatic configuration of computers in a network
CN109981697B (en) File unloading method, system, server and storage medium
CN102594866A (en) Map service providing system and method
CN109413209B (en) Dynamic load balancing method and system based on double queues and registration center
CN103164410A (en) File storage and operation method, file storage and operation storage equipment and file storage and operation system
CN106302733A (en) A kind of distributed type assemblies merges implementation method and the device of NFS protocol

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant