WO2017020715A1 - 一种用于监控cdn节点的状态的方法和设备 - Google Patents

一种用于监控cdn节点的状态的方法和设备 Download PDF

Info

Publication number
WO2017020715A1
WO2017020715A1 PCT/CN2016/090816 CN2016090816W WO2017020715A1 WO 2017020715 A1 WO2017020715 A1 WO 2017020715A1 CN 2016090816 W CN2016090816 W CN 2016090816W WO 2017020715 A1 WO2017020715 A1 WO 2017020715A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
node
state change
state
cdn node
Prior art date
Application number
PCT/CN2016/090816
Other languages
English (en)
French (fr)
Inventor
刘金鑫
阚俊宝
吴小伟
胡立峰
Original Assignee
阿里巴巴集团控股有限公司
刘金鑫
阚俊宝
吴小伟
胡立峰
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 阿里巴巴集团控股有限公司, 刘金鑫, 阚俊宝, 吴小伟, 胡立峰 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2017020715A1 publication Critical patent/WO2017020715A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks

Definitions

  • the present application relates to the field of computers, and in particular to a technique for monitoring the status of a CDN node.
  • CDN Content Delivery Network
  • the CDN contains a large number of service nodes, which cover various operators such as China Unicom and telecommunications, and are distributed in various regions. In the CDN network, because there are many service nodes, some node failures may occur, resulting in abnormal access in local areas.
  • the traditional CDN node health check method is to start a health check service on the whole network to periodically detect the health status of each node of the CDN.
  • This single-point approach to health check is prone to misjudgment due to network congestion and network operator jitter and operator isolation issues.
  • the single-point health check method cannot obtain service abnormal information in time, and the real-time performance is poor, and the monitoring quality is not guaranteed.
  • a method for monitoring a state of a CDN node on a master device side includes:
  • each detection state change information is state detection information obtained by detecting the CDN node according to one of a plurality of slave devices corresponding to the master device, and the CDN node Corresponding node status information;
  • the node state information is updated when the integrated state change information is a change.
  • a method for monitoring a state of a CDN node on a slave side includes:
  • a master device for monitoring a status of a CDN node comprising:
  • a state change information obtaining module configured to acquire one or more detection state change information of the CDN node, where each detection state change information is a state obtained by detecting the CDN node according to one of a plurality of slave devices corresponding to the master device Detecting information, node status information corresponding to the CDN node;
  • a decision module configured to determine, according to the one or more detection state change information, comprehensive state change information of the CDN node
  • a status update module configured to update the node status information when the integrated status change information is changed.
  • a slave device for monitoring a status of a CDN node comprising:
  • a detecting module configured to acquire status detection information obtained by the device detecting the corresponding CDN node
  • a state change information determining module configured to determine detection state change information of the CDN node according to the state detection information and node state information corresponding to the CDN node;
  • a sending module configured to send the detection status change information to the corresponding primary device.
  • a system for monitoring the status of a CDN node comprising a master device and a slave device as previously described.
  • the present application obtains state detection information by performing state detection on a CDN node from a device, and further detects information according to the obtained state, and a section corresponding to the CDN node.
  • the present application can also deploy the slave device on the network or network segment where the monitored CDN node is located, thereby effectively reducing the accuracy of single-point detection caused by network delay or condition jitter caused by the cross-network domain or across carriers. Impact. Further, the present application can also monitor different protocol layers of the CDN node, thereby implementing finer-grained monitoring of the state of the CDN node. Moreover, the present application can also utilize the dependency relationship between the relevant protocol layers to implement the state of the CDN node. More accurate monitoring.
  • FIG. 1 shows a schematic structural diagram of a system device for monitoring a state of a CDN node according to an aspect of the present application
  • FIG. 2 shows a schematic structural diagram of a system for monitoring a state of a CDN node according to an aspect of the present application
  • FIG. 3 shows a schematic diagram of a decision module in a master device for monitoring the status of a CDN node in accordance with a preferred embodiment of the present application
  • FIG. 4 is a schematic diagram of a state update module in a master device for monitoring a state of a CDN node in accordance with a preferred embodiment of the present application;
  • FIG. 5 is a flow chart showing a method for monitoring a state of a CDN node according to another aspect of the present application.
  • FIG. 6 is a schematic flowchart showing step S13 according to another preferred embodiment of the present application.
  • FIG. 7 is a schematic flow chart showing step S15 according to another preferred embodiment of the present application.
  • the present application can be implemented in software and/or a combination of software and hardware, for example, using an application specific integrated circuit (ASIC), a general purpose computer, or any other similar hardware device.
  • the software program of the present application can be executed by a processor to implement the steps or functions described above.
  • the software programs (including related data structures) of the present application can be stored in a computer readable recording medium such as a RAM memory, a magnetic or optical drive or a floppy disk and the like.
  • some of the steps or functions of the present application may be implemented in hardware, for example, as a circuit that cooperates with a processor to perform various steps or functions.
  • a portion of the present application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide a method and/or technical solution in accordance with the present application.
  • the program instructions for invoking the method of the present application may be stored in a fixed or removable recording medium, and/or transmitted by a data stream in a broadcast or other signal bearing medium, and/or stored in a The working memory of the computer device in which the program instructions are run.
  • an embodiment in accordance with the present application includes a device including a memory for storing computer program instructions and a processor for executing program instructions, wherein when the computer program instructions are executed by the processor, triggering
  • the apparatus operates based on the aforementioned methods and/or technical solutions in accordance with various embodiments of the present application.
  • the present invention acquires state detection information by performing state detection on a CDN node from a device, and further determines detection state change information of the CDN node according to the obtained state detection information and node state information corresponding to the CDN node, and then transmits the information to the corresponding master device. Detecting the state change information, the master device determines the comprehensive state change information of the CDN node according to the acquired one or more detection state change information, and updates the node state information when the integrated state change information is changed; thereby effectively reducing the single point The influence of the detected misjudgment on the state of the CDN node improves the accuracy of monitoring the state of the CDN node.
  • the slave device may include a slave device with a probe function, which is mainly responsible for detecting the status of each node machine; the master device may include a master having a decision function. (Master device), mainly responsible for the results of each Slave detection and making decisions about the health of the node.
  • Master device mainly responsible for the results of each Slave detection and making decisions about the health of the node.
  • the system equipment includes: CDN nodes (such as VIP1, VIP2, ... VIPx), Slave (slave), Master (master), Slave DB and Master DB.
  • CDN nodes such as VIP1, VIP2, ... VIPx
  • Slave slave
  • Master master
  • Slave DB Master DB
  • the Master can interact with multiple Slaves at the same time, and the Slave and Slave DB are deployed on the same or different servers; the Slave detects the instantaneous status information of the CDN node and compares it with the status information recorded by the CDN node in the Slave DB to determine The detection state change information of the CDN node is then reported to the corresponding master for the detection state change information; the master comprehensively determines the comprehensive state change information of the CDN node according to the detection state change information of the CDN node respectively reported by the plurality of slaves, and according to This synchronizes the currently updated node state information to the corresponding database Slave DB of each distributed slave corresponding to the node through the corresponding Master DB.
  • DB Database
  • Collection users can add, intercept, update, delete, etc. the data in the file.
  • the system includes: at least one master device and at least one slave device.
  • the master device includes a state change information acquiring module, a decision module, and a state update module
  • the slave device includes a detecting module, a state change information determining module, and a sending module.
  • the change information determines comprehensive state change information of the CDN node; when the integrated state change information is changed, the state update module updates the node state information.
  • the master includes a state change information acquisition module, a decision module, and a state update module.
  • the master state change information acquiring module acquires one or more detection state change information of the CDN node, where each detection state change information is based on the master. Detecting, by one of the plurality of slaves, state detection information obtained by the CDN node, node state information corresponding to the CDN node, and determining, by the decision module, the synthesis of the CDN node according to the one or more detection state change information State change information; the state update module updates the node state information when the integrated state change information is a change.
  • the state change information obtaining module acquires one or more detection state change information of the CDN node, where each detection state change information is state detection information obtained by detecting the CDN node based on one of the plurality of slaves corresponding to the master.
  • the node status information corresponding to the CDN node wherein at least one slave is in the same network segment as the detected CDN node.
  • the slave is connected to a network provided by a different ISP service provider to detect the CDN node, wherein at least one of the slaves and the detected CDN node are in a network access service provided by the same ISP service provider. Network segment.
  • the node status information includes the node address VIP, the detection time interval, the timeout period for each detection, the number of retries for the current detection, the current health status of the node, the health detection port, and the type. If the HTTP layer is detected, the node status information also includes the URL information of the HTTP layer.
  • the node state information can be stored separately or in the database; it can be stored in the main database or stored in the distributed database corresponding to each node.
  • the neighboring technical staff should understand that the Internet Service Provider (ISP) refers to an Internet service provider that can provide dial-up Internet services, browse the Internet, download files, and send and receive e-mails. It is the gateway and bridge for Internet end users to enter the Internet. .
  • the virtual IP address refers to a virtual IP address.
  • the proxy server gives a range of virtual IP addresses according to the number of internal clients of the internet, and assigns each client a virtual IP address according to a certain rule. Implement indirect connection between the client and the internet.
  • the HTTP Hyper Text Transfer Protocol
  • the URL Uniform Resource Locator
  • URL Uniform Resource Locator
  • the decision module determines the integrated state change information of the CDN node according to the one or more detection state change information.
  • the Master makes a decision according to the received one or more detection state change information, and determines whether to perform node state information according to the set decision principle. Modifying, if yes, determining the modified node state information as comprehensive state change information; if not, maintaining the current node state information unchanged, and determining that the information is integrated state change information.
  • the state update module updates the node state information.
  • the master makes a decision to determine that the current node state information needs to be modified
  • the node state information is modified, and the integrated state change information is changed, and then the modification information is written into the database to update the node state information.
  • FIG. 3 shows a schematic diagram of a decision module in a Master for monitoring the status of a CDN node, wherein the decision module includes a quantity determining unit and a determining unit, in accordance with a preferred embodiment of the present application.
  • the quantity determining unit determines the state change notification quantity information of the CDN node according to the one or more detection state change information; the determining unit determines whether the state change notification quantity information exceeds a predetermined state change quantity threshold information, according to The judgment result determines that the comprehensive state change information of the CDN node is a change.
  • the number determining unit determines the state change notification quantity information of the CDN node based on the one or more detection state change information. For example, suppose there are 100 slaves that detect a certain node A, and after detecting 70 determined detection state change information, the number of state change notifications received by the master is 70.
  • the determining unit determines whether the state change notification quantity information exceeds a predetermined state change quantity threshold information, and determines that the integrated state change information of the CDN node is changed according to the determination result. For example, suppose the state of node A is available. After the end of a probe period, 60% of the slaves detect that the state of A is unavailable. They send the status change notification quantity information to the master. At this time, the judgment in the master The unit determines whether the number of slaves of the received state change information exceeds a predetermined state change threshold of 50%. If yes, the master makes a decision, modifies the state information of the node to be unavailable, and determines that the comprehensive state change information of the node A is changed. If not, the state of node A is still available.
  • the master further includes a quantity threshold information setting module (not shown), and the quantity threshold information setting module determines the state change quantity threshold information according to the total number information of the available slaves corresponding to the master.
  • the total number of available slaves corresponding to the Master is 100, that is, there are 100 probes for detecting a node
  • the threshold information of the state change amount is set to 50% of the total number of probe devices, that is, the state received by the master. If the number of slaves of the change information exceeds 50, the state of the node is considered to have changed.
  • the quantity determining unit determines one or more available detection state change information from the one or more detection state change information according to the predetermined time threshold information, wherein the duration of each available detection state change information The time threshold information is lower than or equal to; the state change notification quantity information of the CDN node is determined according to the one or more available detection state change information.
  • the detection of each node may be asynchronous. It takes time from the slave to the master and then to the master to make a decision. Therefore, when the duration is lower than or equal to the time threshold information, the master can guarantee the detection when making the decision.
  • the real-time nature of the state change information For example, the predetermined duration threshold is 30 s.
  • the detection state change information if one or more of the detection state change information has a duration less than or equal to 30 s, the detection state change information is marked as Available. Next, the corresponding CDN node state change notification quantity information is determined according to the number of available detection state change information of the mark.
  • the quantity determining unit determines the state change notification quantity information of the CDN node according to the protocol layer according to the one or more detection state change information.
  • the statistics according to the protocol layer means that the protocol layers are independent of each other. When the statistics are in layers, the statistics are not affected by each other, and the statistical results are calculated according to the respective protocol layers.
  • the Slave detects the HTTP layer and the TCP layer, and collects statistics on the status change notification by the protocol layer. If the HTTP layer status does not affect the TCP layer statistics, the HTTP layer statistics change notification quantity information and the layer detection CDN. The total number of nodes in the slave is compared, and the TCP layer statistics change the notification quantity information. The total number of slaves of the CDN node is compared.
  • TCP Transmission Control Protocol
  • Transmission Control Protocol refers to a transmission control protocol, which is a connection-oriented, reliable, byte stream-based transport layer communication protocol.
  • the judging unit judges whether the state change notification quantity information of the CDN node in a protocol layer exceeds a predetermined state change quantity threshold information, and determines, according to the determination result, that the integrated state change information of the CDN node in the protocol layer is changed. For example, when a certain CDN node A is detecting in the HTTP layer, the predetermined threshold number of state changes is 50% of the total number of probes detected by the protocol layer, and the determining module determines that the node A received by the master in the predetermined time is in the HTTP layer. Whether the status change notification quantity information exceeds 50% of this setting, and if so, changes the status of the CDN node, sets available as unavailable, or makes unavailable available. The state of the modified CDN node is determined to be a change in the integrated state change information.
  • the quantity determining unit determines, according to the one or more detection state change information, the number of pieces of information about the state change of the CDN node according to the protocol layer, in conjunction with the dependency relationship between the protocol layers.
  • the dependency relationship between the protocol layers refers to the dependency between the upper and lower layers of the protocol layer.
  • the upper layer of the transport layer is the application layer
  • the TCP layer provides services for the HTTP layer
  • the statistics of the HTTP layer includes the statistical results of the TCP layer. If the TCP layer occurs, the HTTP layer also appears.
  • the statistical result of the TCP layer is not affected by the occurrence of the layer, that is, the upper layer statistical result contains the corresponding lower layer statistical result, and the lower layer statistical result is not affected by the upper layer result.
  • the method for determining the quantity change notification quantity information of the CDN node according to the protocol layer is only an example, and other existing or future possible combination protocol layers.
  • the method for determining the status change notification quantity information of the CDN node according to the protocol layer is applicable to the present invention and is also included in the scope of the present invention and is hereby incorporated by reference.
  • FIG. 4 shows a schematic diagram of a master status update module for monitoring the status of a CDN node, wherein the status update module includes a status information determination unit and a node status information write unit, in accordance with another preferred embodiment of the present application.
  • the state information determining unit determines current node state information of the CDN node; the node state information writing unit updates the CDN node in the corresponding database according to the current node state information. Node status information in .
  • the state information determining unit determines current node state information of the CDN node. For example, suppose the state of a CDN node A is available. After a probe period ends, the slave sends the available detection state change information of the node A to the master, and makes a decision based on a predetermined principle, and the state information of the node is modified. For example, the comprehensive state change information of the node A is changed, and the current node state information of the node A is determined to be unavailable.
  • the node state information writing unit updates the node state information of the CDN node in the corresponding database according to the current node state information. For example, if the current node state information of the node A is unavailable, the current node state information is written into the local database of the master corresponding to the node A, and the state information of the node A in the database is updated to the current node state information is unavailable. Then, the updated node state information in the database is synchronized to the corresponding Slave database, and the state information of the node A in the slave database is updated.
  • the node state information writing unit updates the node state information of the CDN node in the corresponding database of the master according to the current node state information; and then, the currently updated node state information is obtained by means of database synchronization. Synchronizing to the corresponding database of each distributed slave corresponding to the node.
  • the current node state information is written into the Master database, the node state information in the Master database is updated, and the node state information in the Slave database is updated in a synchronous manner. Synchronizing the comprehensive state information of the determined CDN node to each of the nodes In the distributed slave database; when the comprehensive state information of the CDN node in the monitored Slave database changes, the node address data in the Slave database is reloaded and updated. For example, when the status information of a node A in the master changes, the state information of the node change is first written into the database corresponding to the master; then, the MySQL master-slave synchronization mode based on the binlog mechanism can be used in the master in time.
  • the status information of the VIP is synchronized with the slave, and the status information is synchronized to the database corresponding to the slave.
  • the Slave listens for the update information from the Master in real time, and then starts another task to update the state information of the node A in the local data according to the update information just received. Both the Master and the Slave end write data to the corresponding local database. If the network connection is disconnected or the process is killed, the information contained in the data will be executed after the connection is re-established or the process is restarted.
  • the data in the Master database is available. When changes occur, they are immediately synchronized to Slave's local database to update the state of the data information in the database.
  • the Inotify mechanism tells Slave's application process when to reload node state information.
  • the node state information is stored in the database. After the state information of a node in the database to which the slave belongs changes, the slave process is used to notify the slave process to reload the node state information.
  • the state information data of the node is stored in the database, and the tables in the database are in one-to-one correspondence with a certain file. When the state information data of the node in the database changes, the file will change accordingly.
  • the slave process initiates an update operation of the file corresponding to the state information data of the listening node to the operating system, that is, when the state information of the node changes, the operating system notifies the slave process, and the slave process reloads the state information of the node at this time.
  • the local database based on the binlog-based master-slave synchronization and Innotify mechanism to ensure the consistency of the state of the nodes distributed between the slaves and the masters in each region. After the state of a VIP in the master changes, it is synchronized to the slave database in the longest 3s.
  • the binlog refers to a binary log that records all updates and submits data or has potentially updated all statements submitted by the data and is stored in disk in binary form.
  • the Inotify is a kernel feature of a network operating system, and is an update operation of an application process to the operating system to monitor a file. Once the file is updated, the operation is performed. The system notifies the application process, and the application process performs the corresponding operation at this time.
  • the slave includes a detection module, a state change information determination module, and a transmission module.
  • the detecting module acquires the state detection information obtained by detecting the corresponding CDN node in the slave; the state change information determining module determines the detection state change of the CDN node according to the state detection information and the node state information corresponding to the CDN node.
  • the sending module sends the detection state change information to the corresponding master.
  • the detection module in the slave is configured to detect status detection information obtained by the corresponding CDN node.
  • Slave reads status information for each CDN node from a local database and periodically performs health checks. Among them, Slave does not directly modify the local database, only reads the required data from the local database.
  • Each data element includes: the address of the CDN node to be detected, which can identify different CDN nodes according to the VIP; the detection time interval, The time period for performing health check on the node address; if the timeout period of each test exceeds the time, the VIP is not available. The number of retries for this round of detection is for each VIP.
  • the health detection port can identify the The port on which the CDN node provides the service, for example, the HTTP service probe port is 80, the HTTPS service probe port is 443, and the health detection type is in the form of a protocol layer that provides a service, for example, the HTTP service probe port is 80, and the HTTPS service probe port is 443;
  • the type of health detection identifies the form of the protocol layer that provides the service, for example, health detection at the TCP layer or health detection at the HTTP layer.
  • the state change information determining module determines the detection state change information of the CDN node according to the state detection information and the node state information corresponding to the CDN node.
  • the state detection information refers to node state detection information obtained when the slave detects the CDN node, for example, when the slave reads the CDN node state information from the local database, and the state information obtained by the probe corresponds to the CDN node.
  • the node status information is compared. If they are inconsistent, the status information obtained by the detection is determined as the detection status change information. If they match, the next detection is performed.
  • the sending module sends the detection state change information to the corresponding master.
  • the Slave sends the determined detection state change information to the corresponding Master. Slave will detect the result
  • the private information protocol format is used when sending to the master.
  • the private information protocol format refers to the manner in which the data transmission mode between the slave and the master is consistent in the manner of sending the probe result data, for example, socket communication or HTTP protocol to carry the probe result data.
  • the message format is: sec usec vs_addr avail. Where sec refers to the local clock-second when the message is generated, usec refers to the local clock when the message is generated - microseconds, vs_addr refers to the VIP of the CDN node to notify the master, and avail refers to the state after the detection.
  • a socket is usually a common technical means for transmitting and acquiring information between computers, and means that two programs on the network realize one end of a connection in data exchange through a two-way communication connection.
  • the detection state change information corresponds to change information of a node state of the CDN node at a protocol layer. For example, assuming that the state of the CDN node A is available and the change information of the node state of the probe layer HTTP layer of the protocol layer is unavailable, the detection state change information of the slave detection result is determined to be unavailable.
  • FIG. 5 shows a flow chart of a method for monitoring a state of a CDN node in accordance with an aspect of the present application.
  • the method includes steps S11 to S15 and steps S22 to S26.
  • step S11 one or more detection state change information of the CDN node is acquired; in step S13, comprehensive state change information of the CDN node is determined according to the one or more detection state change information; in step S15 And updating the node state information when the integrated state change information is changed; acquiring state detection information obtained by the slave device detecting the corresponding CDN node in step S22; and detecting information according to the state in step S24, And determining, by the node state information corresponding to the CDN node, the detection state change information of the CDN node; and in step S26, transmitting the detection state change information to the corresponding master device.
  • the slave device may include a slave device with a probe function, which is mainly responsible for detecting the status of each node machine; the master device may include a master having a decision function. (master device), mainly responsible for each slave detection The results and make decisions about the health of the node.
  • master device mainly responsible for each slave detection The results and make decisions about the health of the node.
  • the detection state change information refers to information that the slave node reports to the master whether the state of the node of the corresponding CDN node changes, for example, the node state changes or remains unchanged, and the detection state change information may include detecting the state change information.
  • the comprehensive state change information refers to information that the master integrates the detection state change information reported by the plurality of slaves, and determines whether the node state of the CDN node changes, such as a node state change or unchanged, and the integrated state change information may include Comprehensive status change information.
  • the detection state change information we will use the detection state change information, the detection state change information, the integrated state change information, and the integrated state change information, respectively.
  • the method for monitoring the state of the CDN node at the Master end includes step S11, step S13, and step S15.
  • step S11 the master acquires one or more detection state change information of the CDN node, where each detection state change information is based on detecting one of the plurality of slaves corresponding to the master to detect the state of the CDN node.
  • Information the node state information corresponding to the CDN node; in step S13, the master determines the integrated state change information of the CDN node according to the one or more detection state change information; in step S15, the master When the integrated state change information is changed, the node state information is updated.
  • the master acquires one or more detection state change information of the CDN node, where each detection state change information is based on detecting one of the plurality of slaves corresponding to the master to detect the state of the CDN node.
  • the at least one slave is in the same network segment as the detected CDN node.
  • the slave is connected to a network provided by a different ISP service provider to detect the CDN node, wherein at least one of the slaves and the detected CDN node are in a network access service provided by the same ISP service provider. Network segment.
  • the node status information includes the node address VIP, the detection time interval, the timeout period for each detection, the number of retries for the current detection, the current health status of the node, the health detection port, and the type. If the HTTP layer is detected, the node status information also includes the URL information of the HTTP layer.
  • the node state information can be stored separately or in the database; it can be stored in the main database or stored in each node. Cloth database.
  • the neighboring technical staff should understand that the Internet Service Provider (ISP) refers to an Internet service provider that can provide dial-up Internet services, browse the Internet, download files, and send and receive e-mails. It is the gateway and bridge for Internet end users to enter the Internet. .
  • the virtual IP address refers to a virtual IP address.
  • the proxy server gives a range of virtual IP addresses according to the number of internal clients of the internet, and assigns each client a virtual IP address according to a certain rule. Implement indirect connection between the client and the internet.
  • the HTTP Hyper Text Transfer Protocol
  • the URL Uniform Resource Locator
  • URL Uniform Resource Locator
  • step S13 the master determines the integrated state change information of the CDN node according to the one or more detection state change information.
  • the Master makes a decision according to the received one or more detection state change information, determines whether to modify the node state information according to the set decision principle, and if so, determines the modified node state information as the integrated state change information. If not, the current node state information is kept unchanged, and the information is determined to be comprehensive state change information.
  • step S15 when the integrated state change information is changed, the node state information is updated.
  • the master makes a decision to determine that the current node state information needs to be modified
  • the node state information is modified, and the integrated state change information is changed, and then the modification information is written into the database to update the node state information.
  • FIG. 6 shows a flow chart of step S13 in accordance with another preferred embodiment of the present application.
  • step S13 includes step S131 and step S132.
  • step S131 the master determines the state change notification quantity information of the CDN node according to the one or more detection state change information; in step S132, when the state change notification quantity information exceeds a predetermined one in the master
  • the state change quantity threshold information determines that the comprehensive state change information of the CDN node is a change.
  • step S131 the state change notification quantity information of the CDN node is determined according to the one or more detection state change information. For example, there are 100 slaves to a node A. After the detection, there are 70 determined detection state change information after the detection, and the number of state change notifications of the node A received by the master is 70.
  • step S132 it is determined whether the state change notification quantity information exceeds a predetermined state change quantity threshold information, and it is determined that the integrated state change information of the CDN node is a change. For example, suppose the state of node A is available. After the end of a probe period, 60% of the slaves detect that the state of A is unavailable. They send the status change notification quantity information to the master. At this time, the master judges that it has received Whether the number of slaves of the state change information exceeds a predetermined state change threshold of 50%, and if so, the master makes a decision, modifies the state information of the node to be unavailable, and determines that the comprehensive state change information of the node A is changed, and if not, The state of node A is still available.
  • the master further includes step S17 (not shown), and in step S17, the master determines the state change quantity threshold information according to the total number of available slaves corresponding to the master.
  • the total number of available slaves corresponding to the Master is 100, that is, there are 100 probes for detecting a node, and the threshold information of the state change amount is set to 50% of the total number of probe devices, that is, the state received by the master. If the number of slaves of the change information exceeds 50, the state of the node is considered to have changed.
  • one or more available detection state change information are determined from the one or more detection state change information according to predetermined time threshold information, wherein each available detection state change information The duration is lower than or equal to the time threshold information; and then, the state change notification quantity information of the CDN node is determined according to the one or more available detection state change information.
  • the detection of each node may be asynchronous. It takes time from the slave to the master and then to the master to make a decision. Therefore, when the duration is lower than or equal to the time threshold information, the master can guarantee the detection when making the decision.
  • the real-time nature of the state change information For example, the predetermined duration threshold is 30 s.
  • the detection state change information if one or more of the detection state change information has a duration less than or equal to 30 s, the detection state change information is marked as Available. Next, the corresponding CDN node state change notification quantity information is determined according to the number of available detection state change information of the mark.
  • the status change notification quantity information of the CDN node according to the protocol layer is determined according to the one or more detection state change information.
  • the statistics according to the protocol layer means that the protocol layers are independent of each other. When the statistics are in layers, the statistics are not affected by each other, and the statistical results are calculated according to the respective protocol layers.
  • the Slave detects the HTTP layer and the TCP layer, and collects statistics on the status change notification by the protocol layer. If the HTTP layer status does not affect the TCP layer statistics, the HTTP layer statistics change notification quantity information and the layer detection CDN. The total number of nodes' slaves is compared, and the TCP layer statistics change notification quantity information is compared with the total number of slaves of the layer detecting CDN nodes.
  • TCP Transmission Control Protocol
  • Transmission Control Protocol refers to a transmission control protocol, which is a connection-oriented, reliable, byte stream-based transport layer communication protocol.
  • step S132 it is determined whether the state change notification quantity information of the CDN node exceeds a predetermined state change quantity threshold information at a protocol layer, and determines that the integrated state change information of the CDN node at the protocol layer is changed. For example, when a certain CDN node A is detecting in the HTTP layer, the predetermined threshold number of state changes is 50% of the total number of probes detected by the protocol layer, and the state of the node A received by the master in the predetermined time is in the HTTP layer. When the change notification quantity information exceeds 50% of this setting, the status of the CDN node is changed, the available is set to be unavailable, or the unavailable is made available. The state of the modified CDN node is determined to be a change in the integrated state change information.
  • the CDN node is notified of the state change notification quantity information according to the protocol layer.
  • the dependency relationship between the protocol layers refers to the dependency between the upper and lower layers of the protocol layer.
  • the upper layer of the transport layer is the application layer
  • the TCP layer provides services for the HTTP layer
  • the statistics of the HTTP layer includes the statistical results of the TCP layer. If the TCP layer occurs, the HTTP layer also appears.
  • the statistical result of the TCP layer is not affected by the occurrence of the layer, that is, the upper layer statistical result contains the corresponding lower layer statistical result, and the lower layer statistical result is not affected by the upper layer result.
  • FIG. 7 shows a flow chart of step S15 in accordance with another preferred embodiment of the present application.
  • step S15 includes step S151 and step S152.
  • step S151 when the integrated state change information is changed, determining current node state information of the CDN node; in step S152, updating the CDN node in a corresponding database according to the current node state information. Node status information in .
  • step S151 when the integrated state change information is changed, current node state information of the CDN node is determined. For example, suppose the state of a CDN node A is available. After a probe period ends, the slave sends the available detection state change information of the node A to the master, and makes a decision based on a predetermined principle, and the state information of the node is modified. For example, the comprehensive state change information of the node A is changed, and the current node state information of the node A is determined to be unavailable.
  • the node state information of the CDN node in the corresponding database is updated according to the current node state information. For example, if the current node state information of the node A is unavailable, the current node state information is written into the local database of the master corresponding to the node A, and the state information of the node A in the database is updated to the current node state information. Then, the updated node state information in the database is synchronized to the corresponding Slave database, and the state information of the node A in the slave database is updated.
  • step S152 the node state information of the CDN node in the corresponding database of the master is updated according to the current node state information; and then, the currently updated node state information is synchronized by means of database synchronization. Up to the corresponding database of each distributed slave corresponding to the node.
  • the current node state information is written into the Master database, the node state information in the Master database is updated, and the node state information in the Slave database is updated in a synchronous manner. Synchronizing the comprehensive state information of the determined CDN node into each distributed Slave database corresponding to the node; when the comprehensive state information of the CDN node in the monitored Slave database changes, then in the Slave database The node address data is reloaded and updated. For example, when the status information of a node A in the master changes, the state information of the node change is first written into the database corresponding to the master; then, the MySQL master-slave synchronization mode based on the binlog mechanism can be used in the master in time.
  • the status information of the VIP is synchronized with the slave, and the status information is synchronized to the database corresponding to the slave.
  • the Slave listens for the update information from the Master in real time, and then starts another task to update the state information of the node A in the local data according to the update information just received. Both the Master and the Slave end write data to the corresponding local database. If the network connection is disconnected or the process is killed, the information contained in the data will be executed after the connection is re-established or the process is restarted.
  • the data in the Master database is available. When changes occur, they are immediately synchronized to Slave's local database to update the state of the data information in the database.
  • the Inotify mechanism tells Slave's application process when to reload node state information.
  • the node state information is stored in the database. After the state information of a node in the database to which the slave belongs changes, the slave process is used to notify the slave process to reload the node state information.
  • the state information data of the node is stored in the database, and the tables in the database are in one-to-one correspondence with a file, and the state information data of the nodes in the database. When the change occurs, the file will change accordingly.
  • the slave process initiates an update operation of the file corresponding to the status information data of the listening node to the operating system, that is, when the status information of the node changes, the operating system notifies the slave process, Slave The process reloads the state information of the node at this time.
  • the process Using the local database based on the binlog-based master-slave synchronization and Innotify mechanism to ensure the consistency of the state of the nodes distributed between the slaves and the masters in each region. After the state of a VIP in the master changes, it is synchronized to the slave database in the longest 3s.
  • the binlog refers to a binary log that records all updates and submits data or has potentially updated all statements submitted by the data and is stored in disk in binary form.
  • the Inotify is a kernel feature of a network operating system. The application process initiates an update operation for monitoring a file to the operating system. Once the file is updated, the operating system notifies the application process, and the application process performs the corresponding operation at this time.
  • the method for monitoring the state of the CDN node at the Slave end includes step S22, step S24, and step S26.
  • step S22 the state detection information obtained by the Slave detecting the corresponding CDN node is acquired; in step S24, the slave determines the CDN node according to the state detection information and the node state information corresponding to the CDN node. The state change information is detected; in step S26, the slave transmits the detection state change information to the corresponding master.
  • the state detection information obtained by the slave detecting the corresponding CDN node is acquired.
  • Slave reads status information for each CDN node from a local database and periodically performs health checks. Among them, Slave does not directly modify the local database, only reads the required data from the local database.
  • Each data element includes: the address of the CDN node to be detected, which can identify different CDN nodes according to the VIP; the detection time interval, The time period for performing health check on the node address; if the timeout period of each test exceeds the time, the VIP is not available. The number of retries for this round of detection is for each VIP.
  • the detection port can identify the port on which the CDN node provides services, for example, the HTTP service probe port is 80, the HTTPS service probe port is 443, and the health detection type is in the form of a protocol layer that provides a service, for example, the HTTP service probe port is 80, HTTPS.
  • the service detection port is 443; the health detection type identifies the form of the protocol layer that provides the service, for example, health detection at the TCP layer or health detection at the HTTP layer.
  • the detection state change information of the CDN node is determined according to the state detection information and the node state information corresponding to the CDN node.
  • the state detection information refers to detection information obtained when the slave detects the CDN node, for example, when the slave reads the CDN node state information from the local database, and the node state corresponding to the CDN node is obtained by detecting the obtained state information. If the information is inconsistent, the state information obtained by the detection is determined as the detection state change information, and if they match, the next detection is performed.
  • step S26 the detection state change information is transmitted to the corresponding master.
  • the Slave sends the determined detection state change information to the corresponding Master.
  • the private information protocol format refers to the manner in which the data transmission mode between the slave and the master is sent in a consensus manner, for example, socket communication or HTTP protocol to carry the probe. Result data.
  • the message format is: sec usec vs_addr avail.
  • sec refers to the local clock-second when the message is generated
  • usec refers to the local clock when the message is generated - microseconds
  • vs_addr refers to the VIP of the CDN node to notify the master
  • avail refers to the state after the detection.
  • a socket is usually a common technical means for transmitting and acquiring information between computers, and means that two programs on the network realize one end of a connection in data exchange through a two-way communication connection.
  • the method further comprises the detecting state change information corresponding to change information of a node state of the CDN node at a protocol layer. For example, suppose the state of the CDN node A is available, and when the change information of the node state of the protocol layer HTTP layer of the protocol layer is unavailable, then this The detection state change information of the Slave detection result is determined to be unavailable.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请的目的是提供一种于监控CDN节点的状态的技术。通过在从设备端获取对应CDN节点的状态检测信息,进而根据所得的状态检测信息,以及CDN节点对应的节点状态信息,确定CDN节点的检测状态变化信息,主设备端根据获取从设备发送的一个或多个检测状态变化信息确定CDN节点的综合状态变化信息,当综合状态变化信息为变化时,更新所述节点状态信息。与现有技术相比,本申请有效降低了单点检测的误判对CDN节点状态的影响,提高了CDN节点状态的监控的准确性。而且,本申请还可以将从设备部署在受监控CDN节点所在的网络或网段,从而有效地降低因网络时延或状况抖动对单点检测的准确率的影响。

