WO2019232931A1 - 节点异常处理方法及系统、设备和计算机可读存储介质 - Google Patents

节点异常处理方法及系统、设备和计算机可读存储介质 Download PDF

Info

Publication number
WO2019232931A1
WO2019232931A1 PCT/CN2018/101021 CN2018101021W WO2019232931A1 WO 2019232931 A1 WO2019232931 A1 WO 2019232931A1 CN 2018101021 W CN2018101021 W CN 2018101021W WO 2019232931 A1 WO2019232931 A1 WO 2019232931A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
gateway
heartbeat file
file
service
Prior art date
Application number
PCT/CN2018/101021
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 WO2019232931A1 publication Critical patent/WO2019232931A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0631Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route

Definitions

  • the present application relates to the field of data storage technology, and in particular, to a node exception processing method, a node exception processing system, a device, and a computer-readable storage medium.
  • Time series databases are more and more popular with developers due to their time order, intuitiveness, and easy differentiation.
  • influxdb has been widely used in multiple application scenarios such as log monitoring.
  • the influxdb node may have an abnormality (for example, downtime).
  • an abnormality for example, downtime.
  • the node needs to be restarted manually.
  • human participation made the processing process cumbersome and increased the workload of the operating personnel; on the other hand, due to manual restart, it took a certain amount of time, and when the service request arrived, it could not be processed in time.
  • the hardware device is damaged, the device may need to be replaced, which will take longer and cause the timeliness of processing service requests to be greatly reduced.
  • One of the objectives of this application is to provide a node exception processing method, a node exception processing system, a device, and a computer-readable storage medium, so as to at least to some extent overcome the tedious process of exception processing caused by the need to manually restart a node. And issues that cannot be addressed in a timely manner.
  • a node exception processing method applied to an influxdb cluster includes: a first node determining a connection state between a second node and a gateway, wherein the first node and the second node The nodes share a virtual IP; in a case where it is determined that the connection between the second node and the gateway fails, the first node writes abnormal information of the second node to a heartbeat file and ensures that the second node stops serving; [0008] In a case where it is ensured that the second node stops serving, the first node processes a service request for the second node based on the virtual IP.
  • a node exception processing system which is applied to an influxdb cluster and includes a gateway, a first node and a second node sharing a virtual IP, where the first node is configured to: determine The connection state between the second node and the gateway; if it is determined that the connection between the second node and the gateway fails, write the second node exception information to a heartbeat file and ensure that the second node stops serving In the case of ensuring that the second node stops serving, processing a service request for the second node based on the virtual IP.
  • a computer-readable storage medium on which a computer program is stored, and when the computer-readable storage medium is read by a first node, the computer program is The processor of the node executes, so that the first node performs the following processing:
  • a service request for the second node is processed based on the virtual IP.
  • a first node including: a processor; and a memory, configured to store executable instructions of the processor, where the processor is configured to execute an executable instruction on the memory.
  • the first node performs the following processing:
  • the first node under the gateway that shares the virtual IP with the second node may process the target instead of the second node. Service request from the second node.
  • the node when the node is abnormal, no manual processing is required, which reduces the workload of the operator; on the other hand, the first node that shares the virtual IP replaces the abnormal second node to process service requests, and the switching speed is fast, which meets the timeliness of business Claim.
  • FIG. 1 schematically illustrates a flowchart of a node exception processing method according to an exemplary embodiment of the present application
  • FIG. 2 schematically illustrates a flowchart of a process before a first node processes a service request for a second node according to an exemplary embodiment of the present application.
  • FIG. 3 schematically illustrates an architecture diagram of a node exception processing system according to an exemplary embodiment of the present application
  • FIG. 4 shows a schematic diagram of a storage medium according to an exemplary embodiment of the present application.
  • FIG. 5 schematically illustrates a block diagram of an electronic device according to an exemplary embodiment of the present application.
  • Example embodiments will now be described more fully with reference to the accompanying drawings.
  • example implementations can Formal implementation, and should not be construed as limited to the examples set forth herein; rather, providing these implementations makes this application more comprehensive and complete, and fully conveys the concepts of the example implementations to those skilled in the art.
  • the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
  • many specific details are provided to give a full understanding of the embodiments of the present application.
  • those skilled in the art will realize that the technical solutions of the present application may be practiced without omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted.
  • well-known technical solutions are not shown or described in detail to avoid obscurity and obscure aspects of the present application.
  • FIG. 1 schematically illustrates a flowchart of a node exception processing method according to an exemplary embodiment of the present application.
  • the node exception processing method is applied to an influxdb cluster.
  • the node exception processing method may include the following steps:
  • the first node determines a connection state between the second node and the gateway; wherein the first node and the second node share a virtual IP.
  • Each of the first node and the second node may be two nodes in an influxdb cluster, and is used to implement data read and write services.
  • the first node and the second node may be configured under a gateway, and are configured to communicate with other nodes in the cluster or external systems (such as a data generation system and a data consumption system).
  • the terms “first” and “second” in this application are only for distinguishing different nodes, and do not cause other restrictions on the nodes.
  • the first node and the second node may be understood as two hosts, where The influxdb database is configured on the second node.
  • the first node and the second node share the virtual IP.
  • the process of sharing the virtual IP can be configured by using the ifconfig command.
  • the existing configuration method can also be used to implement the first node and the second node to share the virtual IP. IP, this application does not make any special restrictions.
  • the second node can continuously provide read and write business services, the first node can be in a standby state, or the first node can perform other services in the cluster.
  • the first node may determine a connection status of the second node and the gateway. That is, the first node can determine whether the second node is normally communicating with the gateway or the second node is disconnected from the gateway. Specifically, the first node may initiate a connection request to the second node in a manner of combining TCP / IP and port information. If the connection fails, the first node can reconnect, for example, it can retry the connection 5 times, with an interval of 10 s each time. If the connection still fails, it can be determined that the connection between the second node and the gateway fails, that is, the second node is abnormal. It is easy to understand that if the first node receives the feedback information sent by the second node in response to the connection request, it can be considered that the second node is normal.
  • step S12 it is determined that the connection between the second node and the gateway fails, that is, when the second node is abnormal, the connection status of the first node and the gateway may be monitored by pinging the gateway. Specifically, when the second node is abnormal, the cluster system may add a ping operation to the gateway to monitor whether the first node is normal. If the first node is found to be abnormal, the cluster system can send a warning message to the operator to enter the manual processing stage.
  • the gateway When the gateway is configured with other nodes besides the first node and the second node, if the connection between the second node and the gateway fails, the first node may acquire a lock file to prevent the remaining nodes from processing the second node in parallel. Service request.
  • the lock file may be located in a shared storage system, and the shared storage system may be a GPFS (General Parallel File System, General Parallel File System).
  • the shared storage system of the present application may also be a distributed file system such as PVFS, Lustre, PanFS, and GoogleFS, which is not particularly limited in this exemplary embodiment.
  • the nodes other than the second node under the gateway obtain the section of the lock file first.
  • the point is the first node.
  • an election process may be added to determine the first node.
  • four nodes A, B, C, and D are configured under the gateway.
  • node A is abnormal, that is, when node A is the second abnormal node, it may be due to network conditions and processing capabilities.
  • Node B is better than nodes C and D.
  • node B obtains the lock file from the shared storage system. After B obtains the lock file, node C and node D can Data), processing capacity, etc. to determine whether Node B is qualified to process the service request of Node A.
  • node C and node D determine that node B is eligible, the system determines node B as the first node.
  • the second node abnormality may include two cases, the first case: the connection between the second node and the gateway fails, but the second node may also read and write the heartbeat file.
  • the heartbeat file described in this application can be configured in the shared storage system described above, and the running status of the node can be obtained from the heartbeat file. That is to say, at this time, the second node is not down, but may fail to connect to the gateway because of a network failure.
  • Second situation The second node is down, that is, the connection to the gateway fails, and the heartbeat file is not modified. .
  • Each of these two cases will be described below with reference to FIG. 2.
  • the first node may write the second node exception information to the heartbeat file.
  • This application does not specifically limit the format and data content of the information, and the second node can be identified.
  • the second node can query that there is abnormal information about the second node in the heartbeat file, and respond to the second node.
  • the abnormality information stops the service by itself, and the service status of the second node may be marked as stopped in the heartbeat file, that is, the status is rewritten as "down";
  • the first node may query the second heartbeat file from the heartbeat file.
  • the service status of the node is marked as stopped, at this time, it is ensured that the second node has stopped the service.
  • Step S202 jumps to step S208.
  • step S208 if the first node finds that the service status of the second node in the heartbeat file is not marked as stopped, the first node may send a service stop instruction to the second node. To ensure that the second node stops serving. Specifically, after determining that the connection between the second node and the gateway fails for 10 seconds, the first node may send a service stop instruction to the second node, or may call a remote program to stop the second node from serving. In fact, at this time, the second node is down and will not receive the service stop instruction. This purpose is to further ensure that the service of the second node is stopped, thereby ensuring the security of the first node activation.
  • the first node may write the second node abnormal information to the heartbeat file. Because the second node is down, it will not stop the business service itself, and the first node will not obtain the first node. Information that the second node has stopped business services. Ten seconds after determining that the connection between the second node and the gateway fails, the first node may send a service stop instruction to the second node.
  • the node exception processing method of the present application further includes a step of determining whether the heartbeat file is updated normally before step S12. It should be understood that, in the exemplary embodiment of the present application, whether the node updates the heartbeat file normally is different from whether the node can communicate with the heartbeat file, that is, even if the node updates the heartbeat file abnormally, It does not directly mean that the node is down. In one example, the connection between the node and the gateway may fail and the node does not process business services. At this time, although the node can communicate with the heartbeat file, it will not perform operations such as modifying or writing the heartbeat file.
  • the heartbeat file is updated.
  • the first node can indirectly determine whether the second node may be abnormal by updating whether the heartbeat file is normal.
  • the above steps S12 and S16 are performed.
  • the first node determines that the second node has not updated the heartbeat file within the first preset time, it indicates that the second node may be abnormal, and the processes of steps S12 and S16 may be performed.
  • the first preset time can be set according to the time when the heartbeat file is updated in history and the actual business situation. For example, the first preset time is 10 s, and this application does not specifically limit this.
  • step S12 may be performed if the first node determines within a second preset time that the time interval at which the second node updates the heartbeat file is greater than a time threshold. If the first node determines within a second preset time that the time interval at which the second node updates the heartbeat file is greater than a time threshold, it indicates that the second node may be abnormal, and step S12 may be performed. And the process of step S16.
  • the second preset time and time threshold can be set according to the time when the heartbeat file is updated in history and actual business conditions. For example, the second preset time is 100 s and the time threshold is 7 s. Make special restrictions.
  • node exception processing method on the one hand, when a node is abnormal, no manual processing is required, which reduces the workload of an operator; on the other hand, the first node sharing a virtual IP replaces the exception.
  • the second node processes service requests, has a fast switching speed, and meets the requirements of business timeliness.
  • a node exception processing system is provided, which is applied to an influxd b cluster.
  • FIG. 3 schematically illustrates an architecture diagram of a node exception processing system according to an exemplary embodiment of the present application.
  • a node exception processing system may include a gateway 31, a first node 32, and a second node 33 that share a virtual IP.
  • the node exception processing system may further include a shared storage system 34, and the shared storage system 34 is configured with a heartbeat file and a lock file.
  • the first node 32 may be configured to: determine a connection state between the second node 33 and the gateway 31; if the connection between the second node 33 and the gateway 31 fails, write a second node exception to the heartbeat file Information and ensure that the second node 33 stops serving; in a case where it is ensured that the second node 33 stops serving, a service request for the second node 33 is processed based on the virtual IP.
  • the writing, by the first node 32, the second node exception information to the heartbeat file and ensuring that the second node 33 stops the service includes: the first node 32 writing the second node to the heartbeat file Abnormal information; the second node 33 queries that the second node abnormal information exists in the heartbeat file, stops the service in response to the second node abnormal information and marks the service status of the second node 33 as stopped in the heartbeat file; the first node 32 starts from the heartbeat The service status of the second node 33 queried in the file is marked as stopped to ensure that the second node 32 stops the service.
  • the writing, by the first node 32, the second node abnormality information to the heartbeat file and ensuring that the second node 33 stops the service includes: the first node 32 writes the second node to the heartbeat file Abnormal information; if the first node 32 finds that the service status of the second node 33 in the heartbeat file is not marked as stopped, the first node 32 sends a service stop instruction to the second node 33 to ensure that the second node 33 stops the service.
  • the first node 32 is further configured to determine whether the time at which the second node 33 updates the heartbeat file is normal. If not, the first node 32 determines the time between the second node 33 and the gateway 31. Connection Status.
  • the event that the second node 33 updates the heartbeat file abnormally includes: In the first preset time, the second node 33 has not updated the heartbeat file; or in the second predetermined time, the time interval at which the second node 33 updates the heartbeat file is greater than a time threshold.
  • the gateway 31 performs a ping operation to monitor the connection status of the first node 32 and the gateway 31.
  • the first node 32 acquires a lock file to prevent the remaining nodes under the gateway from processing the service request for the second node 33 in parallel.
  • the node exception processing system on the one hand, when a node is abnormal, there is no need for manual processing, which reduces the workload of an operator; on the other hand, the first node sharing the virtual IP replaces the exception.
  • the second node processes service requests, has a fast switching speed, and meets the requirements of business timeliness.
  • a computer-readable storage medium is further provided, where a computer program is stored, and when the computer-readable storage medium is read by the first node, the The processor executes the computer program, so that the first node executes corresponding steps in the method embodiments described above.
  • aspects of the present application may also be implemented in the form of a program product, which includes program code, and when the program product runs on a terminal device, the program code is used to make the program product The terminal device performs the steps according to various exemplary embodiments of the present application described in the above-mentioned "exemplary method" section of this specification.
  • a program product 400 for implementing the above method according to an embodiment of the present application is described, which may use a portable compact disk read-only memory (CD-ROM) and include program code, and may Runs on a terminal device, such as a personal computer.
  • CD-ROM portable compact disk read-only memory
  • the program product of the present application is not limited thereto.
  • the readable storage medium may be any tangible medium containing or storing a program, and the program may be used by or in combination with an instruction execution system, an apparatus, or a device.
  • the program product may employ any combination of one or more readable media.
  • the readable medium may be a readable signal medium or a readable storage medium.
  • the readable storage medium may be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: Electrical connections with one or more wires , Portable disk, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-RO M), An optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
  • the computer-readable signal medium may include a data signal in baseband or propagated as part of a carrier wave, which carries a readable program code. Such a propagated data signal may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a readable signal medium may also be any readable medium other than a readable storage medium, and the readable medium may send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device.
  • the program code contained on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
  • the program code for performing the operations of the present application may be written in any combination of one or more programming languages.
  • the programming language includes an object-oriented programming language such as Java, C ++, etc., and also includes conventional Procedural programming language-such as "C" or similar programming language.
  • the program code can be executed entirely on the user computing device, partly on the user device, as an independent software package, partly on the user computing device, partly on a remote computing device, or entirely on the remote computing device or server On.
  • the remote computing device may be connected to a user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it may be connected to an external computing device (for example, using an Internet service provider) (Commercially connected via the Internet).
  • LAN local area network
  • WAN wide area network
  • Internet service provider Commercially connected via the Internet
  • an electronic device capable of implementing the above method, such as a first node, which may include: a processor; and a memory, configured to store an available processor of the processor.
  • An execution instruction wherein when the processor executes an executable instruction on the memory, the processor causes the first node to perform a corresponding step in each method embodiment described above.
  • FIG. 5 shows the electricity
  • the sub-device 500 is only an example of the first node, and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
  • the electronic device 500 is expressed in the form of a general-purpose computing device.
  • the components of the electronic device 500 may include, but are not limited to, the at least one processing unit 510, the at least one storage unit 520, a bus 530, and a display unit 540 connecting different system components (including the storage unit 520 and the processing unit 510).
  • the storage unit stores a program code
  • the program code can be executed by the processing unit 510, so that the processing unit 510 executes each of the components according to the present application described in the “exemplary method” section of the present specification. Steps of an exemplary embodiment.
  • the processing unit 510 may perform steps S 12 and S 16 as shown in FIG. 1.
  • the storage unit 520 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 5201 and / or a cache storage unit 5202, and may further include a read-only storage unit
  • RAM random access storage unit
  • cache storage unit 5202 may further include a read-only storage unit
  • the storage unit 520 may further include a program / utility tool 5204 having a group (at least one) of program modules 5205, such program modules 5205 include, but are not limited to: an operating system, one or more application programs, other program modules, and Program data, each or some combination of these examples may include an implementation of a network environment.
  • program modules 5205 include, but are not limited to: an operating system, one or more application programs, other program modules, and Program data, each or some combination of these examples may include an implementation of a network environment.
  • the bus 530 may be one or more of several types of bus structures, including a storage unit bus or a storage unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or any bus structure using a variety of bus structures. Local bus.
  • the electronic device 500 may also communicate with one or more external devices 600 (such as a keyboard, pointing device, Bluetooth device, etc.), and may also communicate with one or more devices that enable a user to interact with the electronic device 500, and / Or communicate with any device (eg, router, modem, etc.) that enables the electronic device 500 to communicate with one or more other computing devices. This communication can be performed through an input / output (I / O) interface 550. Moreover, the electronic device 500 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 560.
  • LAN local area network
  • WAN wide area network
  • public network such as the Internet
  • the network adapter 560 communicates with other modules of the electronic device 500 through the bus 530. It should be understood that although not shown in the figure, other hardware and / or software modules may be used in combination with the electronic device 500, including But not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
  • the example implementation manners described herein may be implemented by software, or may be implemented by software in combination with necessary hardware. Therefore, the technical solution according to the embodiment of the present application may be embodied in the form of a software product, and the software product may be stored in a non-volatile storage medium (which may be a CD-ROM, a U disk, a mobile hard disk, etc.) or on a network It includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiment of the present application.
  • a computing device which may be a personal computer, a server, a terminal device, or a network device, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本申请公开了一种节点异常处理方法及系统、设备和计算机可读存储介质,应用于influxdb集群,涉及数据存储技术领域。该节点异常处理方法包括:第一节点确定第二节点与网关的连接状态,其中,所述第一节点和所述第二节点共享虚拟IP;在确定所述第二节点与所述网关连接失败的情况下,所述第一节点向心跳文件中写入第二节点异常信息并确保所述第二节点停止服务;在确保所述第二节点停止服务的情况下,所述第一节点基于所述虚拟IP处理针对所述第二节点的服务请求。本申请可以实现节点异常时服务请求的及时处理。

