WO2014000545A1 - 一种主备切换条件更新方法、装置、服务器及系统 - Google Patents

一种主备切换条件更新方法、装置、服务器及系统 Download PDF

Info

Publication number
WO2014000545A1
WO2014000545A1 PCT/CN2013/076299 CN2013076299W WO2014000545A1 WO 2014000545 A1 WO2014000545 A1 WO 2014000545A1 CN 2013076299 W CN2013076299 W CN 2013076299W WO 2014000545 A1 WO2014000545 A1 WO 2014000545A1
Authority
WO
WIPO (PCT)
Prior art keywords
active
switching condition
standby
update
standby switching
Prior art date
Application number
PCT/CN2013/076299
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 WO2014000545A1 publication Critical patent/WO2014000545A1/zh

Links

Classifications

    • 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 invention relates to the field of communications technologies, and in particular, to a method, an apparatus, a server, and a system for updating active/standby switching conditions.
  • the active/standby switchover condition needs to be set in advance, and then the primary server performs functions such as data transmission and management. After the active/standby switchover condition is met, the master/slave server is switched. The standby server is caused to perform various functions.
  • the factors of switching may be different. That is to say, in different application environments, the factors affecting the active/standby switchover may not be the same. Even in the same operating environment, when running to different stages, the factors affecting the active/standby switchover are also Not the same. Therefore, different active/standby switching conditions need to be set in different application scenarios.
  • an object of the present invention is to provide a method for updating an active/standby switching condition, which solves the problem that it must be stopped when updating the active/standby switching condition existing in the prior art.
  • the method for updating the active/standby switching conditions disclosed by the present invention comprises two steps:
  • Receiving an active/standby switching condition update instruction where the type of the update instruction includes: updating a priority instruction, adding a switching condition instruction, or deleting a switching condition instruction;
  • the polling operation for determining whether to perform the active/standby switching is locked, and the active/standby switching conditions set in the dynamically editable database are updated according to the update instruction.
  • the method for updating the active/standby switching condition further includes: setting a dynamically editable database to store an active/standby switching condition, wherein a dynamically editable database stores an active/standby switching condition, and each dynamically editable database provides an externally called Interface
  • the updating the active/standby switching conditions in the dynamic editable database includes: determining, according to the update instruction, an active/standby switching condition to be updated, and the dynamic editable database corresponding to the active/standby switching condition to be updated
  • the external call interface is updated to update the active/standby switchover conditions to be updated.
  • the step of updating the active/standby switchover condition to be updated includes:
  • the step of updating the active/standby handover condition to be updated includes: setting an active/standby switch to be added according to the increasing handover condition instruction Dynamically editable database corresponding to the condition, and adding an active/standby switching condition corresponding to the increased switching condition instruction in the set dynamic editable database, and updating priority information corresponding to each active/standby switching condition;
  • the step of updating the active/standby switch condition to be updated includes: canceling the active/standby switch to be deleted according to the deleting the switch condition instruction Dynamically editable database corresponding to the condition;
  • the method further includes the step of: sending the updated configuration information to the alternate server.
  • the present invention discloses an apparatus for updating active/standby switching conditions, including:
  • a receiving port configured to receive an active/standby switching condition update instruction, where the type of the update instruction includes: updating a priority instruction, adding a switching condition instruction, and deleting a switching condition instruction;
  • An operation execution module configured to: after receiving the receiving active/standby switching condition update instruction transmitted by the receiving port, lock a polling operation for determining whether to perform an active/standby switching, and update the setting to the dynamic according to the update instruction Edit the active and standby switching conditions in the database.
  • the active/standby switching condition updating apparatus further includes:
  • a setting module configured to set a dynamic editable database to store an active/standby switching condition, wherein a dynamically editable database stores an active/standby switching condition, and each of the dynamically editable databases provides an externally called interface;
  • the specific operation is: determining the active/standby switching condition to be updated according to the update instruction, and performing the active/standby switching to be updated.
  • the external call interface of the dynamic editable database corresponding to the condition updates the active/standby switchover condition to be updated.
  • the operation execution module includes: a locking submodule, configured to lock a polling operation for determining whether to perform an active/standby switchover after receiving the active/standby switching condition update command transmitted by the receiving port;
  • an update submodule configured to update an active/standby switchover condition set in the dynamically editable database according to the update instruction.
  • the update submodule includes: a priority update unit, configured to update, according to the update priority instruction, priority information corresponding to the active/standby switchover condition to be updated, and in the dynamic editable database corresponding to the active/standby switchover condition to be updated And storing the updated configuration information including the priority of the active/standby switchover and the corresponding priority;
  • the first determining unit is configured to determine whether another update command is received after the priority update unit ends the operation, and if not, unlock the polling operation, and if yes, continue to perform the corresponding update operation.
  • the update submodule includes:
  • a switching condition adding unit configured to set a dynamic editable database corresponding to the active/standby switching condition to be added according to the increasing switching condition instruction, and add a corresponding to the increasing switching condition instruction in the set dynamic editable database
  • the active/standby switchover conditions are updated, and the priority information corresponding to each active/standby switchover condition is updated accordingly;
  • the second determining unit is configured to determine whether another update command is received after the switching condition increasing unit ends the operation, and if not, unlock the polling operation, and if yes, continue to perform the corresponding update operation.
  • the update submodule includes:
  • a switching condition deletion unit configured to log out the dynamic editable database corresponding to the active/standby switching condition to be deleted according to the deleting the switching condition instruction
  • the third determining unit is configured to determine whether another update command is received after the switching condition deleting unit ends the operation, and if not, unlock the polling operation, and if yes, continue to perform the corresponding update operation.
  • the active/standby switching condition updating apparatus further includes:
  • the present invention also discloses a server, wherein the server is provided with an active/standby switching condition updating device disclosed in the present solution.
  • the present invention also discloses an active/standby switching system, which includes a server in an active state, a device provided with an active/standby switching condition updating device, and a server in a standby state.
  • the active/standby switching condition is set.
  • the dynamic link library can be dynamically loaded during the running of the program, so that no downtime is required, and the primary server is running.
  • the update of the switching condition can be realized. In this process, since the primary server is always running, the continuity of the work is ensured.
  • FIG. 1 is a schematic structural diagram of an active/standby switching condition updating method according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a working process of an active/standby switching condition updating method according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of a workflow for updating priorities in an active/standby switching condition update method according to an embodiment of the present disclosure
  • FIG. 4 is a schematic diagram of a workflow for adding an active/standby switchover condition in an active/standby switchover condition update method according to an embodiment of the present disclosure
  • FIG. 5 is a schematic diagram of a workflow for deleting an active/standby switchover condition in an active/standby switchover condition update method according to an embodiment of the present disclosure
  • FIG. 6 is a schematic diagram of a working process of a polling operation in an active/standby switching condition updating method according to an embodiment of the present disclosure
  • FIG. 7 is a schematic structural diagram of an apparatus for updating an active/standby switching condition according to an embodiment of the present invention
  • FIG. 8 is a schematic structural diagram of another apparatus for updating an active/standby switching condition according to an embodiment of the present invention
  • FIG. 10 is a schematic structural diagram of an update submodule in an active/standby switching condition updating apparatus according to an embodiment of the present disclosure
  • FIG. 11 is a schematic structural diagram of an update submodule in another active/standby switching condition updating apparatus according to an embodiment of the present disclosure
  • FIG. 12 is a schematic structural diagram of an update submodule in another active/standby switching condition updating apparatus according to an embodiment of the present disclosure
  • FIG. 13 is a schematic structural diagram of still another apparatus for updating an active/standby switching condition according to an embodiment of the present invention.
  • the invention discloses a method for updating the active/standby switching conditions, so as to solve the problem that the existing active/standby switching must be stopped when the active/standby switching exists in the prior art.
  • Figure 1 discloses a physical architecture diagram.
  • the Baseboard Management Controller is a system on a server that monitors and manages the server.
  • the Service Processor is used to manage the BMC in a unified manner. Because the SP is a unified administrator, it plays an extremely important role in the normal operation of the server. Therefore, the active and standby "1+1" scheme is adopted, that is, the two servers are equipped at the same time, and the primary server is in the active state. The standby server is in standby state to increase the reliability of the server work.
  • the SP and the BMC are connected to the LAN switch, and the SP and the BMC are connected to the LAN switch through a network cable, and information is exchanged. At the same time, the active and standby SPs are also connected by a network cable for information interaction.
  • Step S1 receiving an active/standby switching condition update instruction, where the active/standby switching condition update instruction is different according to a staff member requirement.
  • the type of the update instruction includes: updating a priority instruction, and adding a switching condition instruction. Or delete the switching condition instruction;
  • Step S2 Locking a polling operation for determining whether to perform an active/standby switchover, and updating an active/standby switching condition set in the dynamically editable database according to the update instruction.
  • the method for updating the active/standby switching conditions disclosed in the solution further includes:
  • the updating the active/standby switching conditions in the dynamic editable database includes: determining, according to the update instruction, an active/standby switching condition to be updated, and the dynamic editable database corresponding to the active/standby switching condition to be updated
  • the external call interface is updated to update the active/standby switchover conditions to be updated.
  • the dynamically editable database is generally implemented in the form of a dynamic link library (DLL).
  • DLL dynamic link library
  • the dynamic link library is a library containing code and data that can be used by multiple programs at the same time, and can be dynamically loaded. After the ordinary code is compiled, it needs to be compiled and run before it can be used. This process requires server downtime. In the process of dynamically loading the dynamic link library, the server can continue to run without server downtime, so no downtime is required when updating the active/standby switchover conditions set in the dynamic link library.
  • the active/standby switching condition is set in advance in the form of a dynamic link library, where each active/standby switching condition is multiple
  • the switching condition corresponds to a dynamic link library, and the priority corresponding to each active/standby switching condition is preset.
  • the dynamic link library can be dynamically loaded during the running of the program, so that no downtime is required, and the active/standby switchover can be implemented during the running of the active server.
  • the condition is modified, and after the update, the polling operation continues. In this process, the primary server is always running, ensuring continuity of work.
  • the polling operation refers to the state in which the primary server verbally queries the status of the primary server relative to the active/standby switching condition, and receives the standby server to query the standby server relative to the primary and secondary devices. After the status of the condition is switched, the status is sent to the primary server, and whether the primary/secondary switching condition is met is determined according to the status of the two. If the primary/standby switching condition is met, the active/standby switching is performed. During the process of updating the active/standby switchover conditions, the polling operation needs to be locked, but the primary server and the standby server can continue to perform other operations to ensure the continuity of the server work.
  • the active/standby switching condition is at least one, such as “heartbeat detection”, “hardware failure detection”, “CPU occupancy detection”, and “working time length detection”, etc., in the active/standby switching condition is two More than one, according to its importance to the server, set the corresponding priority.
  • the heartbeat signal is an indispensable handover judgment condition in the active/standby system. Therefore, the "heartbeat detection” is generally used as the handover condition with the highest priority, and the primary server is preferentially detected whether there is a heartbeat and is detected. After the primary server stops the heartbeat, the primary and secondary servers are switched.
  • each active/standby switching condition exists in the form of a dynamic link library.
  • an implementation of the dynamic link library is as follows: int read(void* data); int compare(void* my_data, void* other_ data);
  • the function of the read function is to read out the state of the server that invokes the dynamic link library corresponding to the active/standby switching condition. For example, for the "hardware failure detection” condition, it can read the server that calls the active and standby dynamic link library. The severity level of the fault generated by the current hardware, and for the "CPU occupancy rate detection” condition, the server that calls the active and standby dynamic link library can be read, and the current CPU occupancy rate is. When the read is successful, the standby server sends the read status to the primary server.
  • the compare function provides a comparison function, and the comparison function is generally executed by the primary server to compare the read status of the primary server and the standby server corresponding to the active/standby switching condition, and return the comparison result to The primary server.
  • the active/standby switching condition is set in the form of the above dynamic link library.
  • the switching condition When the switching condition is updated, it does not need to be re-encoded, compiled, and run, so that no downtime is required during the update process, and the continuity of the server operation is ensured.
  • the step of updating the active/standby switching condition to be updated includes: corresponding priority information, and storing an update in a dynamically editable database corresponding to the active/standby switching condition to be updated
  • the following configuration information including the priority of the active/standby switchover and its corresponding priority
  • Step S12 determining whether another update instruction is received, and if yes, continuing to perform the corresponding update operation, and if not, performing the operation of step S13;
  • Step S13 Unlock the polling operation.
  • step S11 to step S13 the priority of the active/standby switching conditions can be updated, thereby adjusting the polling order of the respective active/standby switching conditions.
  • the step of updating the active/standby handover condition to be updated includes:
  • Step S21 Set a dynamic editable database corresponding to the active/standby switching condition to be added according to the adding the switching condition instruction, and add an active/standby switch corresponding to the increased switching condition instruction in the set dynamic editable database.
  • Condition correspondingly update the priority information corresponding to each active/standby switching condition;
  • Step S22 determining whether another update instruction is received, and if yes, continuing to perform the corresponding update operation, and if not, performing the operation of step S23;
  • Step S23 releasing the locking of the polling operation.
  • the step of updating the active/standby switchover condition to be updated includes:
  • Step S31 canceling the dynamic editable database corresponding to the active/standby switching condition to be deleted according to the deleting the switching condition instruction;
  • Step S32 determining whether another update instruction is received, and if yes, continuing to perform the corresponding update operation, and if not, performing the operation of step S33;
  • Step S33 Unlock the polling operation.
  • the method further includes the step of: sending the updated configuration information.
  • the configuration information includes: an active/standby switchover condition set in the dynamically editable database, and a priority corresponding to the active/standby switchover condition.
  • the active/standby switchover condition has only one, the configuration is performed. In the message, it is not necessary to include priority information.
  • the workflow of the polling operation is shown in FIG. 6, and specifically includes the following steps:
  • the current switching condition is determined.
  • the active/standby switching condition is the current switching condition. If there are multiple, the priority of the active/standby switching condition needs to be determined according to the priority of the active/standby switching condition.
  • the switching condition is determined by determining whether the priority corresponding to the current switching condition is the lowest. If not, it indicates that there are other switching conditions with lower priority. If the polling operation of the round does not end, the priority is determined only once.
  • the switching condition of the current switching condition is a current switching condition. If yes, it indicates that the current switching condition has the lowest priority, the polling operation of the round ends, and a new round of polling operation needs to be started, then it is determined.
  • the highest priority switching condition is the current switching condition.
  • Step S42 querying the status of the primary server corresponding to the current switching condition; for example, for the active/standby switching condition of "heartbeat detection", it is required to query whether the primary server has a heartbeat; for the "hardware failure detection” condition, The query obtains the severity level of the fault generated by the current hardware of the primary server; and for the "CPU occupancy detection” condition, the query needs to obtain the current CPU occupancy rate of the primary server;
  • Step S43 Send the identifier of the current switching condition to the standby server, so that the standby server queries the state corresponding to the current switching condition, and the manner in which the standby server queries the state corresponding to the current switching condition, and the manner
  • the primary server works in the same manner.
  • the secondary server queries the state corresponding to the current switching condition, it sends the status to the primary server.
  • the identifier may be Switching the priority identifier associated with the condition, for example, setting the priority identifier "1" for the highest priority switching condition, and so on, or setting other identifiers;
  • Step S44 Receive a state corresponding to the current switching condition sent by the standby server, and determine, according to a status of the primary server and the standby server corresponding to the current switching condition, whether the current status is met. Switching condition, if yes, performing the operation of step S45, if If no, return to the operation of step S41;
  • Step S45 Determine to perform an active/standby switchover.
  • the current switching condition is "heartbeat detection”
  • the primary server needs to have a heartbeat signal, and then the active/standby switchover is not performed
  • the current handover condition is "hardware failure detection”
  • the master/slave switchover is performed.
  • the master/slave switchover condition of the "CPU occupancy rate detection” is slightly more complicated when judging. First, it is necessary to determine whether the CPU usage of the active server is in a reasonable state, for example, the primary use.
  • the CPU usage of the server is 20%, and the backup server is 18%, both of which are in a reasonable state. In this case, even if the CPU usage of the primary server is relatively high, it is not considered to satisfy the requirement.
  • Current switching condition to perform active/standby switching if both are in a higher state, for example greater than 80%, The current CPU usage of the standby server is relatively low, then it is necessary to evaluate the CPU usage rate after the standby server is upgraded to the primary server, and will not be lower than itself, if the standby server is up. After the primary server is used, the CPU usage is still lower than that of the current primary server. If the current switching condition is met, the active/standby switchover needs to be performed.
  • the active server and the standby server can perform the switching between the active and standby devices to meet the requirements of the current application scenario.
  • the method for updating the active/standby switching condition disclosed by the present invention uses the method of setting the switching condition in the dynamic link library, and the dynamic link library can be dynamically loaded during the running of the program, so that the device can be updated without stopping the machine. Switching conditions ensure the continuity of the server work.
  • the present invention also discloses a method for updating the active/standby switching conditions, which is mainly applied to the standby server, and specifically includes the following steps:
  • the standby server may be configured to query the state corresponding to the current switching condition, and send the status to the primary server, so that the primary server performs a polling operation to determine whether An active/standby switchover is required.
  • the present invention also discloses an active/standby switching condition updating apparatus, where the active/standby switching condition updating apparatus includes: a receiving port 1 and an operation executing module 2, wherein:
  • the receiving port 1 is configured to receive an active/standby switching condition update instruction, where the type of the update instruction includes: updating a priority instruction, adding a switching condition instruction, and deleting a switching condition instruction;
  • the operation execution module 2 is configured to: after receiving the receiving active/standby switching condition update instruction transmitted by the receiving port, lock a polling operation for determining whether to perform an active/standby switching, and update according to the update instruction Active/standby switching conditions set in a dynamically editable database.
  • the active/standby switching condition updating apparatus further includes: a setting module 3, configured to set a dynamic editable database to store an active/standby switching condition, wherein a dynamically editable database stores a master A switch condition is provided, each of the dynamically editable databases providing an externally called interface.
  • a setting module 3 configured to set a dynamic editable database to store an active/standby switching condition, wherein a dynamically editable database stores a master A switch condition is provided, each of the dynamically editable databases providing an externally called interface.
  • the specific operation is: determining, according to the update instruction, the active/standby switching conditions to be updated, by using the to-be-updated
  • the external call interface of the dynamic editable database corresponding to the active/standby switchover condition updates the active/standby switchover condition to be updated.
  • the operation execution module 2 includes: a locking submodule 21 and an update submodule 22, wherein
  • the locking sub-module 21 is configured to: after receiving the active/standby switching condition update command transmitted by the receiving port 1, lock a polling operation for determining whether to perform an active/standby switching;
  • the update submodule 22 is configured to update the active/standby switching conditions set in the dynamic editable database according to the update instruction.
  • the update submodule 22 includes a priority. New unit 221 and first determining unit 222,
  • the priority updating unit 221 is configured to update, according to the update priority instruction, priority information corresponding to the active/standby switching condition to be updated, and the dynamic corresponding to the active/standby switching condition to be updated In the edit database, the updated configuration information including the priority of the active/standby switchover and the corresponding priority is stored;
  • the first determining unit 222 is configured to: after the priority updating unit ends the operation, determine whether another update instruction is received, and if not, release the locking of the polling operation, and if yes, continue to perform the corresponding update. operating.
  • the update submodule 22 includes: a switching condition adding unit 223 and a second determining unit 224, where
  • the switching condition adding unit 223 is configured to set a dynamic editable database corresponding to the active/standby switching condition to be added according to the increasing switching condition instruction, and add and increase the switching condition in the set dynamic editable database.
  • the active/standby switching conditions corresponding to the instruction are updated, and the priority information corresponding to each active/standby switching condition is updated accordingly;
  • the second determining unit 224 is configured to determine whether another update command is received after the switching condition increasing unit ends the operation, and if not, unlock the polling operation, and if yes, continue to perform the corresponding update. operating.
  • the update submodule 22 includes: a switching condition deleting unit 225 and a third determining unit 226, where
  • the switching condition deleting unit 225 is configured to, according to the deleting the switching condition instruction, cancel the dynamic editable database corresponding to the active/standby switching condition to be deleted;
  • the third determining unit 226 is configured to determine whether another update command is received after the switching condition deleting unit ends the operation, and if not, unlock the polling operation, and if yes, continue to perform the corresponding update. operating.
  • the first determining unit 222, the second determining unit 224, and the third determining unit 226 may be the same determining unit or different determining units.
  • the active/standby switching condition updating apparatus further includes: a sending port 4, and the sending port 4 is configured to send the updated configuration information to the standby server.
  • the active/standby switching condition updating device disclosed in the present invention uses a method of setting a switching condition in a dynamic link library, and the dynamic link library can be dynamically loaded during the running of the program, so that the device can be updated without stopping the machine. Switching conditions ensure the continuity of the server work.
  • the present invention also discloses a server, wherein the active/standby switching condition updating device is disposed in the server, where the active/standby switching condition updating device includes: a receiving port 1 and an operation executing module 2, Includes setup module 3 and transmit port 4.
  • the present invention also discloses an active/standby switching system, which includes: a server in an active state and a server in a standby state, wherein the server in the active state is provided with the active and standby devices disclosed in the present solution. Switch the condition update device.
  • the active/standby switching condition updating apparatus disclosed above sets the active/standby switching condition in the form of a dynamic link library in advance, and when the active/standby switching condition needs to be updated, the dynamic link library can be dynamically updated during the running of the program.
  • the loading so that no downtime is required, during the running of the primary server, the update of the switching condition can be realized. In this process, since the primary server is always running, the continuity of the work is ensured.
  • the disclosed systems, devices, and methods may be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, It can be electrical, mechanical or other form.
  • the components displayed by the unit may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the functions, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including
  • the instructions are used to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like, which can store program codes. .