Description

一种用于监控CDN节点的状态的方法和设备 技术领域
本申请涉及计算机领域,尤其涉及一种用于监控CDN节点的状态的技术。
背景技术
CDN(Content Delivery Network)内容分发网络,其目的是通过现有的Internet中增加一层新的网络架构,将网站的内容发布到最接近用户的网络“边缘”,使用户可以就近取得所需内容,解决Internet网络拥挤的状况,提高用户访问网站的响应速度。从技术上全面解决由于网络带宽小、用户访问量大、网点分布不均等原因造成的用户访问网站速度慢的问题。
CDN包含大量的服务节点,这些服务节点涵盖联通、电信等各个运营商,分布在各个地区。在CDN网络中,因为有众多服务节点,可能出现部分节点故障,导致局部地区访问异常的情况。
传统的CDN节点健康检查方法是在全网启动一个健康检查服务,周期性地探测CDN各个节点的健康状况。这种单点方式的健康检查方法容易因为网络阻塞网络状况抖动出现误判且有运营商隔离问题。另外,单点式的健康检查方法无法及时获得服务异常信息,实时性较差,而且监控质量也得不到保障。
发明内容
本申请的目的是提供一种用于监控CDN节点的状态的方法和设备,以解决单点检测的误判对CDN节点状态监控的影响。
根据本申请的一个方面,提供了一种在主设备端用于监控CDN节点的状态的方法,包括:
获取CDN节点的一个或多个检测状态变化信息,其中,每个检测状态变化信息是基于主设备对应的多个从设备中之一检测所述CDN节点所得的状态检测信息、所述CDN节点所对应的节点状态信息;
根据所述一个或多个检测状态变化信息确定所述CDN节点的综合状态变化信息;
当所述综合状态变化信息为变化时,更新所述节点状态信息。
根据本申请的另一个方面,提供了一种在从设备端用于监控CDN节点的状态的方法,包括:
获取从设备检测对应CDN节点所得的状态检测信息;
根据所述状态检测信息,以及所述CDN节点对应的节点状态信息,确定所述CDN节点的检测状态变化信息;
向对应主设备发送所述检测状态变化信息。
根据本申请的另一方面,还提供了一种用于监控CDN节点的状态的主设备,包括:
状态变化信息获取模块,用于获取CDN节点的一个或多个检测状态变化信息,其中,每个检测状态变化信息是基于主设备对应的多个从设备中之一检测所述CDN节点所得的状态检测信息、所述CDN节点所对应的节点状态信息;
决策模块,用于根据所述一个或多个检测状态变化信息确定所述CDN节点的综合状态变化信息;
状态更新模块,用于当所述综合状态变化信息为变化时,更新所述节点状态信息。
根据本申请的另一方面,还提供了一种用于监控CDN节点的状态的从设备,包括:
检测模块,用于获取从设备检测对应CDN节点所得的状态检测信息;
状态变化信息确定模块,用于根据所述状态检测信息,以及所述CDN节点对应的节点状态信息,确定所述CDN节点的检测状态变化信息;
发送模块,用于向对应主设备发送所述检测状态变化信息。
根据本申请的再一方面,还提供了一种用于监控CDN节点的状态的系统,该系统包括如前所述的主设备及从设备。
与现有技术相比,本申请通过从设备对CDN节点进行状态检测获取状态检测信息,进而根据所得的状态检测信息,以及CDN节点对应的节 点状态信息,确定CDN节点的检测状态变化信息,然后向对应主设备发送所述检测状态变化信息,主设备端根据获取的一个或多个检测状态变化信息确定CDN节点的综合状态变化信息,当综合状态变化信息为变化时,更新所述节点状态信息;从而有效降低了单点检测的误判对CDN节点状态的影响,提高了CDN节点状态的监控的准确性。而且,本申请还可以将从设备部署在受监控CDN节点所在的网络或网段,从而有效地降低因跨网络域或跨运营商而导致的网络时延或状况抖动对单点检测的准确率的影响。进一步地,本申请还可以监控CDN节点的不同协议层,从而实现对CDN节点状态的更细粒度的监控;而且,本申请还可以利用相关协议层之间的依赖关系,实现对CDN节点状态的更准确的监控。
附图说明
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:
图1示出根据本申请一个方面的一种用于监控CDN节点的状态的系统设备的结构示意图;
图2示出根据本申请一个方面的一种用于监控CDN节点的状态的系统的结构示意图;
图3示出根据本申请一个优选实施例的一种用于监控CDN节点的状态的主设备中决策模块的示意图;
图4示出根据本申请一个优选实施例的一种用于监控CDN节点的状态的主设备中状态更新模块的示意图;
图5示出根据本申请另一个方面的一种用于监控CDN节点的状态的方法流程示意图;
图6示出根据本申请另一个优选实施例的步骤S13流程示意图;
图7示出根据本申请另一个优选实施例的步骤S15流程示意图;
附图中相同或相似的附图标记代表相同或相似的部件。
具体实施方式
下面结合附图对本申请作进一步详细描述。
需要注意的是,本申请可在软件和/或软件与硬件的组合体中被实施,例如,可采用专用集成电路(ASIC)、通用目的计算机或任何其他类似硬件设备来实现。在一个实施例中,本申请的软件程序可以通过处理器执行以实现上文所述步骤或功能。同样地,本申请的软件程序(包括相关的数据结构)可以被存储到计算机可读记录介质中,例如,RAM存储器,磁或光驱动器或软磁盘及类似设备。另外,本申请的一些步骤或功能可采用硬件来实现,例如,作为与处理器配合从而执行各个步骤或功能的电路。
另外,本申请的一部分可被应用为计算机程序产品,例如计算机程序指令,当其被计算机执行时,通过该计算机的操作,可以调用或提供根据本申请的方法和/或技术方案。而调用本申请的方法的程序指令,可能被存储在固定的或可移动的记录介质中,和/或通过广播或其他信号承载媒体中的数据流而被传输,和/或被存储在根据所述程序指令运行的计算机设备的工作存储器中。在此,根据本申请的一个实施例包括一个装置,该装置包括用于存储计算机程序指令的存储器和用于执行程序指令的处理器,其中,当该计算机程序指令被该处理器执行时,触发该装置运行基于前述根据本申请的多个实施例的方法和/或技术方案。
本申请通过从设备对CDN节点进行状态检测获取状态检测信息,进而根据所得的状态检测信息,以及CDN节点对应的节点状态信息,确定CDN节点的检测状态变化信息,然后向对应主设备发送所述检测状态变化信息,主设备端根据获取的一个或多个检测状态变化信息确定CDN节点的综合状态变化信息,当综合状态变化信息为变化时,更新所述节点状态信息;从而有效降低了单点检测的误判对CDN节点状态的影响,提高了CDN节点状态的监控的准确性。
本领域技术人员应能理解,在具体的方案实施中,所述从设备可包括具有探测功能的Slave(从设备),主要负责探测各个节点机器状况;所述主设备可包括具有决策功能的Master(主设备),主要负责各个Slave探测的结果并作出节点健康状况的决策。为表述方便,我们将在实施例中对主设备与Master、第二网络设备与Slave分别进行互换使用。
图1示出根据本申请一个方面的一种用于监控CDN节点的状态的系统设备的结构示意图。该系统设备包括:CDN节点(如VIP1、VIP2、…VIPx)、Slave(从设备)、Master(主设备)、Slave DB和Master DB。其中,Master可同时与多个Slave交互,Slave与Slave DB部署在相同或不同服务器上;Slave检测CDN节点的即时状态信息并与该CDN节点在Slave DB中所记录的状态信息进行比较,以确定该CDN节点的检测状态变化信息,随后向对应Master报告该检测状态变化信息;Master根据多个Slave分别报告的该CDN节点的检测状态变化信息,综合确定该CDN节点的综合状态变化信息,并据此通过对应的Master DB将当前更新的节点状态信息同步至到节点所对应的各分布式Slave的对应数据库Slave DB中。
本领域技术人员应能理解所述DB(Database)指数据库,是以一定方式存储在一起、能为多个用户共享、具有尽可能小的冗余度的特点、是与应用程序彼此独立的数据集合,用户可以对文件中的数据进行新增、截取、更新、删除等操作。
图2示出根据本申请一个方面的一种用于监控CDN节点的状态的系统的结构示意图。所述系统包括:至少一个主设备和至少一个从设备。其中,主设备包括状态变化信息获取模块、决策模块和状态更新模块,从设备包括检测模块、状态变化信息确定模块和发送模块。从设备中的检测模块获取从设备检测对应CDN节点所得的状态检测信息;状态变化信息确定模块根据所述状态检测信息,以及所述CDN节点对应的节点状态信息,确定所述CDN节点的检测状态变化信息;发送模块向对应主设备发送所述检测状态变化信息;主设备中的状态变化信息获取模块获取CDN节点的一个或多个检测状态变化信息;决策模块根据所述一个或多个检测状态变化信息确定所述CDN节点的综合状态变化信息;当所述综合状态变化信息为变化时,状态更新模块更新所述节点状态信息。
所述Master包括状态变化信息获取模块、决策模块和状态更新模块。
具体地,所述Master中状态变化信息获取模块获取CDN节点的一个或多个检测状态变化信息,其中,每个检测状态变化信息是基于Master 对应的多个Slave中之一检测所述CDN节点所得的状态检测信息、所述CDN节点所对应的节点状态信息;决策模块根据所述一个或多个检测状态变化信息确定所述CDN节点的综合状态变化信息;当所述综合状态变化信息为变化时,状态更新模块更新所述节点状态信息。
优选地,状态变化信息获取模块获取CDN节点的一个或多个检测状态变化信息,其中,每个检测状态变化信息是基于Master对应的多个Slave中之一检测所述CDN节点所得的状态检测信息、所述CDN节点所对应的节点状态信息,其中,至少一个Slave与被探测的CDN节点处于同一网段。例如,将Slave接入到不同的ISP服务提供商所提供的网络中进行对CDN节点的探测,其中,至少一个Slave与被探测的CDN节点处于由同一ISP服务提供商所提供的网络接入服务的网段。节点状态信息包括节点地址VIP、检测时间间隔、每次检测的超时时间、本次检测的重试次数、节点当前的健康状况、健康检测端口和类型。若探测HTTP层时,节点状态信息还包括HTTP层的URL信息。在此,节点状态信息可独立存放,也可存放于数据库中;集中存放于主数据库,也可分别存放于各节点对应的分布式数据库。
本邻域技术人员应理解,所述ISP(Internet Service Provider)是指互联网服务提供商,能提供拨号上网服务、网上浏览、下载文件、收发电子邮件等,是网络最终用户进入因特网的入口和桥梁。所述VIP(Virtual IP Address)是指虚拟IP地址,由代理服务器根据internet内部客户机的多少,给定虚拟IP地址的一个范围,并按某种规定分配给每个客户机一个虚拟IP地址,实现客户机与internet的间接相连。所述HTTP(Hyper Text Transfer Protocol)是指超文本传输协议,用于从环球信息网服务器传输超文本到本地浏览器的传输协议。所述URL(Uniform Resource Locator)是指统一资源定位符,表示互联网上得到的资源的位置和访问方法,是互联网上标准资源的地址,互联网上的每个文件都有一个唯一的URL。
接着,决策模块根据所述一个或多个检测状态变化信息确定所述CDN节点的综合状态变化信息。在此,Master根据接收到的一个或多个检测状态变化信息进行决策,根据设定的决策原则判断是否对节点状态信息进行 修改,若是,则将修改后的节点状态信息确定为综合状态变化信息;若否,则保持当前节点状态信息不变,确定此信息为综合状态变化信息。
随后,当所述综合状态变化信息为变化时,状态更新模块更新所述节点状态信息。当Master进行决策判断当前的节点状态信息需要修改时,修改节点状态信息,此时综合状态变化信息为变化,接着将修改信息写入到数据库中进行更新节点状态信息。
图3示出根据本申请一个优选实施例的一种用于监控CDN节点的状态的Master中决策模块的示意图,其中,决策模块包括数量确定单元和判断单元。
具体地,数量确定单元根据所述一个或多个检测状态变化信息确定所述CDN节点的状态变化通知数量信息;判断单元判断所述状态变化通知数量信息是否超过预定的状态变化数量阈值信息,根据判断结果确定所述CDN节点的综合状态变化信息为变化。
数量确定单元根据所述一个或多个检测状态变化信息确定所述CDN节点的状态变化通知数量信息。例如,假设有100个Slave对某一节点A进行探测,探测后有70个确定的检测状态变化信息,则Master接收到的节点A的状态变化通知数量为70个。
接着,判断单元判断所述状态变化通知数量信息是否超过预定的状态变化数量阈值信息,根据判断结果确定所述CDN节点的综合状态变化信息为变化。例如,假设节点A的状态是可用,在一个探测周期结束后,有60%的Slave探测获取到A的状态为不可用,它们将状态变化通知数量信息发送给Master,此时,Master中的判断单元判断收到的状态变化信息的Slave个数是否超过预定的状态变化数量阈值50%,若是,Master做决策,修改该节点的状态信息为不可用,确定节点A的综合状态变化信息为变化,若否,则节点A的状态仍为可用。
本领域技术人员应能理解上述确定CDN节点的综合状态变化信息为变化的方法仅为举例,其他现有的或今后可能出现的确定CDN节点的综合状态变化信息为变化的方法如可适用于本发明,也应包含在本发明保护范围以内,并在此以引用方式包含于此。
优选地,所述Master还包括数量阈值信息设定模块(未示出),所述数量阈值信息设定模块根据所述Master对应的可用Slave的总数量信息来确定所述状态变化数量阈值信息。例如,对应于Master的可用Slave的总数量为100个,即探测某一节点的探头Slave有100个,设定状态变化数量阈值信息为总探测设备数量的50%,即当Master收到的状态变化信息的Slave个数超过50个,则认为该节点状态发生了变化。
本领域技术人员应能理解上述确定所述状态变化数量阈值信息方法仅为举例,其他现有的或今后可能出现的确定所述状态变化数量阈值信息方法如可适用于本发明,也应包含在本发明保护范围以内,并在此以引用方式包含于此。
优选地,数量确定单元根据预定的时间阈值信息,从所述一个或多个检测状态变化信息中确定一个或多个可用的检测状态变化信息,其中,每个可用的检测状态变化信息的存续时间低于或等于所述时间阈值信息;接着,根据所述一个或多个可用的检测状态变化信息确定所述CDN节点的状态变化通知数量信息。
在此,每个节点的探测可能是不同步的,从Slave发送到Master,再到Master做决策时都需要时间,故存续时间低于或等于时间阈值信息时,Master做决策时,能够保证检测状态变化信息的实时性。例如,预定的存续时间阈值为30s,在一个或多个检测状态变化信息中,若其中的一个或多个检测状态变化信息的存续时间低于或等于30s,则将此检测状态变化信息标记为可用。接着,根据标记的可用的检测状态变化信息的数量确定对应CDN节点状态变化通知数量信息。
优选地,数量确定单元根据所述一个或多个检测状态变化信息确定所述CDN节点按协议层统计的状态变化通知数量信息。其中,按协议层统计是指各协议层之间是相互独立的,统计时各层是互不影响,统计结果按各自的协议层计算。例如,Slave探测HTTP层和TCP层,统计状态变化通知数量信息时按协议层进行统计,若HTTP层出现状况并不影响TCP层的统计结果,HTTP层统计的变化通知数量信息与该层探测CDN节点的Slave的总数量进行比较,而TCP层统计的变化通知数量信息该层探测 CDN节点的Slave的总数量进行比较。
本领域技术人员应能理解,所述TCP(Transmission Control Protocol)是指传输控制协议,是一种面向连接的、可靠的、基于字节流的传输层通信协议。
接着,判断单元判断所述CDN节点在一协议层的状态变化通知数量信息是否超过预定的状态变化数量阈值信息,根据判断结果确定所述CDN节点在该协议层的综合状态变化信息为变化。例如,进行某一CDN节点A在HTTP层探测时,预定的状态变化数量阈值为探测该协议层的总探测数量的50%,判断模块判断Master在预定的时间内接收到的节点A在HTTP层的状态变化通知数量信息是否超过此设定的50%,若是,则改变该CDN节点的状态,将可用置为不可用,或将不可用置为可用。修改后的CDN节点的状态确定为综合状态变化信息为变化。
本领域技术人员应能理解上述确定所述CDN节点在该协议层的综合状态变化信息为变化的方法仅为举例,其他现有的或今后可能出现的确定所述CDN节点在该协议层的综合状态变化信息为变化的方法如可适用于本发明,也应包含在本发明保护范围以内,并在此以引用方式包含于此。
更优选地,数量确定单元根据所述一个或多个检测状态变化信息,并将结合协议层间的依赖关系,确定所述CDN节点按协议层统计的状态变化通知数量信息。其中,协议层间的依赖关系是指协议层上下层之间的依赖关系。例如,在网络通信中,传输层的上层为应用层,TCP层为HTTP层提供服务,统计HTTP层时是包括了TCP层的统计结果,若TCP层出现状况则HTTP层也出现状况,若HTTP层出现状况则TCP层的统计结果不受影响,即上层统计结果包含其相对应的下层的统计结果,而下层统计结果不受上层结果的影响。
本领域技术人员还应能理解上述结合协议层间的依赖关系,确定所述CDN节点按协议层统计的状态变化通知数量信息的方法仅为举例,其他现有的或今后可能出现的结合协议层间的依赖关系,确定所述CDN节点按协议层统计的状态变化通知数量信息的方法如可适用于本发明,也应包含在本发明保护范围以内,并在此以引用方式包含于此。
图4示出根据本申请另一个优选实施例的一种用于监控CDN节点的状态的Master中状态更新模块的示意图,其中,状态更新模块包括状态信息确定单元和节点状态信息写入单元。
具体地,当所述综合状态变化信息为变化时,状态信息确定单元确定所述CDN节点的当前节点状态信息;节点状态信息写入单元根据所述当前节点状态信息更新所述CDN节点在对应数据库中的节点状态信息。
优选地,当所述综合状态变化信息为变化时,状态信息确定单元确定所述CDN节点的当前节点状态信息。例如,假设某一CDN节点A的状态是可用,在一个探测周期结束后,Slave将节点A的可用的检测状态变化信息发送给Master,经过预定的原则做决策,修改该节点的状态信息为不可用,节点A的综合状态变化信息为变化,节点A的当前节点状态信息确定为不可用。
优选地,节点状态信息写入单元根据所述当前节点状态信息更新所述CDN节点在对应数据库中的节点状态信息。例如,假设节点A的当前节点状态信息为不可用,将此当前节点状态信息写入到节点A所对应的Master的本地数据库中,数据库中节点A的状态信息更新为当前节点状态信息不可用,再将此数据库中更新后的节点状态信息同步到对应的Slave的数据库中,完成Slave的数据库中节点A的状态信息的更新。
本领域技术人员应能理解上述更新所述CDN节点在对应数据库中的节点状态信息的方法仅为举例,其他现有的或今后可能出现的更新所述CDN节点在对应数据库中的节点状态信息的方法如可适用于本发明,也应包含在本发明保护范围以内,并在此以引用方式包含于此。
优选地,节点状态信息写入单元根据所述当前节点状态信息更新所述CDN节点在所述Master的对应数据库中的节点状态信息;接着,通过数据库同步的方式将所述当前更新的节点状态信息同步至到所述节点所对应的各分布式Slave的对应数据库中。
在此,将当前节点状态信息写入Master数据库中,更新Master数据库中节点状态信息,通过同步方式进行更新Slave数据库中节点状态信息。即将所述确定的CDN节点的综合性状态信息同步到所述节点所对应的各 分布式Slave数据库中;当监听的Slave数据库中CDN节点的综合性状态信息发生变化时,则所述Slave数据库中的节点地址数据重新加载,进行更新。例如,当Master中某个节点A的状态信息发生变化时,首先将该节点改变的状态信息写入到Master对应的数据库中;接着,使用基于binlog机制的MySQL主从同步方式,能及时在Master与Slave之间同步VIP的状态信息,将该状态信息同步到Slave对应的数据库中。同时,Slave实时监听来自Master的更新信息,之后启动另一个任务根据刚刚接收到的更新信息更新本地数据中的节点A的状态信息。Master端和Slave端都将数据写到对应的本地数据库中,网络连接断开或进程被杀死,都会在连接重建或进程重启后将该数据包含的信息执行完毕;Master数据库中一有数据信息发生变化,会立即同步到Slave的本地数据库中,更新数据库中的数据信息状态。另外,Inotify机制通知Slave的应用进程何时重新加载节点状态信息。节点状态信息存储在数据库中,Slave所属的数据库中的某个节点的状态信息发生变化后,通过使用Inotify机制通知Slave进程重新加载节点状态信息。在实施案例中,节点的状态信息数据存储在数据库中,而数据库中的表都与某个文件一一对应,当数据库中的节点的状态信息数据发生变化时,该文件也会相应地跟着改变,Slave进程向操作系统发起监听节点的状态信息数据对应的文件的更新操作,即节点的状态信息数据发生改变时,操作系统会通知Slave进程,Slave进程此时再重新加载节点的状态信息。使用本地数据库基于binlog的主从同步和Inotify机制保证分布在各地区的Slave和Master之间节点状态的一致性,Master中某一个VIP的状态变化后,最长3s内同步到Slave的数据库中。
本领域技术人员应能理解上述同步方式和监听机制的方法仅为举例,其他现有的或今后可能出现的同步方式和监听机制的方法如可适用于本发明,也应包含在本发明保护范围以内,并在此以引用方式包含于此。
本领域技术人员还应能理解所述binlog是指二进制日志,用于记录所有更新且提交了数据或者已经潜在更新提交了数据的所有语句,并以二进制的形式保存在磁盘中。所述Inotify是一个网络操作系统的内核特性,是应用进程向操作系统发起监听某文件的更新操作,一旦该文件有更新,操 作系统会通知应用进程,应用进程此时再执行相应的操作。
所述Slave包括检测模块、状态变化信息确定模块和发送模块。
具体地,检测模块获取Slave中检测对应CDN节点所得的状态检测信息;状态变化信息确定模块根据所述状态检测信息,以及所述CDN节点对应的节点状态信息,确定所述CDN节点的检测状态变化信息;发送模块向对应Master发送所述检测状态变化信息。
优选地,获取Slave中的检测模块检测对应CDN节点所得的状态检测信息。例如,Slave从本地数据库中读取各CDN节点状态信息,并周期性地做健康检测。其中,Slave不会直接修改本地数据库,只会从本地数据库中读取所需的数据,每个数据元素包括:待检测CDN节点的地址,可根据VIP进行识别不同的CDN节点;检测时间间隔,对节点地址做健康检测的时间周期;每次检测的超时时间,若某次检测超过该时间还未结果响应,则标识该VIP不可用;本轮检测的重试次数,对每个VIP都有若干次重试,若超过该次数此VIP仍然不可达,则标识本轮探测该VIP不可用;每个待检测节点的当前健康状况,标识该VIP当前的健康状况;健康检测端口,可标识该CDN节点提供服务的端口,例如HTTP服务探测端口为80,HTTPS服务探测端口为443;健康检测类型,标识提供服务的协议层的形式,例如HTTP服务探测端口为80,HTTPS服务探测端口为443;健康检测类型,标识提供服务的协议层的形式,例如,TCP层的健康检测还是HTTP层的健康检测。
接着,状态变化信息确定模块根据所述状态检测信息,以及所述CDN节点对应的节点状态信息,确定所述CDN节点的检测状态变化信息。在此,所述状态检测信息是指Slave对CDN节点进行探测时获得的节点状态检测信息,例如,当Slave从本地数据库中读取CDN节点状态信息,将探测获得的状态信息与CDN节点对应的节点状态信息进行比较,若不一致,则探测获得的状态信息确定为检测状态变化信息,若一致,则进行下一次的探测。
随后,发送模块向对应Master发送所述检测状态变化信息。在此,Slave将确定的检测状态变化信息发送给对应的Master。Slave将探测结果 发送给Master时采用私有信息协议格式,其中,私有信息协议格式是指Slave和Master之间的数据传输方式协商一致的方式发送探测结果数据,例如,socket通信或HTTP协议来承载探测结果数据。消息格式是:sec usec vs_addr avail。其中,sec指产生该消息时的本地时钟-秒,usec指产生该消息时的本地时钟-微秒,vs_addr指要通知Master的CDN节点的VIP,avail指探测后的状态。
本领域技术人员应能理解socket通常是一种常见的计算机之间发送和获取信息的技术手段,是指网络上的两个程序通过一个双向的通信连接实现数据的交换中连接的一端。
本领域技术人员还应能理解上述Master备和Slave之间的数据传输的方式仅为举例,其他现有的或今后可能出现的Master备和Slave之间的数据传输的方式如可适用于本发明,也应包含在本发明保护范围以内,并在此以引用方式包含于此。
优选地,Slave中,所述检测状态变化信息对应于所述CDN节点在协议层的节点状态的变化信息。例如,假设CDN节点A的状态为可用,探测节点A在协议层HTTP层的节点状态的变化信息为不可用时,则此Slave探测结果的检测状态变化信息确定为不可用。
图5示出根据本申请一个方面的一种用于监控CDN节点的状态的系统的方法流程示意图。该方法包括步骤S11~步骤S15和步骤S22~S26。其中,在步骤S11中,获取CDN节点的一个或多个检测状态变化信息;在步骤S13中,根据所述一个或多个检测状态变化信息确定所述CDN节点的综合状态变化信息;在步骤S15中,当所述综合状态变化信息为变化时,更新所述节点状态信息;在步骤S22中,获取从设备检测对应CDN节点所得的状态检测信息;在步骤S24中,根据所述状态检测信息,以及所述CDN节点对应的节点状态信息,确定所述CDN节点的检测状态变化信息;在步骤S26中,向对应主设备发送所述检测状态变化信息。
本领域技术人员应能理解,在具体的方案实施中,所述从设备可包括具有探测功能的Slave(从设备),主要负责探测各个节点机器状况;所述主设备可包括具有决策功能的Master(主设备),主要负责各个Slave探测 的结果并作出节点健康状况的决策。为表述方便,我们将在实施例中对主设备与Master、从设备与Slave分别进行互换使用。本邻域技术人员应理解,所述检测状态变化信息是指Slave向Master报告的对应CDN节点的节点状态是否变化的信息,例如节点状态变化或不变,检测状态变化信息可包括检测状态变化信息;所述综合状态变化信息是指Master综合多个Slave所报告的检测状态变化信息,而确定的该CDN节点的节点状态是否变化的信息,例如节点状态变化或不变,综合状态变化信息可包括综合状态变化信息。为表述方便,我们将在实施例中对检测状态变化信息与检测状态变化信息、综合状态变化信息与综合状态变化信息分别进行互换使用。
所述在Master端用于监控CDN节点的状态的方法包括步骤S11、步骤S13和步骤S15。
具体地,在步骤S11中,Master获取CDN节点的一个或多个检测状态变化信息,其中,每个检测状态变化信息是基于Master对应的多个Slave中之一检测所述CDN节点所得的状态检测信息、所述CDN节点所对应的节点状态信息;在步骤S13中,Master根据所述一个或多个检测状态变化信息确定所述CDN节点的综合状态变化信息;在步骤S15中,Master当所述综合状态变化信息为变化时,更新所述节点状态信息。
优选地,在步骤S11中,Master获取CDN节点的一个或多个检测状态变化信息,其中,每个检测状态变化信息是基于Master对应的多个Slave中之一检测所述CDN节点所得的状态检测信息、所述CDN节点所对应的节点状态信息。其中,至少一个Slave与被探测的CDN节点处于同一网段。例如,将Slave接入到不同的ISP服务提供商所提供的网络中进行对CDN节点的探测,其中,至少一个Slave与被探测的CDN节点处于由同一ISP服务提供商所提供的网络接入服务的网段。节点状态信息包括节点地址VIP、检测时间间隔、每次检测的超时时间、本次检测的重试次数、节点当前的健康状况、健康检测端口和类型。若探测HTTP层时,节点状态信息还包括HTTP层的URL信息。在此,节点状态信息可独立存放,也可存放于数据库中;集中存放于主数据库,也可分别存放于各节点对应的分 布式数据库。
本邻域技术人员应理解,所述ISP(Internet Service Provider)是指互联网服务提供商,能提供拨号上网服务、网上浏览、下载文件、收发电子邮件等,是网络最终用户进入因特网的入口和桥梁。所述VIP(Virtual IP Address)是指虚拟IP地址,由代理服务器根据internet内部客户机的多少,给定虚拟IP地址的一个范围,并按某种规定分配给每个客户机一个虚拟IP地址,实现客户机与internet的间接相连。所述HTTP(Hyper Text Transfer Protocol)是指超文本传输协议,用于从环球信息网服务器传输超文本到本地浏览器的传输协议。所述URL(Uniform Resource Locator)是指统一资源定位符,表示互联网上得到的资源的位置和访问方法,是互联网上标准资源的地址,互联网上的每个文件都有一个唯一的URL。
接着,在步骤S13中,Master根据所述一个或多个检测状态变化信息确定所述CDN节点的综合状态变化信息。在此,Master根据接收到的一个或多个检测状态变化信息进行决策,根据设定的决策原则判断是否对节点状态信息进行修改,若是,则将修改后的节点状态信息确定为综合状态变化信息;若否,则保持当前节点状态信息不变,确定此信息为综合状态变化信息。
随后,在步骤S15中,当所述综合状态变化信息为变化时,更新所述节点状态信息。当Master进行决策判断当前的节点状态信息需要修改时,修改节点状态信息,此时综合状态变化信息为变化,接着将修改信息写入到数据库中进行更新节点状态信息。
图6示出根据本申请另一个优选实施例的步骤S13流程示意图。其中,步骤S13包括步骤S131和步骤S132。
具体地,在步骤S131中,Master根据所述一个或多个检测状态变化信息确定所述CDN节点的状态变化通知数量信息;在步骤S132中,Master中当所述状态变化通知数量信息超过预定的状态变化数量阈值信息,确定所述CDN节点的综合状态变化信息为变化。
在步骤S131中,根据所述一个或多个检测状态变化信息确定所述CDN节点的状态变化通知数量信息。例如,有100个Slave对某一节点A 进行探测,探测后有70个确定的检测状态变化信息,则Master接收到的节点A的状态变化通知数量为70个。
接着,在步骤S132中,判断所述状态变化通知数量信息是否超过预定的状态变化数量阈值信息,确定所述CDN节点的综合状态变化信息为变化。例如,假设节点A的状态是可用,在一个探测周期结束后,有60%的Slave探测获取到A的状态为不可用,它们将状态变化通知数量信息发送给Master,此时,Master判断收到的状态变化信息的Slave个数是否超过预定的状态变化数量阈值50%,若是,Master做决策,修改该节点的状态信息为不可用,确定节点A的综合状态变化信息为变化,若否,则节点A的状态仍为可用。
本领域技术人员应能理解上述确定CDN节点的综合状态变化信息为变化的方法仅为举例,其他现有的或今后可能出现的确定CDN节点的综合状态变化信息为变化的方法如可适用于本发明,也应包含在本发明保护范围以内,并在此以引用方式包含于此。
优选地,Master还包括步骤S17(未示出),在步骤S17中Master根据所述Master对应的可用Slave的总数量信息来确定所述状态变化数量阈值信息。例如,对应于Master的可用Slave的总数量为100个,即探测某一节点的探头Slave有100个,设定状态变化数量阈值信息为总探测设备数量的50%,即当Master收到的状态变化信息的Slave个数超过50个,则认为该节点状态发生了变化。
本领域技术人员应能理解上述确定所述状态变化数量阈值信息方法仅为举例,其他现有的或今后可能出现的确定所述状态变化数量阈值信息方法如可适用于本发明,也应包含在本发明保护范围以内,并在此以引用方式包含于此。
优选地,在步骤S131中,根据预定的时间阈值信息,从所述一个或多个检测状态变化信息中确定一个或多个可用的检测状态变化信息,其中,每个可用的检测状态变化信息的存续时间低于或等于所述时间阈值信息;接着,根据所述一个或多个可用的检测状态变化信息确定所述CDN节点的状态变化通知数量信息。
在此,每个节点的探测可能是不同步的,从Slave发送到Master,再到Master做决策时都需要时间,故存续时间低于或等于时间阈值信息时,Master做决策时,能够保证检测状态变化信息的实时性。例如,预定的存续时间阈值为30s,在一个或多个检测状态变化信息中,若其中的一个或多个检测状态变化信息的存续时间低于或等于30s,则将此检测状态变化信息标记为可用。接着,根据标记的可用的检测状态变化信息的数量确定对应CDN节点状态变化通知数量信息。
优选地,在步骤S131中,根据所述一个或多个检测状态变化信息确定所述CDN节点按协议层统计的状态变化通知数量信息。其中,按协议层统计是指各协议层之间是相互独立的,统计时各层是互不影响,统计结果按各自的协议层计算。例如,Slave探测HTTP层和TCP层,统计状态变化通知数量信息时按协议层进行统计,若HTTP层出现状况并不影响TCP层的统计结果,HTTP层统计的变化通知数量信息与该层探测CDN节点的Slave的总数量进行比较,而TCP层统计的变化通知数量信息该层探测CDN节点的Slave的总数量进行比较。
本领域技术人员应能理解,所述TCP(Transmission Control Protocol)是指传输控制协议,是一种面向连接的、可靠的、基于字节流的传输层通信协议。
接着,在步骤S132中,判断所述CDN节点在一协议层的状态变化通知数量信息是否超过预定的状态变化数量阈值信息,确定所述CDN节点在该协议层的综合状态变化信息为变化。例如,进行某一CDN节点A在HTTP层探测时,预定的状态变化数量阈值为探测该协议层的总探测数量的50%,当Master在预定的时间内接收到的节点A在HTTP层的状态变化通知数量信息超过此设定的50%时,则改变该CDN节点的状态,将可用置为不可用,或将不可用置为可用。修改后的CDN节点的状态确定为综合状态变化信息为变化。
本领域技术人员应能理解上述确定所述CDN节点在该协议层的综合状态变化信息为变化的方法仅为举例,其他现有的或今后可能出现的确定所述CDN节点在该协议层的综合状态变化信息为变化的方法如可适用于 本发明,也应包含在本发明保护范围以内,并在此以引用方式包含于此。
更优选地,在步骤S131中,根据所述一个或多个检测状态变化信息,并将结合协议层间的依赖关系,确定所述CDN节点按协议层统计的状态变化通知数量信息。其中,协议层间的依赖关系是指协议层上下层之间的依赖关系。例如,在网络通信中,传输层的上层为应用层,TCP层为HTTP层提供服务,统计HTTP层时是包括了TCP层的统计结果,若TCP层出现状况则HTTP层也出现状况,若HTTP层出现状况则TCP层的统计结果不受影响,即上层统计结果包含其相对应的下层的统计结果,而下层统计结果不受上层结果的影响。
本领域技术人员应能理解上述结合协议层间的依赖关系,确定所述CDN节点按协议层统计的状态变化通知数量信息的方法仅为举例,其他现有的或今后可能出现的结合协议层间的依赖关系,确定所述CDN节点按协议层统计的状态变化通知数量信息的方法如可适用于本发明,也应包含在本发明保护范围以内,并在此以引用方式包含于此。
图7示出根据本申请另一个优选实施例的步骤S15流程示意图。其中,步骤S15包括步骤S151和步骤S152。
具体地,在步骤S151中,当所述综合状态变化信息为变化时,确定所述CDN节点的当前节点状态信息;在步骤S152中,根据所述当前节点状态信息更新所述CDN节点在对应数据库中的节点状态信息。
优选地,在步骤S151中,当所述综合状态变化信息为变化时,确定所述CDN节点的当前节点状态信息。例如,假设某一CDN节点A的状态是可用,在一个探测周期结束后,Slave将节点A的可用的检测状态变化信息发送给Master,经过预定的原则做决策,修改该节点的状态信息为不可用,节点A的综合状态变化信息为变化,节点A的当前节点状态信息确定为不可用。
优选地,在步骤S152中,根据所述当前节点状态信息更新所述CDN节点在对应数据库中的节点状态信息。例如,假设节点A的当前节点状态信息为不可用,将此当前节点状态信息写入到节点A所对应的Master的本地数据库中,数据库中节点A的状态信息更新为当前节点状态信息不可 用,再将此数据库中更新后的节点状态信息同步到对应的Slave的数据库中,完成Slave的数据库中节点A的状态信息的更新。
本领域技术人员应能理解上述更新所述CDN节点在对应数据库中的节点状态信息的方法仅为举例,其他现有的或今后可能出现的更新所述CDN节点在对应数据库中的节点状态信息的方法如可适用于本发明,也应包含在本发明保护范围以内,并在此以引用方式包含于此。
优选地,在步骤S152中,根据所述当前节点状态信息更新所述CDN节点在所述Master的对应数据库中的节点状态信息;接着,通过数据库同步的方式将所述当前更新的节点状态信息同步至到所述节点所对应的各分布式Slave的对应数据库中。
在此,将当前节点状态信息写入Master数据库中,更新Master数据库中节点状态信息,通过同步方式进行更新Slave数据库中节点状态信息。即将所述确定的CDN节点的综合性状态信息同步到所述节点所对应的各分布式Slave数据库中;当监听的Slave数据库中CDN节点的综合性状态信息发生变化时,则所述Slave数据库中的节点地址数据重新加载,进行更新。例如,当Master中某个节点A的状态信息发生变化时,首先将该节点改变的状态信息写入到Master对应的数据库中;接着,使用基于binlog机制的MySQL主从同步方式,能及时在Master与Slave之间同步VIP的状态信息,将该状态信息同步到Slave对应的数据库中。同时,Slave实时监听来自Master的更新信息,之后启动另一个任务根据刚刚接收到的更新信息更新本地数据中的节点A的状态信息。Master端和Slave端都将数据写到对应的本地数据库中,网络连接断开或进程被杀死,都会在连接重建或进程重启后将该数据包含的信息执行完毕;Master数据库中一有数据信息发生变化,会立即同步到Slave的本地数据库中,更新数据库中的数据信息状态。另外,Inotify机制通知Slave的应用进程何时重新加载节点状态信息。节点状态信息存储在数据库中,Slave所属的数据库中的某个节点的状态信息发生变化后,通过使用Inotify机制通知Slave进程重新加载节点状态信息。在实施案例中,节点的状态信息数据存储在数据库中,而数据库中的表都与某个文件一一对应,当数据库中的节点的状态信息数据 发生变化时,该文件也会相应地跟着改变,Slave进程向操作系统发起监听节点的状态信息数据对应的文件的更新操作,即节点的状态信息数据发生改变时,操作系统会通知Slave进程,Slave进程此时再重新加载节点的状态信息。使用本地数据库基于binlog的主从同步和Inotify机制保证分布在各地区的Slave和Master之间节点状态的一致性,Master中某一个VIP的状态变化后,最长3s内同步到Slave的数据库中。
本领域技术人员应能理解上述同步方式和监听机制的方法仅为举例,其他现有的或今后可能出现的同步方式和监听机制的方法如可适用于本发明,也应包含在本发明保护范围以内,并在此以引用方式包含于此。
本领域技术人员还应能理解所述binlog是指二进制日志,用于记录所有更新且提交了数据或者已经潜在更新提交了数据的所有语句,并以二进制的形式保存在磁盘中。所述Inotify是一个网络操作系统的内核特性,是应用进程向操作系统发起监听某文件的更新操作,一旦该文件有更新,操作系统会通知应用进程,应用进程此时再执行相应的操作。
所述在Slave端用于监控CDN节点的状态的方法包括步骤S22、步骤S24和步骤S26。
具体地,在步骤S22中,获取Slave检测对应CDN节点所得的状态检测信息;在步骤S24中,Slave根据所述状态检测信息,以及所述CDN节点对应的节点状态信息,确定所述CDN节点的检测状态变化信息;在步骤S26中,Slave向对应Master发送所述检测状态变化信息。
优选地,在步骤S22中,获取Slave检测对应CDN节点所得的状态检测信息。例如,Slave从本地数据库中读取各CDN节点状态信息,并周期性地做健康检测。其中,Slave不会直接修改本地数据库,只会从本地数据库中读取所需的数据,每个数据元素包括:待检测CDN节点的地址,可根据VIP进行识别不同的CDN节点;检测时间间隔,对节点地址做健康检测的时间周期;每次检测的超时时间,若某次检测超过该时间还未结果响应,则标识该VIP不可用;本轮检测的重试次数,对每个VIP都有若干次重试,若超过该次数此VIP仍然不可达,则标识本轮探测该VIP不可用;每个待检测节点的当前健康状况,标识该VIP当前的健康状况;健康 检测端口,可标识该CDN节点提供服务的端口,例如HTTP服务探测端口为80,HTTPS服务探测端口为443;健康检测类型,标识提供服务的协议层的形式,例如HTTP服务探测端口为80,HTTPS服务探测端口为443;健康检测类型,标识提供服务的协议层的形式,例如,TCP层的健康检测还是HTTP层的健康检测。
接着,在步骤S24中,根据所述状态检测信息,以及所述CDN节点对应的节点状态信息,确定所述CDN节点的检测状态变化信息。在此,所述状态检测信息是指Slave对CDN节点进行探测时获得的检测信息,例如,当Slave从本地数据库中读取CDN节点状态信息,将探测获得的状态信息与CDN节点对应的节点状态信息进行比较,若不一致,则探测获得的状态信息确定为检测状态变化信息,若一致,则进行下一次的探测。
随后,在步骤S26中,向对应Master发送所述检测状态变化信息。在此,Slave将确定的检测状态变化信息发送给对应的Master。Slave将探测结果发送给Master时采用私有信息协议格式,其中,私有信息协议格式是指Slave和Master之间的数据传输方式协商一致的方式发送探测结果数据,例如,socket通信或HTTP协议来承载探测结果数据。消息格式是:sec usec vs_addr avail。其中,sec指产生该消息时的本地时钟-秒,usec指产生该消息时的本地时钟-微秒,vs_addr指要通知Master的CDN节点的VIP,avail指探测后的状态。
本领域技术人员应能理解socket通常是一种常见的计算机之间发送和获取信息的技术手段,是指网络上的两个程序通过一个双向的通信连接实现数据的交换中连接的一端。
本领域技术人员还应能理解上述Master备和Slave之间的数据传输的方式仅为举例,其他现有的或今后可能出现的Master备和Slave之间的数据传输的方式如可适用于本发明,也应包含在本发明保护范围以内,并在此以引用方式包含于此。
优选地,该方法还包括所述检测状态变化信息对应于所述CDN节点在协议层的节点状态的变化信息。例如,假设CDN节点A的状态为可用,探测节点A在协议层HTTP层的节点状态的变化信息为不可用时,则此 Slave探测结果的检测状态变化信息确定为不可用。
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附图标记视为限制所涉及的权利要求。此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。装置权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第一,第二等词语用来表示名称,而并不表示任何特定的顺序。