Description

节点异常处理方法及系统、 设备和计算机可读存储介质 技术领域
[0001] 相关申请的交叉引用:本申请要求 2018年 6月 5日递交、 发明名称为“节点异常处 理方法及系统, 存储介质和电子设备”的中国专利申请 CN201810577770.0的优先 权, 在此通过引用将其全部内容合并于此。
[0002] 本申请涉及数据存储技术领域, 具体而言, 涉及一种节点异常处理方法、 节点 异常处理系统、 设备和计算机可读存储介质。
背景技术
[0003] 时序数据库以其时间有序、 直观、 便于区分等优点, 越来越受到开发人员青睐 。 作为目前关注度最高的时序数据库之一, influxdb已广泛应用到例如日志监控 的多个应用场景中。
[0004] 由于网络、 节点硬件设备等原因, influxdb节点可能出现异常 (如, 宕机) 的 情况。 目前, 在异常情况发生时, 需要人工重启节点。 本申请的发明人意识到 : 一方面, 人为参与使得处理过程繁琐, 增加了运营人员的工作量; 另一方面 , 由于人工重启, 需要耗费一定的时间, 当服务请求到来时, 无法及时处理, 另外, 在硬件设备损坏的情况下, 可能需要更换设备, 将耗费更长的时间, 导 致处理服务请求的时效性大大降低。
[0005] 需要说明的是, 在上述背景技术部分公开的信息仅用于加强对本申请的背景的 理解, 因此可以包括不构成对本领域普通技术人员已知的现有技术的信息。 发明概述
技术问题
[0006] 本申请的目的之一在于提供一种节点异常处理方法、 节点异常处理系统、 设备 和计算机可读存储介质, 进而至少在一定程度上克服由于需要人为重启节点而 导致的异常处理过程繁琐且无法及时处理的问题。
问题的解决方案
技术解决方案 [0007] 根据本申请的一个方面, 提供一种节点异常处理方法, 应用于 influxdb集群, 包括: 第一节点确定第二节点与网关的连接状态, 其中, 所述第一节点和所述 第二节点共享虚拟 IP; 在确定所述第二节点与所述网关连接失败的情况下, 所述 第一节点向心跳文件中写入第二节点异常信息并确保所述第二节点停止服务; [0008] 在确保所述第二节点停止服务的情况下, 所述第一节点基于所述虚拟 IP处理针 对所述第二节点的服务请求。
[0009] 根据本申请的另一方面, 提供一种节点异常处理系统, 应用于 influxdb集群, 包括网关、 共享虚拟 IP的第一节点和第二节点, 其中: 第一节点被配置用于: 确 定所述第二节点与所述网关的连接状态; 在确定所述第二节点与所述网关连接 失败的情况下, 向心跳文件中写入第二节点异常信息并确保所述第二节点停止 服务; 在确保所述第二节点停止服务的情况下, 基于所述虚拟 IP处理针对所述第 二节点的服务请求。
[0010] 根据本申请的又一方面, 提供一种计算机可读存储介质, 其上存储有计算机程 序, 所述计算机可读存储介质在被第一节点读取时, 所述计算机程序被第一节 点的处理器执行, 使得所述第一节点执行如下处理:
[0011] 确定第二节点与网关的连接状态, 其中, 所述第一节点和第二节点共享虚拟 IP
[0012] 在确定所述第二节点与所述网关连接失败的情况下, 向心跳文件中写入第二节 点异常信息并确保所述第二节点停止服务;
[0013] 在确保所述第二节点停止服务的情况下, 基于所述虚拟 IP处理针对所述第二节 点的服务请求。
[0014] 根据本申请的又一方面, 提供第一节点, 包括: 处理器; 以及存储器, 用于存 储所述处理器的可执行指令, 其中, 所述处理器在执行所述存储器上的可执行 指令时使得所述第一节点执行如下处理:
[0015] 确定第二节点与网关的连接状态, 其中, 所述第一节点和第二节点共享虚拟 IP
[0016] 在确定所述第二节点与所述网关连接失败的情况下, 向心跳文件中写入第二节 点异常信息并确保所述第二节点停止服务; [0017] 在确保所述第二节点停止服务的情况下, 基于所述虚拟 IP处理针对所述第二节 点的服务请求。
[0018] 在本申请的一些实施例所提供的技术方案中, 在第二节点与网关连接失败的情 况下, 网关下的与第二节点共享虚拟 IP的第一节点可以代替第二节点处理针对第 二节点的服务请求。 一方面, 节点异常时, 无需人工处理, 减少了运营人员的 工作量; 另一方面, 通过共享虚拟 IP的第一节点代替异常的第二节点处理服务请 求, 切换速度快, 满足业务时效性的要求。
[0019] 应当理解的是, 以上的一般描述和后文的细节描述仅是示例性和解释性的, 并 不能限制本申请。
发明的有益效果
对附图的简要说明
附图说明
[0020] 此处的附图被并入说明书中并构成本说明书的一部分, 示出了符合本申请的实 施例, 并与说明书一起用于解释本申请的原理。 显而易见地, 下面描述中的附 图仅仅是本申请的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造 性劳动的前提下, 还可以根据这些附图获得其他的附图。 在附图中:
[0021] 图 1示意性示出了根据本申请的示例性实施方式的节点异常处理方法的流程图
[0022] 图 2示意性示出了根据本申请的示例性实施方式的第一节点处理针对第二节点 的服务请求前过程的流程图。
[0023] 图 3示意性示出了根据本申请的示例性实施方式的节点异常处理系统的架构图
[0024] 图 4示出了根据本申请的示例性实施方式的存储介质的示意图。
[0025] 图 5示意性示出了根据本申请的示例性实施方式的电子设备的方框图。
发明实施例
本发明的实施方式
[0026] 现在将参考附图更全面地描述示例实施方式。 然而, 示例实施方式能够以多种 形式实施, 且不应被理解为限于在此阐述的范例; 相反, 提供这些实施方式使 得本申请将更加全面和完整, 并将示例实施方式的构思全面地传达给本领域的 技术人员。 所描述的特征、 结构或特性可以以任何合适的方式结合在一个或更 多实施方式中。 在下面的描述中, 提供许多具体细节从而给出对本申请的实施 方式的充分理解。 然而, 本领域技术人员将意识到, 可以实践本申请的技术方 案而省略所述特定细节中的一个或更多, 或者可以采用其它的方法、 组元、 装 置、 步骤等。 在其它情况下, 不详细示出或描述公知技术方案以避免喧宾夺主 而使得本申请的各方面变得模糊。
[0027] 此外, 附图仅为本申请的示意性图解, 并非一定是按比例绘制。 图中相同的附 图标记表示相同或类似的部分, 因而将省略对它们的重复描述。 附图中所示的 一些方框图是功能实体, 不一定必须与物理或逻辑上独立的实体相对应。 可以 采用软件形式来实现这些功能实体, 或在一个或多个硬件模块或集成电路中实 现这些功能实体, 或在不同网络和 /或处理器装置和 /或微控制器装置中实现这些 功能实体。
[0028] 附图中所示的流程图仅是示例性说明, 不是必须包括所有的步骤。 例如, 有的 步骤还可以分解, 而有的步骤可以合并或部分合并, 因此实际执行的顺序有可 能根据实际情况改变。
[0029] 图 1示意性示出了本申请的示例性实施方式的节点异常处理方法的流程图, 该 节点异常处理方法应用于 influxdb集群。 参考图 1, 所述节点异常处理方法可以包 括以下步骤:
[0030] S12.第一节点确定第二节点与网关的连接状态; 其中, 所述第一节点和所述第 二节点共享虚拟 IP。
[0031] 第一节点和第二节点均可以是 influxdb集群中的两个节点, 用于实现数据的读 写业务。 另外, 第一节点和第二节点可以配置在一网关下, 用于与集群中其余 节点或外部系统 (如, 数据产生系统、 数据消费系统等) 进行通信连接。 另外 , 应当理解的是, 本申请中术语“第一”、 “第二”仅为了区分不同的节点, 并不对 节点造成其他限制作用。
[0032] 在本申请的一个实施例中, 可以将第一节点和第二节点理解为两台主机, 其中 , 第二节点上配置有 influxdb数据库。
[0033] 第一节点和第二节点共享虚拟 IP, 具体的, 共享虚拟 IP的过程可以通过 ifconfig 命令进行配置, 然而, 还可以使用现有的配置方法来实现第一节点和第二节点 共享虚拟 IP, 本申请对此不做特殊限制。
[0034] 正常情况下, 第二节点可以持续提供读写业务服务, 第一节点可以处于待机状 态或者第一节点可以执行集群中的其他业务。
[0035] 第一节点可以确定第二节点与网关的连接状态。 也就是说, 第一节点可以判断 第二节点与网关通信正常还是第二节点与网关断开。 具体的, 第一节点可以通 过 TCP/IP结合端口信息的方式向第二节点发起连接请求。 如果连接失败, 则第 一节点可以重新进行连接, 例如, 可以重新尝试连接 5次, 每次间隔 10 s。 如果 连接依然连接失败, 则可以确定第二节点与网关连接失败, 即, 第二节点异常 。 容易理解的是, 如果第一节点接收到第二节点响应连接请求而发送的反馈信 息, 则可以认为第二节点正常。
[0036] S14.如果所述第二节点与所述网关连接失败, 则所述第一节点向心跳文件中写 入第二节点异常信息并确保所述第二节点停止服务。
[0037] 在网关下仅有第一节点和第二节点的示例中, 需要保持第一节点和第二节点中 至少一个节点正常。 在步骤 S12中确定出第二节点与网关连接失败、 也就是说第 二节点异常的情况下, 可以通过对网关的 ping操作监视第一节点与网关的连接状 态。 具体的, 当第二节点异常时, 集群系统可以增加对网关的 ping操作以监视第 一节点是否正常。 如果发现第一节点也异常, 集群系统可以向运营人员发出告 警信息, 以进入人工处理阶段。
[0038] 在网关下除第一节点和第二节点外, 还配置有其余节点时, 如果第二节点与网 关连接失败, 第一节点可以获取锁文件, 以防止其余节点并行处理针对第二节 点的服务请求。 其中, 锁文件可以位于一共享存储系统中, 该共享存储系统可 以为 GPFS (General Parallel File System, 通用并行文件系统) 。 然而, 本申请的 共享存储系统还可以为例如为 PVFS、 Lustre、 PanFS、 GoogleFS的分布式文件系 统, 本示例性实施方式中对此不做特殊限定。
[0039] 应当理解的是, 在该实例中, 网关下除第二节点外的节点中先获得锁文件的节 点为第一节点。 另外, 还可以附加选举过程来确定第一节点。 例如, 网关下配 置有 A、 B、 C、 D四个节点, 当节点 A异常时, 也就是说, 当节点 A为上述异常 的第二节点时, 可能出于网络状况及处理能力等原因, 节点 B优于节点 C和节点 D, 在这种情况下, 节点 B从共享存储系统中获取了锁文件, 在 B获取锁文件后 , 节点 C和节点 D可以依据节点 B的节点属性 (针对何种数据进行存储) 、 处理 能力等确定节点 B是否有资格处理节点 A的服务请求。 在节点 C和节点 D确定出节 点 B有资格时, 系统将节点 B确定为第一节点。
[0040] 第二节点异常可以包括两种情况, 第一种情况: 第二节点与网关连接失败, 但 是第二节点还可以对心跳文件进行读写。 本申请所述的心跳文件可以配置在上 述的共享存储系统中, 从心跳文件中可以获知节点的运行状态。 也就是说, 此 时, 第二节点并没有宕机, 只是可能因为网络故障等原因与网关连接失败; 第 二种情况: 第二节点宕机, 即与网关连接失败, 也不会修改心跳文件。 下面将 参考图 2对这两种情况分别进行说明。
[0041] 针对第一种情况:
[0042] 在步骤 S202中, 第一节点可以向心跳文件写入第二节点异常信息。 本申请对该 信息的格式及数据内容不做特殊限定, 以第二节点能够识别为准; 在步骤 S204 中, 第二节点可以查询到心跳文件中存在第二节点异常信息, 响应该第二节点 异常信息自行停止服务, 并可以在心跳文件中将第二节点的服务状态标记为停 止, 即, 状态被改写为“down”; 在步骤 S206中, 第一节点可以从心跳文件中查 询到第二节点的服务状态被标记为停止, 此时, 确保了第二节点已停止服务。
[0043] 针对第二种情况:
[0044] 步骤 S202跳转至步骤 S208, 在步骤 S208中, 如果第一节点查询到心跳文件中第 二节点的服务状态未被标记为停止, 则第一节点可以向第二节点发送服务停止 指令, 以确保所述第二节点停止服务。 具体的, 在确定出第二节点与网关连接 失败 10秒后, 第一节点可以向第二节点发送业务停止指令, 也可以调用远程程 序来使第二节点停止服务。 实际上, 此时第二节点宕机, 并不会接收到该业务 停止指令。 这样的目的在于进一步确保第二节点服务停止, 进而保证了第一节 点启用的安全性。 [0045] 具体的, 在第二种情况下, 第一节点可以向心跳文件写入第二节点异常信息, 由于第二节点宕机, 不会自身停止业务服务, 第一节点也不会获取第二节点已 停止业务服务的信息。 在距确定出第二节点与网关连接失败 10秒后, 第一节点 可以向第二节点发送业务停止指令。
[0046] S16.在确保所述第二节点停止服务后, 所述第一节点基于所述虚拟 IP处理针对 所述第二节点的服务请求。
[0047] 此外, 本申请的节点异常处理方法还包括在步骤 S12前, 判断心跳文件是否更 新正常的步骤。 应当理解的是, 在本申请的示例性实施方式中, 节点对心跳文 件进行更新是否正常与节点是否能和心跳文件进行通信是不同的, 也就是说, 即使节点对心跳文件的更新不正常, 也不直接意味着节点宕机。 在一个实例中 , 可能由于节点与网关的连接失败, 节点并无处理业务服务, 此时, 节点虽然 能够与心跳文件进行通信, 然而也不会进行心跳文件的修改、 写入等操作。
[0048] 在第二节点正常的情况下, 会对心跳文件进行更新。 第一节点可以通过对心跳 文件更新是否正常来间接判断第二节点是否可能异常。 在判断出第二节点更新 心跳文件不正常时, 执行上述步骤 S12及步骤 S16的过程。
[0049] 根据本申请的一些实施例, 如果第一节点在第一预设时间内判断出第二节点未 更新心跳文件, 则说明第二节点可能异常, 可以执行上述步骤 S12及步骤 S16的 过程。 其中, 该第一预设时间可以根据历史更新心跳文件的时间以及实际业务 情况进行设定, 例如, 第一预设时间为 10 s, 本申请对此不做特殊限制。
[0050] 根据另外一些实施例, 如果第一节点在第二预设时间内判断出第二节点更新心 跳文件的时间间隔均大于一时间阈值, 则说明第二节点可能异常, 可以执行上 述步骤 S12及步骤 S16的过程。 类似的, 该第二预设时间和时间阈值可以根据历 史更新心跳文件的时间以及实际业务情况进行设定, 例如, 第二预设时间为 100 s , 时间阈值为 7 s, 本申请对此不做特殊限制。
[0051] 在本申请示例性实施方式的节点异常处理方法中, 一方面, 节点异常时, 无需 人工处理, 减少了运营人员的工作量; 另一方面, 通过共享虚拟 IP的第一节点代 替异常的第二节点处理服务请求, 切换速度快, 满足业务时效性的要求。
[0052] 应当注意, 尽管在附图中以特定顺序描述了本申请中方法的各个步骤, 但是, 这并非要求或者暗示必须按照该特定顺序来执行这些步骤, 或是必须执行全部 所示的步骤才能实现期望的结果。 附加的或备选的, 可以省略某些步骤, 将多 个步骤合并为一个步骤执行, 以及 /或者将一个步骤分解为多个步骤执行等。
[0053] 进一步的, 本示例实施方式中还提供了一种节点异常处理系统, 应用于 influxd b集群。
[0054] 图 3示意性示出了本申请的示例性实施方式的节点异常处理系统的架构图。
[0055] 参考图 3, 根据本申请的示例性实施方式的节点异常处理系统可以包括网关 31 、 共享虚拟 IP的第一节点 32和第二节点 33。 此外, 节点异常处理系统还可以包括 共享存储系统 34, 共享存储系统 34中配置有心跳文件和锁文件。
[0056] 具体的, 第一节点 32可以被配置用于: 确定第二节点 33与网关 31的连接状态; 如果第二节点 33与网关 31连接失败, 则向心跳文件中写入第二节点异常信息并 确保第二节点 33停止服务; 在确保所述第二节点 33停止服务的情况下, 基于虚 拟 IP处理针对第二节点 33的服务请求。
[0057] 根据本申请的示例性实施例, 第一节点 32向心跳文件中写入第二节点异常信息 并确保第二节点 33停止服务包括: 第一节点 32向心跳文件中写入第二节点异常 信息; 第二节点 33查询到心跳文件中存在第二节点异常信息, 响应第二节点异 常信息停止服务并在心跳文件中将第二节点 33的服务状态标记为停止; 第一节 点 32从心跳文件中查询到第二节点 33的服务状态被标记为停止, 以确保第二节 点 32停止服务。
[0058] 根据本申请的示例性实施例, 第一节点 32向心跳文件中写入第二节点异常信息 并确保第二节点 33停止服务包括: 第一节点 32向心跳文件中写入第二节点异常 信息; 如果第一节点 32查询到心跳文件中第二节点 33的服务状态未被标记为停 止, 则第一节点 32向第二节点 33发送服务停止指令, 以确保第二节点 33停止服 务。
[0059] 根据本申请的示例性实施例, 第一节点 32还用于判断第二节点 33更新心跳文件 的时间是否正常, 如果不正常, 则第一节点 32确定第二节点 33与网关 31的连接 状态。
[0060] 根据本申请的示例性实施例, 第二节点 33更新心跳文件的事件不正常包括: 在 第一预设时间内, 第二节点 33未更新心跳文件; 或者在第二预定时间内, 第二 节点 33更新心跳文件的时间间隔均大于一时间阈值。
[0061] 根据本申请的示例性实施例, 网关 31执行 ping操作以监视第一节点 32与网关 31 的连接状态。
[0062] 根据本申请的示例性实施例, 在第二节点 33与网关 31连接失败的情况下, 第一 节点 32获取锁文件以防止网关下其余节点并行处理针对第二节点 33的服务请求
[0063] 在本申请示例性实施方式的节点异常处理系统中, 一方面, 节点异常时, 无需 人工处理, 减少了运营人员的工作量; 另一方面, 通过共享虚拟 IP的第一节点代 替异常的第二节点处理服务请求, 切换速度快, 满足业务时效性的要求。
[0064] 由于本申请实施方式的节点异常处理系统的各部分说明已在上面的节点异常处 理方法中进行了描述, 因此在此不再赘述。
[0065] 在本申请的示例性实施例中, 还提供了一种计算机可读存储介质, 其上存储有 计算机程序, 该计算机可读存储介质在被第一节点读取时, 第一节点的处理器 执行所述计算机程序, 使得第一节点执行如上所述的各方法实施例中的相应步 骤。 在一些可能的实施方式中, 本申请的各个方面还可以实现为一种程序产品 的形式, 其包括程序代码, 当所述程序产品在终端设备上运行时, 所述程序代 码用于使所述终端设备执行本说明书上述“示例性方法”部分中描述的根据本申请 各种示例性实施方式的步骤。
[0066] 参考图 4所示, 描述了根据本申请的实施方式的用于实现上述方法的程序产品 4 00, 其可以采用便携式紧凑盘只读存储器 (CD-ROM)并包括程序代码, 并可以在 终端设备, 例如个人电脑上运行。 然而, 本申请的程序产品不限于此, 在本文 件中, 可读存储介质可以是任何包含或存储程序的有形介质, 该程序可以被指 令执行系统、 装置或者器件使用或者与其结合使用。
[0067] 所述程序产品可以采用一个或多个可读介质的任意组合。 可读介质可以是可读 信号介质或者可读存储介质。 可读存储介质例如可以为但不限于电、 磁、 光、 电磁、 红外线、 或半导体的系统、 装置或器件, 或者任意以上的组合。 可读存 储介质的更具体的例子 (非穷举的列表) 包括: 具有一个或多个导线的电连接 、 便携式盘、 硬盘、 随机存取存储器 (RAM) 、 只读存储器 (ROM) 、 可擦式 可编程只读存储器 (EPROM或闪存) 、 光纤、 便携式紧凑盘只读存储器(CD-RO M)、 光存储器件、 磁存储器件、 或者上述的任意合适的组合。
[0068] 计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号, 其中承载了可读程序代码。 这种传播的数据信号可以采用多种形式, 包括但不 限于电磁信号、 光信号或上述的任意合适的组合。 可读信号介质还可以是可读 存储介质以外的任何可读介质, 该可读介质可以发送、 传播或者传输用于由指 令执行系统、 装置或者器件使用或者与其结合使用的程序。
[0069] 可读介质上包含的程序代码可以用任何适当的介质传输, 包括但不限于无线、 有线、 光缆、 RF等等, 或者上述的任意合适的组合。
[0070] 可以以一种或多种程序设计语言的任意组合来编写用于执行本申请操作的程序 代码, 所述程序设计语言包括面向对象的程序设计语言一诸如 Java、 C++等, 还 包括常规的过程式程序设计语言一诸如“C”语言或类似的程序设计语言。 程序代 码可以完全地在用户计算设备上执行、 部分地在用户设备上执行、 作为一个独 立的软件包执行、 部分在用户计算设备上部分在远程计算设备上执行、 或者完 全在远程计算设备或服务器上执行。 在涉及远程计算设备的情形中, 远程计算 设备可以通过任意种类的网络, 包括局域网 (LAN) 或广域网 (WAN) , 连接 到用户计算设备, 或者, 可以连接到外部计算设备 (例如利用因特网服务提供 商来通过因特网连接) 。
[0071] 在本申请的示例性实施例中, 还提供了一种能够实现上述方法的电子设备, 例 如第一节点, 其可以包括: 处理器; 以及存储器, 用于存储所述处理器的可执 行指令, 其中, 所述处理器在执行所述存储器上的可执行指令时使得第一节点 执行如上所述的各方法实施例中的相应步骤。
[0072] 所属技术领域的技术人员能够理解, 本申请的各个方面可以实现为系统、 设备 、 方法或程序产品。 因此, 本申请的各个方面可以具体实现为以下形式, 即: 完全的硬件实施方式、 完全的软件实施方式 (包括固件、 微代码等) , 或硬件 和软件方面结合的实施方式, 这里可以统称为“电路”、 “模块”或“系统”。
[0073] 下面参照图 5来描述根据本申请的这种实施方式的电子设备 500。 图 5显示的电 子设备 500仅仅是第一节点的一个示例, 不应对本申请实施例的功能和使用范围 带来任何限制。
[0074] 如图 5所示, 电子设备 500以通用计算设备的形式表现。 电子设备 500的组件可 以包括但不限于: 上述至少一个处理单元 510、 上述至少一个存储单元 520、 连 接不同系统组件 (包括存储单元 520和处理单元 510) 的总线 530、 显示单元 540
[0075] 其中, 所述存储单元存储有程序代码, 所述程序代码可以被所述处理单元 510 执行, 使得所述处理单元 510执行本说明书上述“示例性方法”部分中描述的根据 本申请各种示例性实施方式的步骤。 例如, 所述处理单元 510可以执行如图 1中 所示的步骤 S 12和步骤 S 16。
[0076] 存储单元 520可以包括易失性存储单元形式的可读介质, 例如随机存取存储单 元 (RAM) 5201和 /或高速缓存存储单元 5202, 还可以进一步包括只读存储单元
(ROM) 5203。
[0077] 存储单元 520还可以包括具有一组 (至少一个) 程序模块 5205的程序 /实用工具 5204, 这样的程序模块 5205包括但不限于: 操作系统、 一个或者多个应用程序 、 其它程序模块以及程序数据, 这些示例中的每一个或某种组合中可能包括网 络环境的实现。
[0078] 总线 530可以为表示几类总线结构中的一种或多种, 包括存储单元总线或者存 储单元控制器、 外围总线、 图形加速端口、 处理单元或者使用多种总线结构中 的任意总线结构的局域总线。
[0079] 电子设备 500也可以与一个或多个外部设备 600 (例如键盘、 指向设备、 蓝牙设 备等) 通信, 还可与一个或者多个使得用户能与该电子设备 500交互的设备通信 , 和 /或与使得该电子设备 500能与一个或多个其它计算设备进行通信的任何设备 (例如路由器、 调制解调器等等) 通信。 这种通信可以通过输入 /输出 (I/O) 接 口 550进行。 并且, 电子设备 500还可以通过网络适配器 560与一个或者多个网络 (例如局域网 (LAN) , 广域网 (WAN) 和 /或公共网络, 例如因特网) 通信。 如图所示, 网络适配器 560通过总线 530与电子设备 500的其它模块通信。 应当明 白, 尽管图中未示出, 可以结合电子设备 500使用其它硬件和 /或软件模块, 包括 但不限于: 微代码、 设备驱动器、 冗余处理单元、 外部磁盘驱动阵列、 RAID系 统、 磁带驱动器以及数据备份存储系统等。
[0080] 通过以上的实施方式的描述, 本领域的技术人员易于理解, 这里描述的示例实 施方式可以通过软件实现, 也可以通过软件结合必要的硬件的方式来实现。 因 此, 根据本申请实施方式的技术方案可以以软件产品的形式体现出来, 该软件 产品可以存储在一个非易失性存储介质 (可以是 CD-ROM, U盘, 移动硬盘等) 中或网络上, 包括若干指令以使得一台计算设备 (可以是个人计算机、 服务器 、 终端装置、 或者网络设备等) 执行根据本申请实施方式的方法。
[0081] 此外, 上述附图仅是根据本申请示例性实施例的方法所包括的处理的示意性说 明, 而不是限制目的。 易于理解, 上述附图所示的处理并不表明或限制这些处 理的时间顺序。 另外, 也易于理解, 这些处理可以是例如在多个模块中同步或 异步执行的。
[0082] 应当注意, 尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者 单元, 但是这种划分并非强制性的。 实际上, 根据本申请的实施方式, 上文描 述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化 。 反之, 上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个 模块或者单元来具体化。
[0083] 本领域技术人员在考虑说明书及实践这里公开的发明后, 将容易想到本申请的 其他实施例。 本申请旨在涵盖本申请的任何变型、 用途或者适应性变化, 这些 变型、 用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本 技术领域中的公知常识或惯用技术手段。 说明书和实施例仅被视为示例性的, 本申请的真正范围和精神由权利要求指出。
[0084] 应当理解的是, 本申请并不局限于上面已经描述并在附图中示出的精确结构, 并且可以在不脱离其范围进行各种修改和改变。 本申请的范围仅由所附的权利 要求来限。