Landscapes

  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Hardware Redundancy (AREA)

Abstract

本发明涉及通信技术领域,公开了一种主备切换条件更新方法及相应的装置,及基于该装置的主备切换系统,在所述主备切换条件更新方法中,首先接收主备切换条件更新指令,然后锁定用于确定是否进行主备切换的轮询操作,并根据所述更新指令,更新设置于动态可编辑数据库内的主备切换条件。以上所公开的主备切换条件更新方法及对应的装置,预先以动态链接库的形式,设置了主备切换条件,当需要对所述主备切换条件进行更新时,由于动态链接库可以在程序运行过程中动态的加载,从而不需要停机,在主用服务器运行的过程中,就能实现对所述切换条件的更新,在这个过程中,由于所述主用服务器一直在运行,保证了工作的连续性。

Description

一种主备切换条件更新方法、 装置、 服务器及系统
技术领域 本发明涉及通信技术领域,特别是涉及一种主备切换条件更新方法、装置、 服务器及系统。
背景技术 当网络管理手段为带内管理时, 最大的缺陷是当网络出现故障中断时,数 据传输和管理都无法正常进行。 随着小型机领域的技术发展, 为了克服上述缺 陷, 带外管理系统已经成为整个系统中一个不可或缺的组成部分, 例如, 为了 保证管理系统的可用性、 安全性, 目前管理服务器大都釆用了主备 "1+1" 的 备份方案。
在现有的备份方案中, 需要预先设定主备切换条件, 然后由主用服务器执 行数据的传输和管理等功能, 当满足所述主备切换条件后,再执行主备服务器 的切换, 以使所述备用服务器执行各项功能。
但是,发明人在本申请的研究过程中发现,诸多的软硬件因素都可能影响 到主备的切换, 而管理服务器在众多的应用环境中都有应用,在不同的应用环 境中, 影响主备切换的因素会存在差异, 也就是说, 在不同的应用环境下, 影 响主备切换的因素可能并不相同,甚至在相同的运行环境下,运行到不同阶段 时, 影响主备切换的因素也不相同。 因此, 在不同的应用场景下, 需要设定不 同的主备切换条件。 但是, 在现有技术中, 如果出现需要更新主备切换条件的 情况, 需要停机后才能修改源程序的代码以及配置文件中的定义, 并在开机重 新运行后,修改后的主备切换条件才能生效,从而造成了管理服务器工作的中 断, 影响服务器的工作。 发明内容 有鉴于此, 本发明的目的在于提供一种主备切换条件更新方法, 以解决现 有技术中存在的, 在更新主备切换条件时, 必须停机的问题。
本发明公开的主备切换条件更新方法, 包括两个步骤:
接收主备切换条件更新指令,所述更新指令的类型包括:更新优先级指令、 增加切换条件指令或删除切换条件指令;
锁定用于确定是否进行主备切换的轮询操作, 并根据所述更新指令, 更 新设置于动态可编辑数据库内的主备切换条件。
另外, 所述主备切换条件更新方法还包括: 设置动态可编辑数据库以存 储主备切换条件, 其中, 一个动态可编辑数据库存储一个主备切换条件, 每一 个动态可编辑数据库提供一个对外调用的接口;
则, 所述更新设置于动态可编辑数据库内的主备切换条件包括: 根据所述更新指令确定待更新的主备切换条件,通过所述待更新的主备切 换条件所对应的动态可编辑数据库的对外调用接口,更新所述待更新的主备切 换条件。
在第一种实现方式中, 当所述更新指令的类型为更新优先级指令时, 更新 所述待更新的主备切换条件步骤包括:
根据所述更新优先级指令相应更新与待更新的主备切换条件相对应的优 先级信息, 并在所述待更新的主备切换条件所对应的动态可编辑数据库中,存 储更新后的包含主备切换条件与其对应的优先级的配置信息;
判断是否接收到其他更新指令,若否,解除对所述轮询操作的锁定,若是, 则继续执行相应的更新操作。
在第二种实现方式中, 当所述更新指令的类型为增加切换条件指令时, 更 新所述待更新的主备切换条件步骤包括: 根据所述增加切换条件指令,设置待 增加的主备切换条件所对应的动态可编辑数据库,并在设置的动态可编辑数据 库中增加与所述增加切换条件指令相对应的主备切换条件 ,相应更新各主备切 换条件对应的优先级信息;
判断是否接收到其他更新指令,若否,解除对所述轮询操作的锁定,若是, 则继续执行相应的更新操作。
在第三种实现方式中, 当所述更新指令的类型为删除切换条件指令时, 更 新所述待更新的主备切换条件步骤包括: 根据所述删除切换条件指令, 注销待 删除的主备切换条件所对应的动态可编辑数据库;
判断是否接收到其他更新指令,若否,解除对所述轮询操作的锁定,若是, 则继续执行相应的更新操作。
在更新操作完成后, 本方法还包括步骤: 将更新后的配置信息发送至备用 服务器。
相应的, 本发明公开了一种主备切换条件更新装置, 包括:
接收端口, 用于接收主备切换条件更新指令, 所述更新指令的类型包括: 更新优先级指令、 增加切换条件指令和删除切换条件指令;
操作执行模块,用于接收到所述接收端口传输的所述接收主备切换条件更 新指令后 ,锁定用于确定是否进行主备切换的轮询操作 ,并根据所述更新指令, 更新设置于动态可编辑数据库内的主备切换条件。
另外, 所述主备切换条件更新装置还包括:
设置模块, 用于设置动态可编辑数据库以存储主备切换条件, 其中, 一个 动态可编辑数据库存储一个主备切换条件,所述每一个动态可编辑数据库提供 一个对外调用的接口;
则,所述操作执行模块在更新设置于动态可编辑数据库内的主备切换条件 时, 具体操作为: 根据所述更新指令确定待更新的主备切换条件, 通过所述待 更新的主备切换条件所对应的动态可编辑数据库的对外调用接口,更新所述待 更新的主备切换条件。
其中, 所述操作执行模块包括: 锁定子模块, 用于在接收到所述接收端 口传输的所述主备切换条件更新指令后 ,锁定用于确定是否进行主备切换的轮 询操作;
更新子模块, 用于根据所述更新指令, 更新设置于动态可编辑数据库内的 主备切换条件。
在第一种实现方式中, 所述更新子模块包括: 优先级更新单元, 用于根据所述更新优先级指令相应更新与待更新的主 备切换条件相对应的优先级信息,并在所述待更新的主备切换条件所对应的动 态可编辑数据库中 ,存储更新后的包含主备切换条件与其对应的优先级的配置 信息;
第一判断单元, 用于在所述优先级更新单元结束操作后, 判断是否接收到 其他更新指令, 若否, 解除对所述轮询操作的锁定, 若是, 则继续执行相应的 更新操作。
在第二种实现方式中, 所述更新子模块包括:
切换条件增加单元, 用于根据所述增加切换条件指令, 设置待增加的主备 切换条件所对应的动态可编辑数据库 ,并在设置的动态可编辑数据库中增加与 所述增加切换条件指令相对应的主备切换条件,相应更新各主备切换条件对应 的优先级信息;
第二判断单元, 用于在所述切换条件增加单元结束操作后, 判断是否接收 到其他更新指令, 若否, 解除对所述轮询操作的锁定, 若是, 则继续执行相应 的更新操作。
在第三种实现方式中, 所述更新子模块包括:
切换条件删除单元, 用于根据所述删除切换条件指令, 注销待删除的主 备切换条件所对应的动态可编辑数据库;
第三判断单元, 用于在所述切换条件删除单元结束操作后, 判断是否接收 到其他更新指令, 若否, 解除对所述轮询操作的锁定, 若是, 则继续执行相应 的更新操作。
另外, 所述主备切换条件更新装置还包括:
发送端口, 用于将更新后的配置信息发送至备用服务器。
相应的, 本发明还公开了一种服务器, 所述服务器中设置有本方案所公开 的主备切换条件更新装置。
相应的, 本发明还公开了一种主备切换系统, 包括处于主用状态的, 设置 有主备切换条件更新装置的服务器, 和处于备用状态的服务器。
以上所公开的主备切换条件更新方法及对应的装置,预先以动态链接库的 形式, 设置了主备切换条件, 当需要对所述主备切换条件进行更新时, 由于动 态链接库可以在程序运行过程中动态的加载,从而不需要停机,在主用服务器 运行的过程中, 就能实现对所述切换条件的更新, 在这个过程中, 由于所述主 用服务器一直在运行, 保证了工作的连续性。
附图说明 为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施 例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地, 下面描述 中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲, 在不付 出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 1为本发明实施例公开的一种主备切换条件更新方法的实体架构图; 图 2 为本发明实施例公开的一种主备切换条件更新方法的工作流程示意 图;
图 3 为本发明实施例公开的一种主备切换条件更新方法中更新优先级的 工作流程示意图;
图 4 为本发明实施例公开的一种主备切换条件更新方法中增加主备切换 条件的工作流程示意图;
图 5 为本发明实施例公开的一种主备切换条件更新方法中删除主备切换 条件的工作流程示意图;
图 6 为本发明实施例公开的一种主备切换条件更新方法中轮询操作的工 作流程示意图;
图 7为本发明实施例公开的一种主备切换条件更新装置的结构示意图; 图 8为本发明实施例公开的又一种主备切换条件更新装置的结构示意图; 图 9 为本发明实施例公开的一种主备切换条件更新装置中操作执行模块 的结构示意图;
图 10为本发明实施例公开的一种主备切换条件更新装置中更新子模块的 结构示意图; 图 11为本发明实施例公开的又一种主备切换条件更新装置中更新子模块 的结构示意图;
图 12为本发明实施例公开的又一种主备切换条件更新装置中更新子模块 的结构示意图;
图 13 为本发明实施例公开的又一种主备切换条件更新装置的结构示意 图。
具体实施方式 下面将结合本发明实施例中的附图 ,对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是 全部的实施例。基于本发明中的实施例, 本领域普通技术人员在没有作出创造 性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。
本发明公开了一种主备切换条件更新方法, 以解决现有技术中存在的, 更 新主备切换的时候必须停机的问题。 其中, 图 1公开了一种实体架构图。
其中, 基板管理控制器 (BMC, Baseboard Management Controller )是一 台服务器上的一个系统, 对服务器起到监控和管理的作用; 服务处理器(SP , Service Processor )用于对 BMC进行统一的管理, 因为 SP为统一的管理者, 对服务器的正常工作起到极为重要的作用, 因此釆用了主备 "1+1 " 的方案, 即同时配备两台服务器, 处于主用状态的为主用服务器, 处于备用状态的为备 用服务器, 以增加服务器工作的可靠性。 其中连接 SP和 BMC的, 为局域网 交换机 LAN Switch , 所述 SP和所述 BMC通过网线与所述 LAN Switch相连 接, 并进行信息的交互。 同时, 所述主备 SP之间也通过网线相连接, 以进行 信息的交互。
另外, 如果服务器内其他系统具有重要意义时, 也可以釆用主备 "1+1 " 的方案, 设置两台服务器, 进行主备切换, 以保障服务器工作的可靠性, 这种 情况下, 也可以釆用本方案公开的方式, 实现主备切换条件的更新。
其工作流程示意图如图 2所示, 主要针对主用服务器, 包括: 步骤 Sl、 接收主备切换条件更新指令, 其中所述主备切换条件更新指令 随工作人员需求的不同而不同, 具体来说, 所述更新指令的类型包括: 更新优 先级指令、 增加切换条件指令或删除切换条件指令;
步骤 S2、 锁定用于确定是否进行主备切换的轮询操作, 并根据所述更新 指令, 更新设置于动态可编辑数据库内的主备切换条件。
另外, 本方案所公开的主备切换条件更新方法还包括:
设置动态可编辑数据库以存储主备切换条件, 其中, 一个动态可编辑数 据库存储一个主备切换条件,所述每一个动态可编辑数据库提供一个对外调用 的接口;
则, 所述更新设置于动态可编辑数据库内的主备切换条件包括: 根据所述更新指令确定待更新的主备切换条件,通过所述待更新的主备切 换条件所对应的动态可编辑数据库的对外调用接口,更新所述待更新的主备切 换条件。
在本方案中, 动态可编辑数据库一般以动态链接库( DLL , Dynamic Link Library )的形式实现。 所述动态链接库是一个包含有可供多个程序同时使用的 代码和数据的库, 可进行动态的加载, 普通的代码在编写后, 需要编译、 运行 后才能使用, 这个过程需要服务器停机, 而所述动态链接库在动态加载的过程 中, 服务器可继续运行, 不需要服务器停机, 因而在更新设置于所述动态链接 库内的主备切换条件时, 不需要停机。
本方案所公开的主备切换条件更新方法,在具体实施时,预先以动态链接 库的形式, 设置了主备切换条件, 其中, 当所述主备切换条件为多个时, 每个 主备切换条件与一个动态链接库相对应,并预设各个主备切换条件相对应的优 先级。 当需要对所述主备切换条件进行更新时, 由于动态链接库可以在程序运 行过程中动态的加载, 从而不需要停机, 在主用服务器运行的过程中, 就能实 现对所述主备切换条件的修改, 并在更新后, 继续执行轮询操作。 在这个过程 中, 所述主用服务器一直在运行, 保证了工作的连续性。
所述轮询操作,指的是由所述主用服务器轮番查询所述主用服务器相对于 主备切换条件的状态 ,并接收备用服务器查询所述备用服务器相对于所述主备 切换条件的状态后,发送给所述主用服务器的状态, 并根据二者状态判断是否 满足主备切换条件, 并在满足所述主备切换条件的情况下, 执行主备切换。 在 更新主备切换条件的过程中, 需要锁定此轮询操作,但所述主用服务器和备用 服务器可以继续执行其他的操作, 以保证服务器工作的连续性。
具体来说, 所述主备切换条件至少为一个, 如 "心跳检测"、 "硬件故障检 测"、 " CPU占有率检测" 和 "工作时间长度检测" 等, 在所述主备切换条件 为两个以上时, 根据其对服务器的重要性, 设置相应的优先级。 其中, 心跳信 号在主备系统中是一个必不可少的切换判断条件, 因此, 一般将 "心跳检测" 作为具有最高优先级的切换条件,优先检测所述主用服务器是否有心跳, 并在 检测到所述主用服务器停止心跳后, 执行主备服务器的切换。 并且, 各个主备 切换条件以动态链接库的形式存在。
本方案中, 动态链接库的一个实施例如下: int read(void* data); int compare(void* my— data, void* other— data);
其中, read函数的作用是读取出调用该动态链接库的服务器对应于该主备 切换条件的状态, 例如对于 "硬件故障检测"条件, 它可以读取出调用该主备 动态链接库的服务器, 当前硬件产生的故障的严重等级, 而对于 "CPU占有率 检测"条件, 可以读取出调用该主备动态链接库的服务器, 当前的 CPU占有率 是多少。 当读取成功后, 所述备用服务器会将读取到的状态发送至所述主用服 务器。
compare函数就提供比较的功能, 一般由主用服务器执行该比较功能, 以 将读取出的,所述主用服务器与备用服务器对应于主备切换条件的状态进行比 较, 并将比较结果返回至所述主用服务器。
以上述动态链接库的形式设置所述主备切换条件, 在更新切换条件时, 不 需重新编码并编译、 运行, 因而在更新过程中不需要停机, 保证了服务器工作 的连续性。
具体实施时, 参见图 3所公开的工作流程示意图, 当所述更新指令的类型 为更新优先级指令时, 所述更新所述待更新的主备切换条件步骤包括: 对应的优先级信息,并在所述待更新的主备切换条件所对应的动态可编辑数据 库中, 存储更新后的包含主备切换条件与其对应的优先级的配置信息;
步骤 S12、 判断是否接收到其他更新指令, 若是, 则继续执行相应的更新 操作, 若否, 执行步骤 S13的操作;
步骤 S13、 解除对所述轮询操作的锁定。
通过步骤 S11至步骤 S13的操作,能够更新主备切换条件优先级,从而调整 各个主备切换条件的轮询次序。
参见图 4所示的工作流程示意图, 当所述更新指令的类型为增加切换条件 指令时, 所述更新所述待更新的主备切换条件步骤包括:
步骤 S21、 根据所述增加切换条件指令, 设置待增加的主备切换条件所对 应的动态可编辑数据库 ,并在设置的动态可编辑数据库中增加与所述增加切换 条件指令相对应的主备切换条件, 相应更新各主备切换条件对应的优先级信 息;
步骤 S22、 判断是否接收到其他更新指令, 若是, 则继续执行相应的更新 操作, 若否, 执行步骤 S23的操作;
步骤 S23、 解除对所述轮询操作的锁定。
通过上述步骤, 能够实现增加新的主备切换条件时的更新操作。
参见图 5所示的结构示意图, 当所述更新指令的类型为删除切换条件指令 时, 所述更新所述待更新的主备切换条件步骤包括:
步骤 S31、 根据所述删除切换条件指令, 注销待删除的主备切换条件所对 应的动态可编辑数据库;
步骤 S32、 判断是否接收到其他更新指令, 若是, 则继续执行相应的更新 操作, 若否, 执行步骤 S33的操作;
步骤 S33、 解除对所述轮询操作的锁定。
通过上述步骤, 能够实现删除新的主备切换条件时的更新操作。
特别的, 在更新操作执行完毕后, 还包括步骤: 将更新后的配置信息发送 至备用服务器,以便所述备用服务器中的配置信息保持和所述主用服务器的一 致, 便于轮询操作中, 根据所述主备切换条件查询相应的状态。 其中, 所述配 置信息包括: 设置于动态可编辑数据库内的主备切换条件, 以及与所述主备切 换条件相对应的优先级,当所述主备切换条件只有一个时,则所述配置信息中, 不必包含优先级信息。
其中, 所述轮询操作的工作流程参见图 6, 具体包括以下步骤:
步骤 S41、 确定当前切换条件; 当所述主备切换条件只有一个时, 该主备 切换条件即为当前切换条件,如有多个时, 则需要根据所述主备切换条件的优 先级确定当前切换条件, 具体方式为, 判断所述当前切换条件对应的优先级是 否最低, 如果否, 则说明存在其他优先级较低的切换条件, 该轮的轮询操作没 有结束, 则确定优先级仅次于所述当前切换条件的切换条件为当前切换条件, 如果是, 则说明所述当前切换条件对应的优先级最低, 该轮的轮询操作结束, 需开始新一轮的轮询操作, 则确定优先级最高的切换条件为当前切换条件。
步骤 S42、查询主用服务器与所述当前切换条件相对应的状态; 例如对于 "心跳检测" 的主备切换条件, 需要查询所述主用服务器是否具有心跳; 对于 "硬件故障检测"条件, 需要查询获取所述主用服务器当前硬件产生的故障的 严重等级; 而对于 "CPU 占有率检测" 条件, 需要查询获取所述主用服务器 当前的 CPU占有率是多少;
步骤 S43、将所述当前切换条件的标识发送至备用服务器, 以便所述备用 服务器查询与当前切换条件相对应的状态,所述备用服务器查询与当前切换条 件相对应的状态的方式, 与所述主用服务器的工作方式是相同的,在所述备用 服务器查询获取到与所述当前切换条件相对应的状态后,会将其发送至所述主 用服务器中; 其中, 所述标识可以为各个切换条件相关的优先级标识, 例如, 为优先级最高的切换条件设置优先级标识 "1" , 并以此类推, 或者设置其他的 标识;
步骤 S44、 接收所述备用服务器发送的与所述当前切换条件相对应的状 态 ,并根据所述主用服务器和所述备用服务器与所述当前切换条件相对应的状 态, 判断是否满足所述当前切换条件, 如果是, 则执行步骤 S45的操作, 如果 否, 则返回执行步骤 S41的操作;
步骤 S45、 确定执行主备切换。
其中, 不同的主备切换条件, 其具体判断的过程会有不同,
例如, 当所述当前切换条件为 "心跳检测" 时, 则只需要所述主用服务器 具有心跳信号,则不执行主备切换; 而当所述当前切换条件为 "硬件故障检测" 时,需要比较所述主用服务器的硬件故障的严重等级与备用服务器的硬件故障 的严重等级, 当所述主用服务器的硬件故障情况比所述备用服务器严重时, 则 说明满足所述当前切换条件, 需要执行主备切换; 而对于 "CPU占有率检测" 的主备切换条件, 在判断时会稍微复杂一点, 首先需要判断所述主用服务器的 CPU占有率是否处于一个比较合理的状态, 例如主用服务器的 CPU占用率是 20%, 而备用服务器的是 18%, 二者均处于较合理的状态, 这种情况下, 即使 所述主用服务器的 CPU占有率比较高, 也不认为满足所述当前切换条件, 以执 行主备切换, 而如果两者都位于一个较高的状态, 例如大于 80%, 而且所述备 用服务器目前的 CPU占用率比较低,那么接下来就要评估所述备用服务器升为 主用服务器后, CPU占用率会是多少, 还会不会比自己低, 如果所述备用服务 器升为主用服务器后, CPU占用率仍比当前的主用服务器低, 则认为满足所述 当前切换条件按, 需要执行主备切换。
通过步骤 S41到步骤 S45的操作公开的轮询操作的过程,可以使所述主用服 务器和备用服务器在满足主备切换的条件下,执行主备的切换, 以满足当前应 用场景的需求。
本发明所公开的主备切换条件更新方法,釆用将切换条件设置于动态链接 库中的方式, 动态链接库可以在程序运行过程中动态的加载,从而实现不停机 的情况下, 就能更新切换条件, 保证了服务器工作的连续性。
另夕卜, 本发明还公开了一种主备切换条件更新方法, 主要应用于备用服务 器, 具体包括步骤:
接收主用服务器发送的, 包含更新后的主备切换条件的配置信息,通过此 步骤, 可以使主用服务器中的配置信息和备用服务器中的配置信息保持一致; 接收所述主用服务器发送的当前切换条件的标识,并查询与所述当前切换 条件相对应的状态;
将所述当前切换条件对应的实施状态传输至所述主用服务器。
通过上述步骤,可以使所述备用服务器查询自身相对应于所述当前切换条 件的状态, 并将所述状态发送至所述主用服务器,便于所述主用服务器进行轮 询操作, 以判断是否需要执行主备切换。
相应的, 参见图 7所公开的结构示意图, 本发明还公开了一种主备切换条 件更新装置,所述主备切换条件更新装置包括:接收端口 1和操作执行模块 2 , 其中:
所述接收端口 1 , 用于接收主备切换条件更新指令, 所述更新指令的类型 包括: 更新优先级指令、 增加切换条件指令和删除切换条件指令;
所述操作执行模块 2, 用于接收到所述接收端口传输的所述接收主备切换 条件更新指令后, 锁定用于确定是否进行主备切换的轮询操作, 并根据所述更 新指令, 更新设置于动态可编辑数据库内的主备切换条件。
另外,参见图 8所公开的结构示意图,所述主备切换条件更新装置还包括: 设置模块 3 , 用于设置动态可编辑数据库以存储主备切换条件, 其中, 一 个动态可编辑数据库存储一个主备切换条件 ,所述每一个动态可编辑数据库提 供一个对外调用的接口。
这种情况下,所述操作执行模块 2在更新设置于动态可编辑数据库内的主 备切换条件时, 具体操作为: 根据所述更新指令确定待更新的主备切换条件, 通过所述待更新的主备切换条件所对应的动态可编辑数据库的对外调用接口, 更新所述待更新的主备切换条件。
具体来说, 参见图 9所示的结构示意图, 所述操作执行模块 2包括: 锁定 子模块 21和更新子模块 22 , 其中,
所述锁定子模块 21 , 用于在接收到所述接收端口 1传输的所述主备切换 条件更新指令后, 锁定用于确定是否进行主备切换的轮询操作;
所述更新子模块 22, 用于根据所述更新指令, 更新设置于动态可编辑数 据库内的主备切换条件。
其中, 参见图 10所公开的结构示意图, 所述更新子模块 22包括优先级更 新单元 221和第一判断单元 222,
所述优先级更新单元 221 , 用于根据所述更新优先级指令相应更新与待更 新的主备切换条件相对应的优先级信息,并在所述待更新的主备切换条件所对 应的动态可编辑数据库中,存储更新后的包含主备切换条件与其对应的优先级 的配置信息;
所述第一判断单元 222, 用于在所述优先级更新单元结束操作后, 判断是 否接收到其他更新指令, 若否, 解除对所述轮询操作的锁定, 若是, 则继续执 行相应的更新操作。
另外, 参见图 11所公开的结构示意图, 所述更新子模块 22包括: 切换条 件增加单元 223和第二判断单元 224 , 其中,
所述切换条件增加单元 223 , 用于根据所述增加切换条件指令, 设置待增 加的主备切换条件所对应的动态可编辑数据库 ,并在设置的动态可编辑数据库 中增加与所述增加切换条件指令相对应的主备切换条件,相应更新各主备切换 条件对应的优先级信息;
所述第二判断单元 224, 用于在所述切换条件增加单元结束操作后, 判断 是否接收到其他更新指令, 若否, 解除对所述轮询操作的锁定, 若是, 则继续 执行相应的更新操作。
另外, 参见图 12所公开的结构示意图, 所述更新子模块 22包括: 切换条 件删除单元 225和第三判断单元 226 , 其中,
所述切换条件删除单元 225 , 用于根据所述删除切换条件指令, 注销待删 除的主备切换条件所对应的动态可编辑数据库;
所述第三判断单元 226, 用于在所述切换条件删除单元结束操作后, 判断 是否接收到其他更新指令, 若否, 解除对所述轮询操作的锁定, 若是, 则继续 执行相应的更新操作。
其中, 所述第一判断单元 222、 第二判断单元 224和第三判断单元 226, 可以为同一判断单元, 也可以为不同的判断单元。
另外, 参见图 13所公开的结构示意图, 所述主备切换条件更新装置还包 括:发送端口 4 ,所述发送端口 4用于将更新后的配置信息发送至备用服务器。 本发明所公开的主备切换条件更新装置,釆用将切换条件设置于动态链接 库中的方式, 动态链接库可以在程序运行过程中动态的加载,从而实现不停机 的情况下, 就能更新切换条件, 保证了服务器工作的连续性。
相应的, 本发明还公开了一种服务器, 所述服务器内设置有所述主备切换 条件更新装置, 其中, 所述主备切换条件更新装置包括: 接收端口 1和操作执 行模块 2, 还可以包括设置模块 3和发送端口 4。
相应的, 本发明还公开了一种主备切换系统, 其特征在于, 包括: 处于主 用状态的服务器和处于备用状态的服务器,其中处于主用状态的服务器内设置 有本方案公开的主备切换条件更新装置。
以上所公开的主备切换条件更新装置,预先以动态链接库的形式,设置了 主备切换条件, 当需要对所述主备切换条件进行更新时, 由于动态链接库可以 在程序运行过程中动态的加载,从而不需要停机,在主用服务器运行的过程中, 就能实现对所述切换条件的更新,在这个过程中, 由于所述主用服务器一直在 运行, 保证了工作的连续性。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示 例的单元及算法步骤, 能够以电子硬件、或者计算机软件和电子硬件的结合来 实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用 和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现 所描述的功能, 但是这种实现不应认为超出本发明的范围。
所属领域的技术人员可以清楚地了解到, 为描述的方便和简洁, 上述描述 的系统、装置和单元的具体工作过程 ,可以参考前述方法实施例中的对应过程 , 在此不再赘述。
在本申请所提供的几个实施例中, 应该理解到, 所揭露的系统、 装置和方 法, 可以通过其它的方式实现。 例如, 以上所描述的装置实施例仅仅是示意性 的, 例如, 所述单元的划分, 仅仅为一种逻辑功能划分, 实际实现时可以有另 外的划分方式, 例如多个单元或组件可以结合或者可以集成到另一个系统, 或 一些特征可以忽略, 或不执行。 另一点, 所显示或讨论的相互之间的耦合或直 接耦合或通信连接可以是通过一些接口, 装置或单元的间接耦合或通信连接, 可以是电性, 机械或其它的形式。 单元显示的部件可以是或者也可以不是物理单元, 即可以位于一个地方, 或者 也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部 单元来实现本实施例方案的目的。
另外, 在本发明各个实施例中的各功能单元可以集成在一个处理单元中, 也可以是各个单元单独物理存在 ,也可以两个或两个以上单元集成在一个单元 中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用 时, 可以存储在一个计算机可读取存储介质中。 基于这样的理解, 本发明的技 术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以 以软件产品的形式体现出来, 该计算机软件产品存储在一个存储介质中, 包括 若干指令用以使得一台计算机设备(可以是个人计算机, 服务器, 或者网络设 备等)执行本发明各个实施例所述方法的全部或部分步骤。 而前述的存储介质 包括: U盘、 移动硬盘、 只读存储器(ROM, Read-Only Memory ), 随机存取 存储器(RAM, Random Access Memory ), 磁碟或者光盘等各种可以存储程序 代码的介质。
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本 发明。 对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见 的, 本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在 其它实施例中实现。 因此, 本发明将不会被限制于本文所示的这些实施例, 而 是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。