Claims (21)

  1. 一种在主设备端用于监控CDN节点的状态的方法,其中,该方法包括:
    获取CDN节点的一个或多个检测状态变化信息,其中,每个检测状态变化信息是通过比较主设备对应的多个从设备中之一检测所述CDN节点所得的状态检测信息及所述CDN节点所对应的节点状态信息来确定的;
    根据所述一个或多个检测状态变化信息确定所述CDN节点的综合状态变化信息;
    当所述综合状态变化信息为变化时,更新所述节点状态信息。
  2. 根据权利要求1所述的方法,其中,所述根据所述一个或多个第一状态变化信息确定所述CDN节点的综合状态变化信息包括:
    根据所述一个或多个检测状态变化信息确定所述CDN节点的状态变化通知数量信息;
    当所述状态变化通知数量信息超过预定的状态变化数量阈值信息,确定所述CDN节点的综合状态变化信息为变化。
  3. 根据权利要求2所述的方法,其中,该方法还包括:
    根据所述主设备对应的可用从设备的总数量信息来确定所述状态变化数量阈值信息。
  4. 根据权利要求2或3所述的方法,其中,所述根据所述一个或多个检测状态变化信息确定所述CDN节点的状态变化通知数量信息包括:
    根据预定的时间阈值信息,从所述一个或多个检测状态变化信息中确定一个或多个可用的检测状态变化信息,其中,每个可用的检测状态变化信息的存续时间低于或等于所述时间阈值信息;
    根据所述一个或多个可用的检测状态变化信息确定所述CDN节点的状态变化通知数量信息。
  5. 根据权利要求2至4中任一项所述的方法,其中,所述检测状态变化信息对应于所述CDN节点在协议层的节点状态的变化信息;
    其中,所述根据所述一个或多个检测状态变化信息确定所述CDN节 点的状态变化通知数量信息包括:
    根据所述一个或多个检测状态变化信息确定所述CDN节点按协议层统计的状态变化通知数量信息;
    其中,所述当所述状态变化通知数量信息超过预定的状态变化数量阈值信息,确定所述CDN节点的综合状态变化信息为变化的方法包括:
    当所述CDN节点在一协议层的状态变化通知数量信息超过预定的状态变化数量阈值信息,确定所述CDN节点在该协议层的综合状态变化信息为变化。
  6. 根据权利要求5所述的方法,其中,所述根据所述一个或多个检测状态变化信息确定所述CDN节点的状态变化通知数量信息包括:
    根据所述一个或多个检测状态变化信息,并将结合协议层间的依赖关系,确定所述CDN节点按协议层统计的状态变化通知数量信息。
  7. 根据权利要求1至6中任一项所述的方法,其中,所述当所述综合状态变化信息为变化时,更新所述节点状态信息包括:
    当所述综合状态变化信息为变化时,确定所述CDN节点的当前节点状态信息;
    根据所述当前节点状态信息更新所述CDN节点在对应数据库中的节点状态信息。
  8. 根据权利要求7所述的方法,其中,所述根据所述当前节点状态信息更新所述CDN节点在对应数据库中的节点状态信息包括:
    根据所述当前节点状态信息更新所述CDN节点在所述主设备的对应数据库中的节点状态信息;
    通过数据库同步的方式将所述当前更新的节点状态信息同步至到所述节点所对应的各分布式从设备的对应数据库中。
  9. 一种在从设备端用于监控CDN节点的状态的方法,其中,该方法包括:
    获取从设备检测对应CDN节点所得的状态检测信息;
    根据所述状态检测信息,以及所述CDN节点对应的节点状态信息,确定所述CDN节点的检测状态变化信息;
    向对应主设备发送所述检测状态变化信息。
  10. 根据权利要求9所述的方法,其中,所述检测状态变化信息对应于所述CDN节点在协议层的节点状态的变化信息。
  11. 一种用于监控CDN节点的状态的主设备,其中,该主设备包括:
    状态变化信息获取模块,用于获取CDN节点的一个或多个检测状态变化信息,其中,每个检测状态变化信息是通过比较主设备对应的多个从设备中之一检测所述CDN节点所得的状态检测信息及所述CDN节点所对应的节点状态信息来确定的;
    决策模块,用于根据所述一个或多个检测状态变化信息确定所述CDN节点的综合状态变化信息;
    状态更新模块,用于当所述综合状态变化信息为变化时,更新所述节点状态信息。
  12. 根据权利要求11所述的主设备,其中,所述决策模块包括:
    数量确定单元,用于根据所述一个或多个检测状态变化信息确定所述CDN节点的状态变化通知数量信息;
    判断单元,用于当所述状态变化通知数量信息超过预定的状态变化数量阈值信息,确定所述CDN节点的综合状态变化信息为变化。
  13. 根据权利要求12所述的主设备,其中,该主设备还包括:
    数量阈值信息设定模块,用于根据所述主设备对应的可用从设备的总数量信息来确定所述状态变化数量阈值信息。
  14. 根据权利要求12或13所述的主设备,其中,所述数量确定单元用于:
    根据预定的时间阈值信息,从所述一个或多个检测状态变化信息中确定一个或多个可用的检测状态变化信息,其中,每个可用的检测状态变化信息的存续时间低于或等于所述时间阈值信息;
    根据所述一个或多个可用的检测状态变化信息确定所述CDN节点的状态变化通知数量信息。
  15. 根据权利要求12至14中任一项所述的主设备,其中,所述检测状态变化信息对应于所述CDN节点在协议层的节点状态的变化信息;
    其中,所述数量确定单元用于:
    根据所述一个或多个检测状态变化信息确定所述CDN节点按协议层统计的状态变化通知数量信息;
    其中,所述判断单元用于:
    当所述CDN节点在一协议层的状态变化通知数量信息超过预定的状态变化数量阈值信息,确定所述CDN节点在该协议层的综合状态变化信息为变化。
  16. 根据权利要求15所述的主设备,其中,所述数量确定单元用于:
    根据所述一个或多个检测状态变化信息,并将结合协议层间的依赖关系,确定所述CDN节点按协议层统计的状态变化通知数量信息。
  17. 根据权利要求11至16中任一项所述的主设备,其中,所述第五装置包括:
    状态更新模块,用于当所述综合状态变化信息为变化时,确定所述CDN节点的当前节点状态信息;
    节点状态信息写入模块,用于根据所述当前节点状态信息更新所述CDN节点在对应数据库中的节点状态信息。
  18. 根据权利要求17所述的主设备,其中,所述节点状态信息写入模块用于:
    根据所述当前节点状态信息更新所述CDN节点在所述主设备的对应数据库中的节点状态信息;
    通过数据库同步的方式将所述当前更新的节点状态信息同步至到所述节点所对应的各分布式从设备的对应数据库中。
  19. 一种用于监控CDN节点的状态的从设备,其中,该从设备包括:
    检测模块,用于获取从设备检测对应CDN节点所得的状态检测信息;
    状态变化信息确定模块,用于根据所述状态检测信息,以及所述CDN节点对应的节点状态信息,确定所述CDN节点的检测状态变化信息;
    发送模块,用于向对应主设备发送所述检测状态变化信息。
  20. 根据权利要求19所述的从设备,其中,所述检测状态变化信息对应于所述CDN节点在协议层的节点状态的变化信息。
  21. 一种用于监控CDN节点的状态的系统,其中,该系统包括如权利要求11至18中任一项所述的主设备,以及如权利要求19或20所述的从设备。