Claims

权利要求书
[权利要求 1] 一种节点异常处理方法, 应用于 influxdb集群, 其特征在于, 包括: 第一节点确定第二节点与网关的连接状态, 其中, 所述第一节点和所 述第二节点共享虚拟 IP;
在确定所述第二节点与所述网关连接失败的情况下, 所述第一节点向 心跳文件中写入第二节点异常信息并确保所述第二节点停止服务; 在确保所述第二节点停止服务的情况下, 所述第一节点基于所述虚拟 IP处理针对所述第二节点的服务请求。
[权利要求 2] 根据权利要求 1所述的节点异常处理方法, 其特征在于, 所述第一节 点向心跳文件中写入第二节点异常信息并确保所述第二节点停止服务 包括:
所述第一节点向心跳文件中写入第二节点异常信息;
所述第二节点查询到所述心跳文件中存在所述第二节点异常信息, 响 应于所述第二节点异常信息停止服务并在所述心跳文件中将所述第二 节点的服务状态标记为停止;
所述第一节点通过从所述心跳文件中查询到所述第二节点的服务状态 被标记为停止, 来确保所述第二节点停止服务。
[权利要求 3] 根据权利要求 1所述的节点异常处理方法, 其特征在于, 所述第一节 点向心跳文件中写入第二节点异常信息并确保所述第二节点停止服务 包括:
所述第一节点向心跳文件中写入第二节点异常信息;
在所述第一节点查询到所述心跳文件中所述第二节点的服务状态未被 标记为停止的情况下, 所述第一节点向所述第二节点发送服务停止指 令, 以确保所述第二节点停止服务。
[权利要求 4] 根据权利要求 1-3中任一项所述的节点异常处理方法, 其特征在于, 在第一节点确定第二节点与网关的连接状态之前, 所述节点异常处理 方法还包括:
第一节点判断第二节点更新心跳文件的事件是否正常; 在判断为不正常的情况下, 所述第一节点确定所述第二节点与网关的 连接状态。
[权利要求 5] 根据权利要求 4所述的节点异常处理方法, 其特征在于, 第二节点更 新心跳文件的事件不正常包括:
在第一预设时间内, 第二节点未更新心跳文件; 或者 在第二预定时间内, 第二节点更新心跳文件的时间间隔均大于一时间 阈值。
[权利要求 6] 根据权利要求 1-5中任一项所述的节点异常处理方法, 其特征在于, 所述节点异常处理方法还包括:
在所述第二节点与所述网关连接失败的情况下, 通过对所述网关的 pi ng操作监视所述第一节点与所述网关的连接状态。
[权利要求 7] 根据权利要求 1-5中任一项所述的节点异常处理方法, 其特征在于, 所述节点异常处理方法还包括:
在所述第二节点与所述网关连接失败的情况下, 通过对所述网关的 pi ng操作监视所述第一节点与所述网关的连接状态。
[权利要求 8] 一种节点异常处理系统, 应用于 influxdb集群, 其特征在于, 包括网 关、 共享虚拟 IP的第一节点和第二节点, 其中:
第一节点被配置用于: 确定所述第二节点与所述网关的连接状态; 在 确定所述第二节点与所述网关连接失败的情况下, 向心跳文件中写入 第二节点异常信息并确保所述第二节点停止服务; 在确保所述第二节 点停止服务的情况下, 基于所述虚拟 IP处理针对所述第二节点的服务 请求。
[权利要求 9] 根据权利要求 8所述的节点异常处理系统, 其特征在于, 所述第一节 点被配置用于向心跳文件中写入第二节点异常信息并确保所述第二节 点停止服务包括: 所述第一节点被配置用于:
向心跳文件中写入第二节点异常信息;
在查询到所述心跳文件中所述第二节点的服务状态未被标记为停止的 情况下, 向所述第二节点发送服务停止指令。
[权利要求 10] 根据权利要求 8或 9所述的节点异常处理系统, 其特征在于, 所述第二 节点被配置用于:
响应于查询到所述心跳文件中存在所述第二节点异常信息, 停止服务 并在所述心跳文件中将所述第二节点的服务状态标记为停止。
[权利要求 11] 根据权利要求 8-10中任一项所述的节点异常处理系统, 其特征在于, 所述第一节点还被配置用于:
通过从所述心跳文件中查询到所述第二节点的服务状态被标记为停止 , 来确保所述第二节点停止服务。
[权利要求 12] 根据权利要求 8-11中任一项所述的节点异常处理系统, 其特征在于, 所述第一节点还被配置用于:
判断第二节点更新心跳文件的事件是否正常;
在判断为不正常的情况下, 确定所述第二节点与网关的连接状态。
[权利要求 13] 根据权利要求 8-12中任一项所述的节点异常处理系统, 其特征在于, 所述第一节点还被配置用于:
在确定所述第二节点与所述网关连接失败的情况下, 获取锁文件以防 止所述网关下其余节点并行处理针对所述第二节点的服务请求。
[权利要求 14] 一种计算机可读存储介质, 其上存储有计算机程序, 其特征在于, 所 述计算机可读存储介质在被第一节点读取时, 所述计算机程序被第一 节点的处理器执行, 使得所述第一节点执行如下处理:
确定第二节点与网关的连接状态, 其中, 所述第一节点和第二节点共 享虚拟 IP;
在确定所述第二节点与所述网关连接失败的情况下, 向心跳文件中写 入第二节点异常信息并确保所述第二节点停止服务;
在确保所述第二节点停止服务的情况下, 基于所述虚拟 IP处理针对所 述第二节点的服务请求。
[权利要求 15] 根据权利要求 14所述的计算机可读存储介质, 其特征在于, 所述计算 机程序被第一节点的处理器执行使得所述第一节点还执行如下处理: 向心跳文件中写入第二节点异常信息; 在查询到所述心跳文件中所述第二节点的服务状态未被标记为停止的 情况下, 向所述第二节点发送服务停止指令。
[权利要求 16] 根据权利要求 14或 15所述的计算机可读存储介质, 其特征在于, 所述 计算机程序被第一节点的处理器执行使得所述第一节点还执行如下处 理:
通过从所述心跳文件中查询到所述第二节点的服务状态被标记为停止 , 来确保所述第二节点停止服务。
[权利要求 17] 根据权利要求 14-16中任一项所述的计算机可读存储介质, 其特征在 于, 所述计算机程序被第一节点的处理器执行使得所述第一节点还执 行如下处理:
判断第二节点更新心跳文件的事件是否正常;
在判断为不正常的情况下, 确定所述第二节点与网关的连接状态。
[权利要求 18] 根据权利要求 14-17中任一项所述的计算机可读存储介质, 其特征在 于, 所述计算机程序被第一节点的处理器执行使得所述第一节点还执 行如下处理:
在确定所述第二节点与所述网关连接失败的情况下, 获取锁文件以防 止所述网关下其余节点并行处理针对所述第二节点的服务请求。
[权利要求 19] 第一节点, 其特征在于, 包括:
处理器; 以及
存储器, 用于存储所述处理器的可执行指令;
其中, 所述处理器在执行所述存储器上的可执行指令时使得所述第一 节点执行如下处理:
确定第二节点与网关的连接状态, 其中, 所述第一节点和第二节点共 享虚拟 IP;
在确定所述第二节点与所述网关连接失败的情况下, 向心跳文件中写 入第二节点异常信息并确保所述第二节点停止服务;
在确保所述第二节点停止服务的情况下, 基于所述虚拟 IP处理针对所 述第二节点的服务请求。
[权利要求 20] 根据权利要求 19所述的第一节点, 其特征在于, 所述处理器在执行所 述存储器上的可执行指令时使得所述第一节点还执行如下处理: 向心跳文件中写入第二节点异常信息;
在查询到所述心跳文件中所述第二节点的服务状态未被标记为停止的 情况下, 向所述第二节点发送服务停止指令。
[权利要求 21] 根据权利要求 19或 20所述的第一节点, 其特征在于, 所述处理器在执 行所述存储器上的可执行指令时使得所述第一节点还执行如下处理: 通过从所述心跳文件中查询到所述第二节点的服务状态被标记为停止 , 来确保所述第二节点停止服务。
[权利要求 22] 根据权利要求 19-21中任一项所述的第一节点, 其特征在于, 所述处 理器在执行所述存储器上的可执行指令时使得所述第一节点还执行如 下处理:
判断第二节点更新心跳文件的事件是否正常;
在判断为不正常的情况下, 确定所述第二节点与网关的连接状态。
[权利要求 23] 根据权利要求 19-22中任一项所述的第一节点, 其特征在于, 所述处 理器在执行所述存储器上的可执行指令时使得所述第一节点还执行如 下处理:
在确定所述第二节点与所述网关连接失败的情况下, 获取锁文件以防 止所述网关下其余节点并行处理针对所述第二节点的服务请求。
PCT/CN2018/101021 2018-06-05 2018-08-17 节点异常处理方法及系统、设备和计算机可读存储介质 WO2019232931A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810577770.0 2018-06-05
CN201810577770.0A CN108964977B (zh) 2018-06-05 2018-06-05 节点异常处理方法及系统,存储介质和电子设备