Claims

权利要求书
1、 一种主备切换条件更新方法, 其特征在于, 包括:
接收主备切换条件更新指令,所述更新指令的类型包括:更新优先级指令、 增加切换条件指令或删除切换条件指令;
锁定用于确定是否进行主备切换的轮询操作, 并根据所述更新指令, 更新 设置于动态可编辑数据库内的主备切换条件。
2、 根据权利要求 1所述的方法, 其特征在于, 所述方法还包括: 设置动态可编辑数据库以存储主备切换条件, 其中, 一个动态可编辑数据 库存储一个主备切换条件, 每一个动态可编辑数据库提供一个对外调用的接 口;
则, 所述更新设置于动态可编辑数据库内的主备切换条件包括:
根据所述更新指令确定待更新的主备切换条件,通过所述待更新的主备切 换条件所对应的动态可编辑数据库的对外调用接口,更新所述待更新的主备切 换条件。
3、 根据权利要求 2所述的方法, 其特征在于, 当所述更新指令的类型为 更新优先级指令时, 所述更新所述待更新的主备切换条件步骤包括:
根据所述更新优先级指令相应更新与待更新的主备切换条件相对应的优 先级信息, 并在所述待更新的主备切换条件所对应的动态可编辑数据库中,存 储更新后的包含主备切换条件与其对应的优先级的配置信息;
判断是否接收到其他更新指令,若否,解除对所述轮询操作的锁定,若是, 则继续执行相应的更新操作。
4、 根据权利要求 2所述的方法, 其特征在于, 当所述更新指令的类型为 增加切换条件指令时, 所述更新所述待更新的主备切换条件步骤包括:
根据所述增加切换条件指令,设置待增加的主备切换条件所对应的动态可 编辑数据库 ,并在设置的动态可编辑数据库中增加与所述增加切换条件指令相 对应的主备切换条件, 相应更新各主备切换条件对应的优先级信息;
判断是否接收到其他更新指令,若否,解除对所述轮询操作的锁定,若是, 则继续执行相应的更新操作。
5、 根据权利要求 2所述的方法, 其特征在于, 当所述更新指令的类型为 删除切换条件指令时, 所述更新所述待更新的主备切换条件步骤包括:
根据所述删除切换条件指令,注销待删除的主备切换条件所对应的动态可 编辑数据库;
判断是否接收到其他更新指令,若否,解除对所述轮询操作的锁定,若是, 则继续执行相应的更新操作。
6、 根据权利要求 1所述的方法, 其特征在于, 执行更新操作后, 还包括 步骤:
将更新后的配置信息发送至备用服务器。
7、 根据权利要求 1所述的方法, 其特征在于, 所述轮询操作包括: 1 )确定当前切换条件;
2 )查询主用服务器与所述当前切换条件相对应的状态;
3 )将所述当前切换条件的标识发送至备用服务器, 以便所述备用服务器 查询与当前切换条件相对应的状态;
4 )接收所述备用服务器发送的与所述当前切换条件相对应的状态, 并根 据所述主用服务器和备用服务器与所述当前切换条件相对应的状态 ,判断是否 满足所述当前切换条件, 如果满足, 确定执行主备切换, 如果不满足, 则返回 执行步骤 1 ) 的操作。
8、 一种主备切换条件更新装置, 其特征在于, 包括:
接收端口, 用于接收主备切换条件更新指令, 所述更新指令的类型包括: 更新优先级指令、 增加切换条件指令和删除切换条件指令;
操作执行模块,用于接收到所述接收端口传输的所述接收主备切换条件更 新指令后 ,锁定用于确定是否进行主备切换的轮询操作 ,并根据所述更新指令, 更新设置于动态可编辑数据库内的主备切换条件。
9、 根据权利要求 8所述的装置, 其特征在于, 所述主备切换条件更新装 置还包括:
设置模块, 用于设置动态可编辑数据库以存储主备切换条件, 其中, 一个 动态可编辑数据库存储一个主备切换条件,所述每一个动态可编辑数据库提供 一个对外调用的接口;
则,所述操作执行模块在更新设置于动态可编辑数据库内的主备切换条件 时, 具体操作为: 根据所述更新指令确定待更新的主备切换条件, 通过所述待 更新的主备切换条件所对应的动态可编辑数据库的对外调用接口,更新所述待 更新的主备切换条件。
10、 根据权利要求 8所述的装置, 其特征在于, 所述操作执行模块包括: 锁定子模块,用于在接收到所述接收端口传输的所述主备切换条件更新指 令后, 锁定用于确定是否进行主备切换的轮询操作;
更新子模块, 用于根据所述更新指令, 更新设置于动态可编辑数据库内的 主备切换条件。
11、 根据权利要求 10所述的装置, 其特征在于, 所述更新子模块包括: 切换条件相对应的优先级信息 ,并在所述待更新的主备切换条件所对应的动态 可编辑数据库中,存储更新后的包含主备切换条件与其对应的优先级的配置信 息;
第一判断单元, 用于在所述优先级更新单元结束操作后, 判断是否接收到 其他更新指令, 若否, 解除对所述轮询操作的锁定, 若是, 则继续执行相应的 更新操作。
12、 根据权利要求 10所述的装置, 其特征在于, 所述更新子模块包括: 切换条件增加单元, 用于根据所述增加切换条件指令,设置待增加的主备 切换条件所对应的动态可编辑数据库 ,并在设置的动态可编辑数据库中增加与 所述增加切换条件指令相对应的主备切换条件,相应更新各主备切换条件对应 的优先级信息;
第二判断单元, 用于在所述切换条件增加单元结束操作后, 判断是否接收 到其他更新指令, 若否, 解除对所述轮询操作的锁定, 若是, 则继续执行相应 的更新操作。
13、 根据权利要求 10所述的装置, 其特征在于, 所述更新子模块包括: 切换条件删除单元, 用于根据所述删除切换条件指令, 注销待删除的主备 切换条件所对应的动态可编辑数据库;
第三判断单元, 用于在所述切换条件删除单元结束操作后, 判断是否接收 到其他更新指令, 若否, 解除对所述轮询操作的锁定, 若是, 则继续执行相应 的更新操作。
14、根据权利要求 8所述的装置, 其特征在于, 所述主备切换条件更新装 置还包括:
发送端口, 用于将更新后的配置信息发送至备用服务器。
15、 一种服务器, 其特征在于, 包括:
权利要求 8至权利要求 14任一项所述的主备切换条件更新装置。
16、 一种主备切换系统, 其特征在于, 包括:
处于主用状态的, 如权利要求 15所述的服务器;
处于备用状态的服务器。
PCT/CN2013/076299 2012-06-29 2013-05-28 一种主备切换条件更新方法、装置、服务器及系统 WO2014000545A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210222428.1 2012-06-29
CN201210222428.1A CN102739451B (zh) 2012-06-29 2012-06-29 一种主备切换条件更新方法、装置、服务器及系统

