CN107104830B - Multi-server switching method and system - Google Patents

Multi-server switching method and system Download PDF

Info

Publication number
CN107104830B
CN107104830B CN201710254060.XA CN201710254060A CN107104830B CN 107104830 B CN107104830 B CN 107104830B CN 201710254060 A CN201710254060 A CN 201710254060A CN 107104830 B CN107104830 B CN 107104830B
Authority
CN
China
Prior art keywords
server
slave
slave server
standby
original
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710254060.XA
Other languages
Chinese (zh)
Other versions
CN107104830A (en
Inventor
曹海华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Inspur Smart Computing Technology Co Ltd
Original Assignee
Guangdong Inspur Big Data Research Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Inspur Big Data Research Co Ltd filed Critical Guangdong Inspur Big Data Research Co Ltd
Priority to CN201710254060.XA priority Critical patent/CN107104830B/en
Publication of CN107104830A publication Critical patent/CN107104830A/en
Application granted granted Critical
Publication of CN107104830B publication Critical patent/CN107104830B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • 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/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0668Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Hardware Redundancy (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application discloses a multi-server switching method, which comprises the following steps: when the slave server group detects that the original master server is inactivated, the slave server group confirms one slave server as a standby master server in the slave server group according to a preset static allocation sequence. Therefore, according to the method and the device, the static allocation sequence is set for each slave server in the slave server group in advance, when the original master server is inactivated, the slave server group can confirm the slave server which is supposed to be used as the standby master server according to the static allocation sequence, so that the function of the slave server can be smoothly replaced by the original master server to continue running after the original master server is inactivated, and reliable data service is provided for users. In addition, the application also correspondingly discloses a multi-server switching system.

Description

Multi-server switching method and system
Technical Field
The invention relates to the field of multi-server hot standby, in particular to a multi-server switching method and a multi-server switching system.
Background
With the rapid development of the internet (mobile internet), users increasingly rely on data services provided by servers, the demand for availability of data is increased, and services (data) provided by the servers need to be accessed more anytime and anywhere; in order to avoid the failure of the server and the failure of the user to acquire the service, a multi-machine hot standby scheme is adopted, and when the main server is inactivated, the slave server should be switched to the main server to continue to provide the service for the user.
Disclosure of Invention
In view of the above, the present invention provides a method and a system for switching between multiple servers, so that a slave server can smoothly replace its function to continue operating after an original master server is deactivated. The specific scheme is as follows:
a multi-server switching method comprises the following steps: and when the slave server group detects that the original master server is inactivated, the slave server group confirms one slave server as a standby master server in the slave server group according to a preset static allocation sequence.
Preferably, after the slave server with the highest priority is changed to the standby master server, the method further includes:
the standby master server sends a switching notification to each slave server.
Preferably, the process of confirming that one slave server is the standby master server in the slave server group according to a preset static allocation order by the slave server group includes:
and the slave servers in the slave server group judge the static allocation orders of the slave servers, and the slave server with the highest priority is changed into the standby master server.
Preferably, after determining the respective static allocation orders, the method further includes:
each slave server mutually transmits confirmation information, each slave server judges whether the priority of the slave server is the highest by using the confirmation information transmitted by each slave server, and if so, the slave server becomes the standby main server; wherein, the confirmation information comprises the static allocation sequence of the slave server.
Preferably, the method further comprises the following steps:
and when the standby main server detects that the original main server is recovered to be normal, sending the data during the inactivation period of the original main server to the original main server, and changing the standby main server into one slave server in the slave server group.
The invention also discloses a multi-server switching system, which comprises:
the detection module is used for detecting the inactivation of the original main server from the server group;
and the confirming module is used for confirming that one slave server is the standby master server in the slave server group according to the preset static distribution sequence.
Preferably, the method further comprises the following steps: and the notification module is used for sending a switching notification to each slave server by the standby master server.
Preferably, the confirmation module is specifically configured to determine a static allocation order of each slave server in the slave server group, and change the slave server with the highest priority to the standby master server.
Preferably, the method further comprises the following steps:
the sending module is used for sending confirmation information to each slave server;
the judging module is used for judging whether the priority of each slave server is the highest by utilizing the confirmation information sent by each slave server, and if so, the slave server becomes the standby main server;
wherein, the confirmation information comprises the static allocation sequence of the slave server.
Preferably, the method further comprises the following steps:
the data sending module is used for sending the data in the inactivation period of the original main server to the original main server when the standby main server detects that the original main server is recovered to be normal;
a switching module for the standby master server to become one of the slave servers in the slave server group.
In the invention, the multi-server switching method comprises the following steps: when the slave server group detects that the original master server is inactivated, the slave server group confirms one slave server as a standby master server in the slave server group according to a preset static allocation sequence. Therefore, the static allocation sequence is set for each slave server in the slave server group in advance, when the original master server is inactivated, the slave server group can confirm the slave server which is supposed to be used as the standby master server according to the static allocation sequence, so that the function of the slave server can be smoothly replaced by the original master server to continue to operate after the original master server is inactivated, and reliable data service is provided for users.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic flow chart of a multi-server switching method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a multi-server switching system according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention discloses a multi-server switching method, which is shown in figure 1 and comprises the following steps:
step S11: when the slave server group detects that the original master server is inactivated, the slave server group confirms one slave server as a standby master server in the slave server group according to a preset static allocation sequence.
Specifically, during normal operation, the slave server group can receive the live signal sent by the original master server, and when the original master server is inactivated, the slave server group cannot receive the live signal sent by the original master server within the first threshold, the inactivation of the original master server can be known.
The slave servers in the slave server group judge respective static allocation orders, and the slave server with the highest priority is changed into a standby master server; the static allocation sequence can be set in advance by a user, and the sequence of switching each slave server to the standby master server is specified, for example, 10 slave servers exist in the slave server group, numbers from the first slave server to the tenth slave server are specified to be 1 to 10, switching from small numbers to large numbers is set, and if the original master server is inactivated, the first slave server with the number of 1 has the highest priority and becomes the standby master server; after learning the inactivation of the original master server, the slave servers in the slave server group inquire the static allocation sequence of the slave servers, and when the slave servers confirm that the slave servers are the slave servers with the highest priority, the slave servers are switched to the standby master server.
Therefore, the embodiment of the invention sets a static allocation sequence for each slave server in the slave server group in advance, and when the original master server is inactivated, the slave server group can confirm the slave server which should be used as the standby master server according to the static allocation sequence, so that the slave server can smoothly replace the function of the original master server to continue to operate after the original master server is inactivated, and reliable data service is provided for users.
It should be noted that if the original master server is deactivated and there are also slave servers in the slave server group deactivated, the order of switching from the slave server to the standby master server will be affected, and particularly if the slave server with the highest priority is deactivated, the next slave server needs to be switched to the standby master server.
Specifically, the slave server compares the static allocation sequence included in the received confirmation information sent by the rest slave servers with the self static allocation sequence, judges whether the self priority is the highest, if so, the slave server becomes the standby master server, and if not, the slave server does not execute the operation.
The slave server can know whether the inactivated master server is the original master server or the standby master server converted from the slave server, so that the slave server judges whether the static allocation sequence of the slave server is the slave server with the highest priority compared with the inactivated master server, for example, the numbers of a first slave server to a tenth slave server are 1 to 10, the switching is set according to the sequence of the numbers from small to large, the inactivation of the master server is detected, the master server is the original master server when the number of the master server is 0, the priority of the first slave server with the number of 1 is the highest, and the first slave server is switched to the standby master server; if the number of the master server is 1, the second slave server with the number of 2 has the highest priority, so that the second slave server is switched to the standby master server; if the master server number is 2, the third slave server is switched to the standby master server.
Furthermore, if the confirmation information is not transmitted between the slave servers, in order to prevent the situation that the slave server is not changed into the original master server due to the inactivation of the slave server after the slave server with the highest priority is changed into the standby master server, the switching notification is transmitted to the slave servers after the slave server with the highest priority is changed into the standby master server, so that the slave servers can know the success of the switching, if the slave servers cannot receive the switching notification transmitted by the standby master server within a preset second threshold value, the switching between the master server and the slave servers is not completed, the original master server is not operated at present, and the slave servers can judge whether to be switched into the standby master server or not by using the static allocation sequence of the slave servers.
For example, the second threshold value is 60 seconds, when each slave server detects that the original master server is inactive, each slave server confirms that the first slave server with the highest priority should be switched to the standby master server by using its own static allocation order, and after 60 seconds, each slave server still does not receive the switching notification to be sent from the first slave server to the standby master server, which indicates that the switching of the first slave server fails, and the second slave server with the highest priority performs the switching, and after 60 seconds, if the switching notification is still not received, the switching is performed by the third slave server according to the static allocation order, and after the third slave server switches to the standby master server, the switching notification is sent within 60 seconds, so that each slave server which has not been switched knows that the switching operation is completed.
In practical applications, when the original master server is recovered to normal, the standby master server needs to be switched to the slave server again to recover the original master server, and the original master server continues the original operation.
Specifically, the standby main server sends all data during the operation period to the original main server, that is, all data before the original main server is recovered to be normal is sent to the original main server, so that the original main server can continue to process the data, the data is not lost or interrupted, the operation stability is ensured, and after the data is transmitted, the standby main server recovers the previous operation identity, becomes a slave server, and continues to work.
The present invention also discloses a multi-server switching system, as shown in fig. 2, the system includes:
the detection module 11 is used for detecting the inactivation of the original main server from the server group;
a confirming module 12, configured to confirm, from the slave server group, that one slave server is the standby master server according to a preset static allocation order.
Therefore, the embodiment of the invention sets a static allocation sequence for each slave server in the slave server group in advance, and when the original master server is inactivated, the slave server group can confirm the slave server which should be used as the standby master server according to the static allocation sequence, so that the slave server can smoothly replace the function of the original master server to continue to operate after the original master server is inactivated, and reliable data service is provided for users.
Specifically, the confirming module 12 is specifically configured to determine the static allocation order of each slave server in the slave server group, and change the slave server with the highest priority to the standby master server.
The embodiment of the invention also comprises a sending module, a judging module, a notifying module, a data sending module and a switching module; wherein,
the sending module is used for sending confirmation information to each slave server;
the judging module is used for judging whether the priority of each slave server is the highest by utilizing the confirmation information sent by each slave server, and if so, the slave server becomes a standby master server;
wherein, the confirmation information comprises the static allocation sequence of the slave server.
And the notification module is used for sending a switching notification to each slave server by the standby master server.
The data sending module is used for sending the data in the inactivation period of the original main server to the original main server when the standby main server detects that the original main server is recovered to be normal;
and the switching module is used for changing the standby main server into one slave server in the slave server group.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The present invention provides a method and a system for switching between multiple servers, which are described in detail above, wherein a specific example is applied to illustrate the principle and the implementation manner of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (2)

1. A multi-server switching method, comprising:
when the slave server group detects that the original master server is inactivated, the slave server group confirms a slave server as a standby master server in the slave server group according to a preset static allocation sequence;
wherein, the process of the slave server group confirming one slave server as the standby master server in the slave server group according to the preset static allocation sequence comprises:
the slave servers in the slave server group judge respective static allocation orders, and the slave server with the highest priority becomes the standby master server;
wherein, after the slave server with the highest priority is changed into the standby master server, the method further comprises:
the standby main server sends a switching notice to each slave server;
wherein, after determining the respective static allocation order, the method further comprises:
each slave server mutually transmits confirmation information, each slave server judges whether the priority of the slave server is the highest by using the confirmation information transmitted by each slave server, and if so, the slave server becomes the standby main server; wherein, the confirmation information comprises a static distribution sequence of the slave server;
if each slave server fails to receive the switching notification sent by the standby master server within a preset second threshold value, the switching between the master server and the slave servers is not completed, the original master server is not operated at present, and each slave server judges whether to switch to the standby master server or not by utilizing the static distribution sequence of the slave server;
wherein, still include:
and when the standby main server detects that the original main server is recovered to be normal, sending the data during the inactivation period of the original main server to the original main server, and changing the standby main server into one slave server in the slave server group.
2. A multi-server switching system, comprising:
the detection module is used for detecting the inactivation of the original main server from the server group;
the confirming module is used for confirming that one slave server is a standby master server in the slave server group according to a preset static distribution sequence;
a notification module, configured to send a switching notification to each slave server by the standby master server;
the sending module is used for sending confirmation information to each slave server;
the judging module is used for judging whether the priority of each slave server is the highest by utilizing the confirmation information sent by each slave server, and if so, the slave server becomes the standby main server;
wherein, the confirmation information comprises a static distribution sequence of the slave server;
the confirmation module is specifically configured to determine a static allocation order of each slave server in the slave server group, and change the slave server with the highest priority to the standby master server;
if each slave server fails to receive the switching notification sent by the standby master server within a preset second threshold value, the switching between the master server and the slave servers is not completed, the original master server is not operated at present, and each slave server judges whether to switch to the standby master server or not by utilizing the static distribution sequence of the slave server;
wherein, still include:
the data sending module is used for sending the data in the inactivation period of the original main server to the original main server when the standby main server detects that the original main server is recovered to be normal;
a switching module for the standby master server to become one of the slave servers in the slave server group.
CN201710254060.XA 2017-04-18 2017-04-18 Multi-server switching method and system Active CN107104830B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710254060.XA CN107104830B (en) 2017-04-18 2017-04-18 Multi-server switching method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710254060.XA CN107104830B (en) 2017-04-18 2017-04-18 Multi-server switching method and system

Publications (2)

Publication Number Publication Date
CN107104830A CN107104830A (en) 2017-08-29
CN107104830B true CN107104830B (en) 2020-09-04

Family

ID=59657102

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710254060.XA Active CN107104830B (en) 2017-04-18 2017-04-18 Multi-server switching method and system

Country Status (1)

Country Link
CN (1) CN107104830B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109729388B (en) * 2018-12-18 2021-04-23 视联动力信息技术股份有限公司 Method and device for switching video networking servers

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1780231A (en) * 2004-11-25 2006-05-31 华为技术有限公司 Backup system and method for access servo interface
CN103067206A (en) * 2012-12-28 2013-04-24 无锡博欧节能科技有限公司 Internet of things across-machine room distributed type full automatic hot standby server switching system
CN104639367A (en) * 2015-01-04 2015-05-20 中国联合网络通信集团有限公司 Method and system for implementing switching of master server and standby server
CN105406980A (en) * 2015-10-19 2016-03-16 浪潮(北京)电子信息产业有限公司 Multi-node backup method and multi-node backup device
US9473350B2 (en) * 2013-09-26 2016-10-18 Futurewei Technologies, Inc. Protecting a label switched path egress without using downstream labels

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1780231A (en) * 2004-11-25 2006-05-31 华为技术有限公司 Backup system and method for access servo interface
CN103067206A (en) * 2012-12-28 2013-04-24 无锡博欧节能科技有限公司 Internet of things across-machine room distributed type full automatic hot standby server switching system
US9473350B2 (en) * 2013-09-26 2016-10-18 Futurewei Technologies, Inc. Protecting a label switched path egress without using downstream labels
CN104639367A (en) * 2015-01-04 2015-05-20 中国联合网络通信集团有限公司 Method and system for implementing switching of master server and standby server
CN105406980A (en) * 2015-10-19 2016-03-16 浪潮(北京)电子信息产业有限公司 Multi-node backup method and multi-node backup device

Also Published As

Publication number Publication date
CN107104830A (en) 2017-08-29

Similar Documents

Publication Publication Date Title
CN108040108B (en) Communication switching method, device, coordination server and readable storage medium
CN106330475B (en) Method and device for managing main and standby nodes in communication system and high-availability cluster
WO2014166265A1 (en) Method, terminal, cache server and system for updating webpage data
US10355963B2 (en) Heartbeat period setting method, and terminal
US9596313B2 (en) Method, terminal, cache server and system for updating webpage data
CN100421390C (en) Client service emergency system and its realizing method
CN105959078B (en) A kind of cluster method for synchronizing time, cluster and clock synchronization system
CN109921942B (en) Cloud platform switching control method, device and system and electronic equipment
CN105306605A (en) Double host server system
CN103916226A (en) Redundant backup method based on embedded equipment
CN104901834A (en) Method and system for automatically switching between network servers
CN107688547B (en) Method and system for switching between main controller and standby controller
JP6007988B2 (en) Standby system apparatus, operational system apparatus, redundant configuration system, and load distribution method
CN107104830B (en) Multi-server switching method and system
EP2774323B1 (en) Method, communication system and non-transitory computer readable medium for optimizing network performance after a temporary loss of connection
CN106992889B (en) Multi-server switching method and system
CN106992890B (en) Multi-server switching method and system
CN104951320A (en) Application installing and uninstalling method and system
CN107104831B (en) Multi-server switching method and system
CN112948177A (en) Disaster recovery backup method and device, electronic equipment and storage medium
US10349291B2 (en) Method and system for establishing a self-organized mobile core in a cellular communication network
KR102311858B1 (en) Apparatus and Method for Detecting Failure of Network
CN106210098A (en) A kind of monitoring method, supervising device and push server
CN116582618B (en) Method and device for realizing high availability of electric pin, machine room management platform and computer
CN107635246B (en) network configuration method and system

Legal Events

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