Publications (1)

Publication Number Publication Date
WO2019232931A1 true WO2019232931A1 (zh) 2019-12-12

Family

ID=64493457

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/101021 WO2019232931A1 (zh) 2018-06-05 2018-08-17 节点异常处理方法及系统、设备和计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN108964977B (zh)
WO (1) WO2019232931A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113572683B (zh) * 2020-04-29 2023-07-04 腾讯科技(深圳)有限公司 数据处理方法、装置、电子设备及存储介质
CN114422412B (zh) * 2020-10-13 2023-11-17 华为技术有限公司 一种设备检测方法、装置和通信设备
WO2022140961A1 (zh) * 2020-12-28 2022-07-07 西安大医集团股份有限公司 通信连接的监测方法、医疗系统、存储介质
CN115134219A (zh) * 2022-06-29 2022-09-30 北京飞讯数码科技有限公司 设备资源管理方法及装置、计算设备和存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050080895A1 (en) * 2003-10-14 2005-04-14 Cook Steven D. Remote activity monitoring
CN101217402A (zh) * 2008-01-15 2008-07-09 杭州华三通信技术有限公司 一种提高集群可靠性的方法和一种高可靠性通信节点
CN103209095A (zh) * 2013-03-13 2013-07-17 广东新支点技术服务有限公司 一种基于磁盘服务锁的裂脑预防的方法和装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101043354B (zh) * 2006-04-28 2010-05-12 华为技术有限公司 一种宽带通信设备上行保护方法及系统
CN101483555A (zh) * 2009-02-12 2009-07-15 浙江工商大学 双ForCES控制件实现冗余备份的方法
CN105991325B (zh) * 2015-02-10 2019-06-21 华为技术有限公司 处理至少一个分布式集群中的故障的方法、设备和系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050080895A1 (en) * 2003-10-14 2005-04-14 Cook Steven D. Remote activity monitoring
CN101217402A (zh) * 2008-01-15 2008-07-09 杭州华三通信技术有限公司 一种提高集群可靠性的方法和一种高可靠性通信节点
CN103209095A (zh) * 2013-03-13 2013-07-17 广东新支点技术服务有限公司 一种基于磁盘服务锁的裂脑预防的方法和装置