Publications (1)

Publication Number Publication Date
WO2014000545A1 true WO2014000545A1 (zh) 2014-01-03

Family

ID=46994281

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/076299 WO2014000545A1 (zh) 2012-06-29 2013-05-28 一种主备切换条件更新方法、装置、服务器及系统

Country Status (2)

Country Link
CN (1) CN102739451B (zh)
WO (1) WO2014000545A1 (zh)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102739451B (zh) * 2012-06-29 2014-12-03 华为技术有限公司 一种主备切换条件更新方法、装置、服务器及系统
CN103905239A (zh) * 2012-12-30 2014-07-02 青岛海尔软件有限公司 结合虚拟机技术为网站系统提供不停机热部署的方法
CN104253746B (zh) * 2014-09-17 2017-04-12 烽火通信科技股份有限公司 一种快速重路由倒换方法及系统
CN107066480B (zh) * 2016-12-20 2020-08-11 创新先进技术有限公司 主备数据库的管理方法、系统及其设备
CN107589955B (zh) * 2017-09-19 2021-06-25 郑州云海信息技术有限公司 一种双cmc固件版本的升级方法及系统
CN108959548B (zh) * 2018-07-02 2023-04-18 创新先进技术有限公司 业务请求的处理方法及装置
CN109992695B (zh) * 2019-04-10 2021-08-27 北京奇艺世纪科技有限公司 一种视频信息查询方法及装置
CN112988160B (zh) * 2021-03-15 2022-04-19 深圳市慧为智能科技股份有限公司 服务器编译方法、装置、设备及计算机可读存储介质
CN115118335B (zh) * 2022-08-29 2022-11-18 中国船舶重工集团公司第七0七研究所 时频基准设备的主备切换方法及应用其的时频基准设备

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102104471A (zh) * 2009-12-21 2011-06-22 中兴通讯股份有限公司 一种冗余备份系统中基于条件的主备切换方法及装置
CN102255740A (zh) * 2010-05-21 2011-11-23 中兴通讯股份有限公司 业务节点主备切换方法和装置
CN102739451A (zh) * 2012-06-29 2012-10-17 华为技术有限公司 一种主备切换条件更新方法、装置、服务器及系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102104471A (zh) * 2009-12-21 2011-06-22 中兴通讯股份有限公司 一种冗余备份系统中基于条件的主备切换方法及装置
CN102255740A (zh) * 2010-05-21 2011-11-23 中兴通讯股份有限公司 业务节点主备切换方法和装置
CN102739451A (zh) * 2012-06-29 2012-10-17 华为技术有限公司 一种主备切换条件更新方法、装置、服务器及系统

