

技术领域technical field
本发明涉及一种服务器系统,特别涉及一种包括主/从服务器的服务器系统及主/从服务器切换方法。The invention relates to a server system, in particular to a server system including a master/slave server and a master/slave server switching method.
背景技术Background technique
现有的客户端-服务器系统中,主服务器、从服务器配置的IP地址不同,在主服务器出现异常,客户端接入从服务器时,因从服务器的IP地址与主服务器的IP地址不同,客户端需要进行相关的动作例如重新发送请求才能从从服务器获得服务,这在一定程度上给客户端造成了不便。In the existing client-server system, the IP addresses configured by the master server and the slave server are different. When an exception occurs on the master server, when the client accesses the slave server, the IP address of the slave server is different from that of the master server. The end needs to perform related actions such as resending the request to obtain the service from the server, which causes inconvenience to the client to a certain extent.
发明内容Contents of the invention
有鉴于此,本发明提供一种服务器系统及服务器切换方法,以解决上述技术问题。In view of this, the present invention provides a server system and a server switching method to solve the above technical problems.
所述服务器系统包括主服务器及从服务器,所述服务器系统配置一工作IP地址及一备份IP地址,所述服务器系统通过所述工作IP地址与客户端进行通信,初始化所述服务器系统时,所述主服务器配置所述工作IP地址,所述从服务器配置所述备份IP地址,所述从服务器在侦测到所述主服务器出现异常时,发送包括IP地址切换信息的封包至所述主服务器,请求所述主服务器与所述从服务器切换IP地址,所述主服务器配置所述备份IP地址,所述从服务器配置所述工作IP地址。The server system includes a master server and a slave server. The server system is configured with a working IP address and a backup IP address. The server system communicates with the client through the working IP address. When the server system is initialized, the The master server configures the working IP address, the slave server configures the backup IP address, and the slave server sends a packet including IP address switching information to the master server when detecting that the master server is abnormal , requesting the primary server and the secondary server to switch IP addresses, the primary server configuring the backup IP address, and the secondary server configuring the working IP address.
所述服务器切换方法应用于服务器系统,所述服务器系统包括主服务器及从服务器,所述服务器系统配置一工作IP地址及一备份IP地址,所述服务器系统通过所述工作IP地址与客户端进行通信,所述方法包括步骤:初始化所述服务器系统时,所述主服务器配置所述工作IP地址,所述从服务器配置所述备份IP地址;以及所述从服务器在侦测到所述主服务器出现异常时,发送包括IP地址切换信息的封包至所述主服务器,请求所述主服务器与所述从服务器切换IP地址,所述主服务器配置所述备份IP地址,所述从服务器配置所述工作IP地址。The server switching method is applied to a server system, the server system includes a master server and a slave server, the server system is configured with a working IP address and a backup IP address, and the server system communicates with the client through the working IP address Communication, the method includes the steps: when initializing the server system, the main server configures the working IP address, and the slave server configures the backup IP address; and the slave server detects that the master server When an exception occurs, send a packet including IP address switching information to the master server, request the master server and the slave server to switch IP addresses, the master server configures the backup IP address, and the slave server configures the Work IP address.
在本发明中,初始时,客户端通过工作IP地址与主服务器进行通信,在主服务器异常切换到从服务器时,主服务器与从服务器的IP地址进行交换,所以客户端仍能通过工作IP地址与从服务器进行通信。如此,在主服务器出现异常时,客户端不会出现业务中断的情况。In the present invention, initially, the client communicates with the main server through the working IP address. Communicate with the slave server. In this way, when the main server is abnormal, the client will not experience business interruption.
附图说明Description of drawings
图1为本发明一种实施方式中服务器系统的功能模块图。FIG. 1 is a functional block diagram of a server system in an embodiment of the present invention.
图2为本发明一种实施方式中服务器切换方法的流程图。Fig. 2 is a flowchart of a server switching method in an embodiment of the present invention.
主要元件符号说明Description of main component symbols
如下具体实施方式将结合上述附图进一步说明本发明。The following specific embodiments will further illustrate the present invention in conjunction with the above-mentioned drawings.
具体实施方式Detailed ways
请参考图1,本实施方式中的服务器系统100包括通过IP网络与客户端200(未示出)连接的执行相同的服务的主服务器10及从服务器20。主服务器10及从服务器20与交换机(未示出)连接。服务器系统100配置一工作IP地址及一备份IP地址。在本实施方式中,一个或多个客户端通过工作IP地址与服务器系统100建立通信连接。初始时,主服务器10配置工作IP地址,从服务器20配置备份IP地址。在主服务器10出现异常时,从服务器20发送包含IP地址切换信息的封包至主服务器10,请求主服务器10与从服务器20切换IP地址,主服务器10配置备份IP地址,从服务器20配置工作IP地址。在主服务器10配置工作IP地址从服务器20配置备份地址后,或在从服务器20配置工作IP地址主服务器10配置备份IP地址后,配置工作IP地址的主服务器10或从服务器20发送包含工作IP地址的GARP(Generic Attribute Register Protocol,GARP)封包至网络以查询工作IP地址是否发生冲突,并更新交换机中的MAC表。Referring to FIG. 1 , the
主服务器10在配置工作IP地址并在工作IP地址发生冲突时,继续发送GARP封包查询工作IP地址是否发生冲突。主服务器10在配置工作IP地址并在工作IP地址没有发生冲突时,进入工作状态,对客户端200发送的请求进行应答,同时定期发送通告包,通知配置备份IP地址的从服务器20自身工作正常。同时从服务器20进入备份状态,只接收主服务器10发送的通告包,不处理其他协议包。当从服务器20在一预定时间内没有接收到主服务器10发送的通告包时,判定主服务器10出现异常,同步客户端200向主服务器10发送的请求,发送包含IP地址切换信息的封包至主服务器10,请求主服务器10与从服务器20切换IP地址,主服务器10配置备份IP地址,从服务器20配置工作IP地址。因为从服务器20在主服务器10出现异常时同步客户端200向主服务器10发送的请求,所以从服务器20在配置工作IP地址进入工作状态后能够同步响应客户端200的请求。从服务器20在配置工作IP地址并且工作IP地址没有发生冲突时,进入工作状态,为客户端200提供服务。从服务器20在进入工作状态后定期发送通告包至主服务器10,以检测主服务器10是否恢复正常。从服务器20在连续几次接收到主服务器10发送的响应包时,判定主服务器10恢复正常,停止向客户端200提供服务。主服务器10在恢复正常后,同步客户端200向从服务器10发送的请求,发送包含IP地址切换信息的GARP封包至从服务器20,请求从服务器20与主服务器10切换IP地址,主服务器10配置工作IP地址,从服务器20配置备份IP地址。When the
在本实施方式中,初始时,客户端200通过工作IP地址与主服务器10进行通信,在主服务器10异常切换到从服务器20时,主服务器10与从服务器20的IP地址进行交换,所以客户端200仍能通过工作IP地址与从服务器20进行通信。如此,在主服务器10出现异常时,客户端200不会出现业务中断的情况。In this embodiment, initially, the
图2为本发明一种实施方式中服务器切换方法的流程图。Fig. 2 is a flowchart of a server switching method in an embodiment of the present invention.
步骤S201中,主服务器10配置工作IP地址,从服务器20配置备份IP地址。In step S201 , the
步骤S202中,主服务器10在工作IP地址没有发生冲突时进入工作状态,为客户端200提供服务,从服务器20进入备份状态。In step S202, the
步骤S203中,主服务器10在工作状态下定期发送通告包至从服务器20,通知从服务器20自身工作正常。In step S203 , the
步骤S204中,从服务器20在预定时间内没有接收到主服务器10发送的通告包时,判定主服务器10出现异常。In step S204, when the slave server 20 does not receive the notification packet sent by the
步骤S205中,从服务器20在判定主服务器10出现异常时,同步客户端200向主服务器10发送的请求,发送包含IP地址切换信息的封包至主服务器10,请求主服务器10与从服务器20切换IP地址,主服务器10配置备份IP地址,从服务器20配置工作IP地址,并发送包含IP地址的GARP封包更新交换机中的MAC表。In step S205, when the slave server 20 determines that the
步骤S206中,从服务器20在工作IP地址没有发生冲突时进入工作状态,为客户端20提供服务。In step S206 , the slave server 20 enters the working state when there is no conflict in the working IP address, and provides services for the client 20 .
步骤S207中,从服务器20在工作状态下定期发送通告包至主服务器10,以检测主服务器10是否恢复到正常。In step S207, the slave server 20 regularly sends notification packets to the
步骤S208中,从服务器20在连续几次接收到主服务器10发送的响应包时,判定主服务器10恢复到正常,从服务器20停止为客户端200提供服务,从工作状态进入备份状态。In step S208, when the slave server 20 receives the response packets sent by the
步骤S209中,主服务器10在恢复到正常时,同步客户端200向从服务器20发送的请求,发送包含IP地址切换信息的封包至从服务器20,请求从服务器20与主服务器20切换IP地址,主服务器10配置工作IP地址,从服务器20配置备份IP地址,并发送包含IP地址的GARP封包更新交换机中的MAC表。执行完步骤S209后,流程返回至步骤S202。In step S209, when the
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2011101065743ACN102761428A (en) | 2011-04-27 | 2011-04-27 | Server system and server switching method |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2011101065743ACN102761428A (en) | 2011-04-27 | 2011-04-27 | Server system and server switching method |
| Publication Number | Publication Date |
|---|---|
| CN102761428Atrue CN102761428A (en) | 2012-10-31 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN2011101065743APendingCN102761428A (en) | 2011-04-27 | 2011-04-27 | Server system and server switching method |
| Country | Link |
|---|---|
| CN (1) | CN102761428A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103346903A (en)* | 2013-06-20 | 2013-10-09 | 北京捷成世纪科技股份有限公司 | Dual-machine backup method and device |
| CN104468221A (en)* | 2014-12-12 | 2015-03-25 | 北京国双科技有限公司 | Server fault hot-switching method, device and system |
| CN106453614A (en)* | 2016-11-11 | 2017-02-22 | 郑州云海信息技术有限公司 | Cloud operation system and access method thereof |
| CN107707611A (en)* | 2017-08-09 | 2018-02-16 | 南方电网科学研究院有限责任公司 | Electric power data cloud processing method, device and system |
| CN108429644A (en)* | 2018-02-28 | 2018-08-21 | 新华三技术有限公司 | network device management method, device and server |
| CN112882871A (en)* | 2021-04-29 | 2021-06-01 | 深圳市科力锐科技有限公司 | Host conflict detection method, device, equipment and storage medium |
| CN113472900A (en)* | 2021-09-01 | 2021-10-01 | 阿里云计算有限公司 | Message processing method, device, storage medium and computer program product |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6658251B1 (en)* | 1998-07-30 | 2003-12-02 | Samsung Electronics Co., Ltd. | Method and apparatus for designating WAP server address for wireless communication terminal |
| CN1851657A (en)* | 2005-07-21 | 2006-10-25 | 上海华为技术有限公司 | Dual-machine back-up realizing method and system |
| CN101873223A (en)* | 2010-05-27 | 2010-10-27 | 天讯瑞达通信技术有限公司 | N+M service backup mechanism based on IP switching |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6658251B1 (en)* | 1998-07-30 | 2003-12-02 | Samsung Electronics Co., Ltd. | Method and apparatus for designating WAP server address for wireless communication terminal |
| CN1851657A (en)* | 2005-07-21 | 2006-10-25 | 上海华为技术有限公司 | Dual-machine back-up realizing method and system |
| CN101873223A (en)* | 2010-05-27 | 2010-10-27 | 天讯瑞达通信技术有限公司 | N+M service backup mechanism based on IP switching |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103346903A (en)* | 2013-06-20 | 2013-10-09 | 北京捷成世纪科技股份有限公司 | Dual-machine backup method and device |
| CN103346903B (en)* | 2013-06-20 | 2017-02-15 | 北京捷成世纪科技股份有限公司 | Dual-machine backup method and device |
| CN104468221A (en)* | 2014-12-12 | 2015-03-25 | 北京国双科技有限公司 | Server fault hot-switching method, device and system |
| CN106453614A (en)* | 2016-11-11 | 2017-02-22 | 郑州云海信息技术有限公司 | Cloud operation system and access method thereof |
| CN106453614B (en)* | 2016-11-11 | 2019-06-18 | 郑州云海信息技术有限公司 | A cloud operating system and its access method |
| CN107707611A (en)* | 2017-08-09 | 2018-02-16 | 南方电网科学研究院有限责任公司 | Electric power data cloud processing method, device and system |
| CN107707611B (en)* | 2017-08-09 | 2020-11-03 | 南方电网科学研究院有限责任公司 | Power data cloud processing method, device and system |
| CN108429644A (en)* | 2018-02-28 | 2018-08-21 | 新华三技术有限公司 | network device management method, device and server |
| CN108429644B (en)* | 2018-02-28 | 2021-08-06 | 新华三技术有限公司 | Network equipment management method and device and server |
| CN112882871A (en)* | 2021-04-29 | 2021-06-01 | 深圳市科力锐科技有限公司 | Host conflict detection method, device, equipment and storage medium |
| CN112882871B (en)* | 2021-04-29 | 2021-08-24 | 深圳市科力锐科技有限公司 | Host conflict detection method, device, equipment and storage medium |
| CN113472900A (en)* | 2021-09-01 | 2021-10-01 | 阿里云计算有限公司 | Message processing method, device, storage medium and computer program product |
| Publication | Publication Date | Title |
|---|---|---|
| CN102404146B (en) | Master-slave switching method, network device and DHCP server | |
| CN102761428A (en) | Server system and server switching method | |
| CN102098201B (en) | Method for realizing L2TP user access backup and network system | |
| CN101094102B (en) | Active-standby switching method of routing equipment and routing backup system | |
| KR101591102B1 (en) | Method for router of virtual router redundancy protocol and communication system therefor | |
| CN113328894B (en) | Method and device for dual-machine hot backup based on CU separation | |
| CN105453487A (en) | Extending virtual station interface discovery protocol (VDP) and VDP-like protocols for dual-homed deployments in data center environments | |
| CN106487578A (en) | Error recovery method, and Internet of things system and charging system applying same | |
| WO2009023996A1 (en) | Method for implementing network interconnect via link aggregation | |
| EP2597821B1 (en) | Method and system for auto-configuration, and network node | |
| CN105119822A (en) | Backup group management method and system based on VRRP (Virtual Router Redundancy Protocol) | |
| WO2011147312A1 (en) | Method, device and system for port backup of service access router | |
| CN108075971A (en) | A kind of main/standby switching method and device | |
| EP2733907B1 (en) | Method, local gateway, and system for local voice survivability | |
| CN101656764A (en) | Method, system and device for keeping session of DHCP user active | |
| CN107769984B (en) | Low-cost active/standby hot switching system and method based on gateway | |
| CN102075343A (en) | An out-of-band management realization method, a system for the same and an out-of-band management switch | |
| CN101110776A (en) | Backup method, backup device and backup system for data service | |
| CN105340226A (en) | Primary and secondary system handover method for dynamic route device, and apparatus thereof | |
| CN104202204B (en) | Clock synchronization control method, apparatus and system based on SNTP | |
| CN1859423B (en) | A method for synchronous switching of host and forwarding device | |
| JP2013046176A (en) | Communication system, router device, and router switchover method | |
| JP5974911B2 (en) | Communication system and network relay device | |
| CN101453395A (en) | Switching method, system and device for uplink mode | |
| CN104935614A (en) | A data transmission method and device |
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C12 | Rejection of a patent application after its publication | ||
| RJ01 | Rejection of invention patent application after publication | Application publication date:20121031 |