Also Published As

Publication number Publication date
CN108964977A (zh) 2018-12-07
CN108964977B (zh) 2021-06-01

Similar Documents

Publication Publication Date Title
US10999157B1 (en) Remote cloud-based monitoring of storage systems
WO2019232931A1 (zh) 节点异常处理方法及系统、设备和计算机可读存储介质
US8245077B2 (en) Failover method and computer system
US11249788B2 (en) Cloud management platform, and virtual machine management method and system
US9992058B2 (en) Redundant storage solution
US20170220431A1 (en) Failover of a database in a high-availability cluster
WO2021184587A1 (zh) 基于Prometheus的私有云监控方法、装置、计算机设备及存储介质
US20180241846A1 (en) Automated configuration support system
WO2018137520A1 (zh) 一种业务恢复方法及装置
WO2019019457A1 (zh) 控制中心装置、业务系统处理的方法、系统及存储介质
US8789072B2 (en) Distributed multi-system management
CN110881224B (zh) 一种网络长连接方法、装置、设备及存储介质
CN108847959B (zh) 服务器监控方法和服务器
US8819481B2 (en) Managing storage providers in a clustered appliance environment
CN111031126B (zh) 集群缓存共享方法、系统、设备及存储介质
CN105677589A (zh) 一种访问控制方法、装置及系统
WO2023124127A1 (zh) 一种主机与存储系统的通信连接方法、装置、设备及介质
CN112181942A (zh) 时序数据库系统和数据处理方法及装置
US11797334B1 (en) BMC parameter configuration and effect-taking method and apparatus, device, and medium
US11368413B2 (en) Inter-switch link identification and monitoring
CN112217718A (zh) 一种业务处理方法、装置、设备及存储介质
US9191267B2 (en) Device management for determining the effects of management actions
US8726069B2 (en) Highly available file system in a directly attached storage
CN113206760B (zh) 用于vrf资源分配的接口配置更新方法、装置与电子设备
CN111416721A (zh) 运用于数据中心的机柜异常状态的远端排除方法

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: 18921653

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: 18921653

Country of ref document: EP

Kind code of ref document: A1