PCT/CN2016/090816 2015-08-03 2016-07-21 一种用于监控cdn节点的状态的方法和设备 WO2017020715A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510469199.7A CN106411629B (zh) 2015-08-03 2015-08-03 一种用于监控cdn节点的状态的方法和设备
CN201510469199.7 2015-08-03

Publications (1)

Publication Number Publication Date
WO2017020715A1 true WO2017020715A1 (zh) 2017-02-09

Family

ID=57943808

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/090816 WO2017020715A1 (zh) 2015-08-03 2016-07-21 一种用于监控cdn节点的状态的方法和设备

Country Status (2)

Country Link
CN (1) CN106411629B (zh)
WO (1) WO2017020715A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018017951A1 (en) * 2016-07-21 2018-01-25 Alibaba Group Holding Limited Detection and scheduling method, device, and node of content delivery network
CN110971676A (zh) * 2019-11-18 2020-04-07 中移(杭州)信息技术有限公司 设备状态检测方法、装置、电子设备及存储介质
CN111131515A (zh) * 2019-12-31 2020-05-08 武汉市烽视威科技有限公司 一种cdn边缘注入分发方法及系统
CN112165517A (zh) * 2020-09-22 2021-01-01 成都知道创宇信息技术有限公司 一种回源探测方法、装置、存储介质及电子设备

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108989368B (zh) * 2017-05-31 2021-07-27 腾讯科技(深圳)有限公司 一种链路质量的控制方法及监控设备
CN109918106B (zh) * 2019-02-21 2022-05-17 广东星辉天拓互动娱乐有限公司 一种混合cdn统一源站自动刷新方法及系统
CN110290019B (zh) * 2019-05-27 2021-09-10 网宿科技股份有限公司 监测方法及系统
CN111510327B (zh) 2020-04-08 2022-01-21 北京字节跳动网络技术有限公司 用于共同训练模型的训练参与端的网络连接方法、装置、系统和服务器

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101741643A (zh) * 2009-12-24 2010-06-16 北京世纪互联宽带数据中心有限公司 内容分发网络节点检测方法及系统
CN102938709A (zh) * 2012-11-09 2013-02-20 北京奇虎科技有限公司 一种内容分发网络的监控方法和监控服务器
EP2747379A1 (en) * 2012-12-19 2014-06-25 Telefonica S.A. A distributed health-check method for web caching in a telecommunication network

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7797426B1 (en) * 2008-06-27 2010-09-14 BitGravity, Inc. Managing TCP anycast requests
CN102647299B (zh) * 2012-04-24 2014-10-15 网宿科技股份有限公司 基于内容分发网络的层次化报警分析方法和系统
CN102932204B (zh) * 2012-11-09 2015-05-20 北京奇虎科技有限公司 内容分发网络的监控方法和监控系统
CN104702439B (zh) * 2015-03-16 2018-10-19 北京百度网讯科技有限公司 监控网络节点的方法和装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101741643A (zh) * 2009-12-24 2010-06-16 北京世纪互联宽带数据中心有限公司 内容分发网络节点检测方法及系统
CN102938709A (zh) * 2012-11-09 2013-02-20 北京奇虎科技有限公司 一种内容分发网络的监控方法和监控服务器
EP2747379A1 (en) * 2012-12-19 2014-06-25 Telefonica S.A. A distributed health-check method for web caching in a telecommunication network

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018017951A1 (en) * 2016-07-21 2018-01-25 Alibaba Group Holding Limited Detection and scheduling method, device, and node of content delivery network
CN110971676A (zh) * 2019-11-18 2020-04-07 中移(杭州)信息技术有限公司 设备状态检测方法、装置、电子设备及存储介质
CN110971676B (zh) * 2019-11-18 2022-07-29 中移(杭州)信息技术有限公司 设备状态检测方法、装置、电子设备及存储介质
CN111131515A (zh) * 2019-12-31 2020-05-08 武汉市烽视威科技有限公司 一种cdn边缘注入分发方法及系统
CN111131515B (zh) * 2019-12-31 2022-07-15 武汉市烽视威科技有限公司 一种cdn边缘注入分发方法及系统
CN112165517A (zh) * 2020-09-22 2021-01-01 成都知道创宇信息技术有限公司 一种回源探测方法、装置、存储介质及电子设备