Also Published As

Publication number Publication date
CN102739451A (zh) 2012-10-17
CN102739451B (zh) 2014-12-03

Similar Documents

Publication Publication Date Title
WO2014000545A1 (zh) 一种主备切换条件更新方法、装置、服务器及系统
WO2017177941A1 (zh) 主备数据库切换方法和装置
WO2019061720A1 (zh) 一种数据同步的方法和系统
US9454202B2 (en) Power management method for server system
KR20080018267A (ko) 논-스톱 멀티-노드 시스템 동기화를 위한 방법 및 장치
WO2016202051A1 (zh) 一种通信系统中管理主备节点的方法和装置及高可用集群
US8112518B2 (en) Redundant systems management frameworks for network environments
CN112181660A (zh) 一种基于服务器集群的高可用方法
CN102244669A (zh) 一种堆叠设备中软件升级的方法和堆叠设备
KR20210040866A (ko) 파일 리소스 처리 방법, 장치, 기기, 매체 및 컴퓨터 프로그램
EP2642388B1 (en) Standby system device, control method, and program thereof
JP2008172592A (ja) クラスタシステム、コンピュータおよびその異常検出方法
WO2013037314A1 (zh) 用于数据处理中心容灾备份的系统及方法
WO2018094686A1 (zh) 一种smb业务故障处理方法和存储设备
CN113438111A (zh) 基于Raft分布式恢复RabbitMQ网络分区的方法及应用
CN105763442A (zh) 主备倒换lacp聚合链路不中断的pon系统及方法
CN109324549A (zh) 一种双主控设备配置方法及双主控设备
CN110620798A (zh) Ftp连接的控制方法、系统、设备和存储介质
WO2019227839A1 (zh) 一种基于bmc的文件传输方法、装置、设备及介质
JP2004355446A (ja) クラスタシステム及びその制御方法
JP5285044B2 (ja) クラスタシステム復旧方法及びサーバ及びプログラム
WO2021238579A1 (zh) 存储系统管理sata硬盘的方法及存储系统
JP2015114952A (ja) ネットワークシステム、監視制御装置およびソフトウェア検証方法
CN103716186B (zh) 具有网络故障容错能力的人工话务系统及其方法
CN114138567A (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: 13808988

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

Country of ref document: EP

Kind code of ref document: A1