Also Published As

Publication number Publication date
CN106411629B (zh) 2020-06-30
CN106411629A (zh) 2017-02-15

Similar Documents

Publication Publication Date Title
WO2017020715A1 (zh) 一种用于监控cdn节点的状态的方法和设备
US11582119B2 (en) Monitoring enterprise networks with endpoint agents
US11755467B2 (en) Scheduled tests for endpoint agents
US11252060B2 (en) Data center traffic analytics synchronization
US20150149609A1 (en) Performance monitoring to provide real or near real time remediation feedback
US20140108647A1 (en) User Feedback in Network and Server Monitoring Environments
US20030028577A1 (en) HTTP distributed XML-based automated event polling for network and E-service management
KR20190088342A (ko) 네트워크 성능 진단 방법 및 장치, 및 시스템
KR20190088343A (ko) 네트워크 성능지표를 시각화하는 방법 및 장치, 및 시스템
US10469311B2 (en) Handling network failures in networks with redundant servers
US8447730B1 (en) Probe system for replication monitoring
US10382290B2 (en) Service analytics
WO2021021267A1 (en) Scheduled tests for endpoint agents
US8775484B2 (en) Data management apparatus and method
US20130326010A1 (en) System and method for monitoring network connections
CN113708973B (zh) 资源状态监控系统及方法
US20240022628A1 (en) Scalable processing of domain name system queries for a global server load balancing service
US11968075B2 (en) Application session-specific network topology generation for troubleshooting the application session
US11899568B2 (en) Enriched application outage insights
KR20190088344A (ko) 네트워크와 연관된 신규 장치 등록 방법 및 장치
JP5764090B2 (ja) 端末状態検知装置および端末状態検知方法
JP2000029745A (ja) 障害検知方法、コンピュータシステム及び構成装置、記録媒体
WO2023009408A1 (en) Enriched application outage insights

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16832203

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16832203

Country of ref document: EP

Kind code of ref document: A1