WO2020057445A1 - Communication system, method, and device - Google Patents
Communication system, method, and device Download PDFInfo
- Publication number
- WO2020057445A1 WO2020057445A1 PCT/CN2019/105770 CN2019105770W WO2020057445A1 WO 2020057445 A1 WO2020057445 A1 WO 2020057445A1 CN 2019105770 W CN2019105770 W CN 2019105770W WO 2020057445 A1 WO2020057445 A1 WO 2020057445A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- server
- address
- mapping relationship
- routing
- target device
- Prior art date
Links
- 238000004891 communication Methods 0.000 title claims abstract description 55
- 238000000034 method Methods 0.000 title claims abstract description 43
- 238000013507 mapping Methods 0.000 claims abstract description 226
- 238000012217 deletion Methods 0.000 claims description 10
- 230000037430 deletion Effects 0.000 claims description 10
- 230000015654 memory Effects 0.000 description 26
- 230000006870 function Effects 0.000 description 13
- 238000010586 diagram Methods 0.000 description 11
- 230000008859 change Effects 0.000 description 10
- 230000009471 action Effects 0.000 description 8
- 238000011084 recovery Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000004590 computer program Methods 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/40—Support for services or applications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0654—Management of faults, events, alarms or notifications using network fault recovery
- H04L41/0663—Performing the actions predefined by failover planning, e.g. switching to standby network elements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
Definitions
- the present application relates to the field of network communication, and in particular, to a communication system, method, and device.
- Cloud services can provide users with services such as automated deployment of network services, automated operation and maintenance, and so it is very important to ensure the normal operation of cloud services.
- servers that support cloud service management must have a disaster tolerance function, that is, when the primary server fails, services can be switched to the standby server in a timely manner.
- IP Internet protocol
- the administrator needs to manually replace the southbound interface IP address of the primary server with the southbound interface IP address of the standby server in the network equipment accessing the southbound interface to achieve access to the standby server.
- the user needs to manually replace the northbound interface IP address of the primary server with the northbound interface IP address of the standby server through the user terminal accessing the northbound interface to implement access to the standby server.
- the embodiments of the present application provide a communication method, device, and system, which are used to implement automatic switching between a primary server and a standby server, and reduce the workload of users and management personnel.
- An embodiment of the present application provides a communication system including a first server and a second server.
- the first server and the second server are connected.
- the first server and the second server may be load balancing servers or other types of servers, which are not limited in this application.
- the first server and the second server may be physical servers or virtual servers.
- the number of the first servers may be one or multiple; the number of the second servers may be one or multiple.
- the first server and the second server may be in the same autonomous domain, or may belong to different autonomous domains.
- Each of the first server and the second server has a southbound interface and a northbound interface.
- the first server is configured to obtain a first mapping relationship and send the first mapping relationship to a target device based on a border gateway protocol.
- the first mapping relationship is a mapping relationship between an IP address associated with the first server and a local IP address of the first server.
- the IP address associated with the first server includes: a preset southbound interface IP address and / or a preset northbound interface IP address.
- the preset southbound interface IP address and / or the preset northbound interface IP address include the following three cases: a separate preset southbound interface IP address, or a separate preset northbound interface IP address, or a preset southbound interface. Forwarding interface IP address and preset northbound interface IP address.
- the first mapping relationship may be used for the target device to access the first server.
- the second server is configured to obtain the status of the first server and the second mapping relationship, and if the status is a fault status, send the second mapping relationship to the target device based on the border gateway protocol.
- the second mapping relationship is a mapping relationship between an IP address associated with the first server and a local IP address of the second server. The second mapping relationship may be used for the target device to access the second server.
- the target device uses the same IP address, that is, the IP address associated with the first server to access the first server and the second server, there is no need for the user or manager to modify the IP address to access the first server to access the second server.
- Server switching since the IP addresses associated with the first server are sent to the target device as the first server and the second server, rather than the routing device of the first server and the routing device of the second server, there is no need to set priority on the routing device Level to control who publishes the IP address associated with the first server to the target device, but the second server itself obtains the status of the first server, and when the status is faulty, the target server is published to the target device.
- the linked IP address realizes the automatic switching between the first server and the second server, reducing the workload of the management staff.
- An embodiment of the present application further provides a communication method including the following steps: First, a first server obtains a first mapping relationship, and the first mapping relationship is an Internet protocol IP address associated with the first server and a local IP of the first server. The mapping relationship between the addresses.
- the IP address associated with the first server includes a preset southbound interface IP address and / or a preset northbound interface IP address.
- Second, the first server sends a first mapping relationship to the target device based on the border gateway protocol.
- the first server may be a load balancing server or another type of server.
- the first server sends the mapping relationship between the IP address associated with the first server and the local IP address of the first server to the target device, that is, the first mapping relationship.
- the target device can A mapping relationship accesses the first server.
- the IP address associated with the first server can be used to access the first server, and the IP address of the first server does not need to be used to access the first server, that is, the user can access without having to sense the first server.
- the target device only needs to change the mapping relationship between the IP address associated with the first server and the IP address of the first server to be associated with the first server The mapping relationship between the IP address of the IP address and the IP address of the second server is sufficient.
- the user does not need to change the accessed address when switching between servers, which provides convenience to the user.
- the IP address associated with the first server is sent to the target device as the first server, not the routing device of the first server, there is no need to set a priority on the routing device to control whether the target device accesses the first server, Reduced workload for managers.
- the target device may include a routing device.
- sending the first mapping relationship to the target device based on the border gateway protocol includes sending a first routing table entry generation instruction to the routing device based on the border gateway protocol.
- the first routing table entry generation instruction carries the first mapping relationship and the first routing table.
- the entry generation instruction is used to instruct the routing device to generate a first routing entry according to the first mapping relationship.
- the destination address of the first routing entry is the IP address associated with the first server, and the next hop address of the first routing entry is The local IP address of the first server.
- the routing device may look up the first routing table entry according to the IP address associated with the first server carried in the received packet, and determine the next hop address corresponding to the IP address associated with the first server, that is, the first The local IP address of the server, and then sends the message to the first server.
- the method further includes: if the state of the first server is in a fault state, sending the message to the routing device.
- a first delete instruction is sent. The first delete instruction is used to instruct the routing device to delete the first routing entry.
- sending the first mapping relationship to the target device based on the border gateway protocol may specifically include: if the state of the first server is a working state, setting the primary and secondary identifiers of the first server to an identifier corresponding to the primary server, for example, 1 . If the primary and secondary identifications of the first server are detected as the identifications corresponding to the primary server, the first mapping relationship is sent to the target device based on the border gateway protocol. That is, as an optional implementation manner, whether to trigger the action of sending the first mapping relationship to the target device is determined through the active and standby identifiers, and the specific value of the active and standby identifiers may be determined by the status of the first server.
- An embodiment of the present application further provides a communication method including the following steps: first, the second server obtains a status of the first server and a second mapping relationship, and the second mapping relationship is an IP address associated with the first server and a second mapping relationship; The mapping relationship between the local IP addresses of the servers.
- the IP address associated with the first server includes a preset southbound interface Internet protocol IP address and / or a preset northbound interface IP address.
- the second server sends a second mapping relationship to the target device based on the border gateway protocol.
- the second mapping relationship is used for the target device to access the second server.
- the second server may be a load balancing server or another type of server.
- the second server sends the mapping relationship between the Internet Protocol IP address associated with the first server and the local IP address of the second server to the target device, that is, the second mapping relationship.
- the target device can And accessing the second server according to the second mapping relationship.
- the IP address associated with the second server can be used to access the second server, and the IP address of the second server does not need to be used to access the second server, that is, the user can access without having to sense the second server. That is, when the first server fails and needs to be replaced with the second server, it is only necessary to change the mapping relationship between the IP address associated with the first server and the first server to the IP associated with the first server.
- the mapping relationship between the address and the second server is sufficient, and the user does not need to change the accessed address when switching between servers, which provides convenience to the user.
- the IP address associated with the first server is sent to the target device as the second server, not the routing device of the second server, there is no need to set a priority on the routing device to control whether the routing device accesses the second server.
- the second server itself obtains the status of the first server, and when the status is faulty, it publishes the IP address associated with the first server to the target device to achieve access to the second server and reduce the management staff ’s Workload.
- the target device includes a routing device
- sending the second mapping relationship to the target device based on the border gateway protocol includes: sending a second routing table entry generation instruction to the routing device based on the border gateway protocol, and the second routing table entry generation instruction carries A second mapping relationship, and a second routing table entry generation instruction is used to instruct a routing device to generate a second routing table entry according to the second mapping relationship, and a destination address of the second routing table entry is an IP address associated with the first server; The next hop address of the routing entry is the local IP address of the second server.
- the routing device may look up the second routing entry according to the IP address associated with the first server carried in the received packet, and determine the next hop address corresponding to the IP address associated with the first server, that is, the second The local IP address of the server, and then sends the message to the second server.
- sending the second mapping relationship to the target device based on the border gateway protocol includes: if the state of the first server is a fault state, setting the primary and secondary identifiers of the second server to the identifiers corresponding to the primary server; When the primary and secondary identifiers of the server are the identifiers corresponding to the primary server, a second mapping relationship is sent to the target device based on the border gateway protocol. That is, as an optional implementation manner, whether to trigger the action of sending the second mapping relationship to the target device is determined through the primary and secondary identifiers, and the specific value of the primary and secondary identifiers may be determined by the status of the first server.
- An embodiment of the present application further provides a communication device applied to a first server.
- the device includes: an obtaining unit configured to obtain a first mapping relationship, where the first mapping relationship is an Internet protocol IP address and a first The mapping relationship between the local IP addresses of a server.
- the IP address associated with the first server includes a preset southbound interface IP address and / or a preset northbound interface IP address.
- a sending unit is configured to send a target based on a border gateway protocol. The device sends a first mapping relationship.
- the target device includes a routing device, and a sending unit is configured to send a first routing entry generation instruction to the routing device based on the border gateway protocol.
- the first routing entry generation instruction carries a first mapping relationship and a first routing entry.
- the generation instruction is used to instruct the routing device to generate a first routing entry according to the first mapping relationship.
- the destination address of the first routing entry is the IP address associated with the first server, and the next hop address of the first routing entry is the first.
- the local IP address of a server is the IP address associated with the first server.
- the apparatus further includes: a deleting unit, configured to send a first deletion instruction to the routing device if the state of the first server is a fault state, and the first deletion instruction is used to instruct the routing device to delete the first routing entry.
- a deleting unit configured to send a first deletion instruction to the routing device if the state of the first server is a fault state, and the first deletion instruction is used to instruct the routing device to delete the first routing entry.
- the sending unit is configured to set the master / slave identifier of the first server as the identifier corresponding to the master server if the state of the first server is the working state; if it is detected that the master / slave identifier of the first server corresponds to the master server When it is identified, the first mapping relationship is sent to the target device based on the border gateway protocol.
- the first server includes a load balancing server.
- An embodiment of the present application further provides a communication device, which is applied to a second server.
- the device includes: an obtaining unit, configured to obtain a status of the first server and a second mapping relationship, where the second mapping relationship is associated with the first server.
- the IP address associated with the first server includes a preset southbound interface Internet protocol IP address and / or a preset northbound interface IP address.
- the sending unit is configured to: If the state is a fault state, the second mapping relationship is sent to the target device based on the border gateway protocol.
- the target device includes a routing device; and a sending unit configured to send a second routing entry generation instruction to the routing device based on the border gateway protocol, where the second routing entry generation instruction carries a second mapping relationship and the second routing entry The generation instruction is used to instruct the routing device to generate a second routing entry according to the second mapping relationship.
- the destination address of the second routing entry is the IP address associated with the first server, and the next hop address of the second routing entry is the first.
- the local IP address of the server is the IP address associated with the first server.
- the sending unit is configured to set the master / slave identifier of the second server as the master server's corresponding identifier if the state of the first server is in the fault state;
- the second mapping relationship is sent to the target device based on the border gateway protocol.
- FIG. 1 is a structural block diagram of a communication system according to an embodiment of the present application.
- FIG. 2 is a structural block diagram of another communication system according to an embodiment of the present application.
- FIG. 3 is a schematic flowchart of a communication method according to an embodiment of the present application.
- FIG. 4 is a schematic flowchart of another communication method according to an embodiment of the present application.
- FIG. 5 is a structural block diagram of a communication device according to an embodiment of the present application.
- FIG. 6 is a structural block diagram of another communication device according to an embodiment of the present application.
- FIG. 7 is a structural block diagram of a server according to an embodiment of the present application.
- FIG. 8 is a structural block diagram of another server provided by an embodiment of the present application.
- both the first routing device connected to the primary server and the second routing device connected to the standby server store the IP address associated with the first server, that is, the preset southbound interface IP address and / or the preset IP address of the northbound interface.
- Priorities are configured in the first routing device and the second routing device in advance.
- the priority configured by the primary server is a high priority
- the priority configured by the standby server is a low priority.
- the first routing device is configured with a high priority
- the first routing device sends an IP address associated with the first server to the target device.
- the target device may be a northbound user terminal and / or a southbound network device.
- the second routing device is configured with a low priority, the second routing device does not send the IP address associated with the first server to the target device. At this time, the target device can access the master through the IP address associated with the first server. server.
- the priority of the second routing device needs to be changed from low priority to high priority, and the priority of the first routing device is changed from high priority to low priority, so that the second routing device can forward to
- the target device sends an IP address associated with the first server. In this way, the target device can access the standby server through the IP address associated with the first server.
- the target device uses the same IP address, that is, the IP address associated with the first server to access the active and standby servers, and does not require the user to modify the IP address, which effectively improves the user experience.
- the embodiments of the present application provide a communication system, method, and device, where the communication system includes a first server and a second server. The first server and the second server are connected.
- the first server is configured to obtain a first mapping relationship and send the first mapping relationship to a target device based on a border gateway protocol.
- the first mapping relationship is a mapping relationship between an IP address associated with the first server and a local IP address of the first server.
- the IP address associated with the first server includes: a preset southbound interface IP address and / or a preset northbound interface IP address.
- the preset southbound interface IP address and / or the preset northbound interface IP address include the following three cases: a separate preset southbound interface IP address, or a separate preset northbound interface IP address, or a preset southbound interface. Forwarding interface IP address and preset northbound interface IP address.
- the first mapping relationship may be used for the target device to access the first server.
- the second server is configured to obtain the status of the first server and the second mapping relationship, and if the status is a fault status, send the second mapping relationship to the target device based on the border gateway protocol.
- the second mapping relationship is a mapping relationship between an IP address associated with the first server and a local IP address of the second server. The second mapping relationship is used for the target device to access the second server.
- the target device uses the same IP address, that is, the IP address associated with the first server to access the first server and the second server, there is no need for the user or manager to modify the IP address to access the first server to access the second server.
- Server switching since the IP addresses associated with the first server are sent to the target device as the first server and the second server, rather than the routing device of the first server and the routing device of the second server, there is no need to set priority on the routing device Level to control who publishes the IP address associated with the first server to the target device, but the second server itself obtains the status of the first server, and when the status is faulty, the target server is published to the target device.
- the linked IP address realizes the automatic switching between the first server and the second server, reducing the workload of the management staff.
- FIG. 1 is a structural block diagram of a communication system according to an embodiment of the present application.
- the communication system provided in the embodiment of the present application includes a first server 101 and a second server 102.
- the first server 101 and the second server 102 may be servers for load balancing, or servers for other purposes, which are not specifically limited in the embodiments of the present application.
- the first server 101 and the second server 102 may be physical servers or virtual servers.
- the local IP address of the first server 101 is a physical IP address; if the first server 101 is a virtual server, the local IP address of the first server is a virtual IP address.
- the local IP address of the second server 102 is a physical IP address; if the second server 102 is a virtual server, the local IP address of the second server 102 is a virtual IP address.
- the number of the first servers 101 may be one or plural; the number of the second servers 102 may be one or plural.
- the first server 101 and the second server 102 may be in the same autonomous system (AS), or may belong to different autonomous domains.
- AS autonomous system
- the first server 101 and the second server 102 each have a southbound interface and a northbound interface, where the southbound interface corresponds to a southbound network device, and the northbound interface corresponds to a northbound user terminal.
- the southbound network device may be, for example, a router, a wireless access point (AP), or a switch.
- the northbound user terminal may be, for example, a device such as a mobile phone, a computer, a notebook computer, or an IPAD.
- the IP address of the southbound interface and the IP address of the northbound interface can be the same or different.
- the IP address of the southbound interface is the same, and the IP address of the northbound interface is the same, that is, the IP address of the southbound interface of the first server 101 and the IP address of the southbound interface of the second server 102 are preset south.
- IP address of the northbound interface; the IP address of the northbound interface of the first server 101 and the IP address of the northbound interface of the second server 102 are both preset northbound interface IP addresses.
- the first server 101 is configured to obtain a first mapping relationship, and send the first mapping relationship to a target device based on a border gateway protocol (BGP).
- BGP border gateway protocol
- the first mapping relationship is a mapping relationship between an Internet protocol IP address associated with the first server and a local IP address of the first server 101.
- the IP address associated with the first server 101 includes a preset southbound interface IP address and / Or preset northbound interface IP address.
- the first mapping relationship is used for the target device to access the first server 101.
- the second server 102 is configured to obtain a status of the first server 101 and a second mapping relationship. If the status is a fault status, the second server 102 sends a second mapping relationship to the target device based on the border gateway protocol.
- the second mapping relationship is a mapping relationship between an IP address associated with the first server 101 and a local IP address of the second server 102.
- the second mapping relationship is used for the target device to access the second server 102.
- the IP addresses associated with the first server 101 may be stored in the first server 101 and the second server 102 through a configuration method in advance, or may be stored in a certain way by the first server 101 and the second server.
- the network devices connected to the server 102 are uniformly distributed to the first server 101 and the second server 102 so as to form a first mapping relationship or a second mapping relationship.
- the first server 101 sends a first mapping relationship to the target device based on the border gateway protocol. If the target device and the first server 101 are in the same autonomous domain, they are sent based on the internal border gateway protocol (IBGP); if the target device and the first server 101 are not in the same autonomous domain, they are based on the external border Gateway protocol (external border gateway protocol, EBGP) sending.
- IBGP internal border gateway protocol
- EBGP external border gateway protocol
- the second server 102 sends a second mapping relationship to the target device based on the border gateway protocol. If the target device and the second server 102 are located in the same autonomous domain, then send based on IBGP; if the target device and the second server 102 are not in the same autonomous domain, then send based on EBGP.
- the target device includes a southbound network device and / or a northbound user terminal.
- the southbound network equipment may include routing equipment, such as routers, switches, and so on.
- the first server 101 sending the first mapping relationship to the target device based on the border gateway protocol may be specifically: the first server 101 sends the first route to the routing device based on the border gateway protocol.
- the first routing entry generation instruction carries a first mapping relationship.
- the first routing entry generation instruction is used to instruct a routing device to generate a first routing entry and a purpose of the first routing entry according to the first mapping relationship.
- the address is the IP address associated with the first server 101, and the next hop address of the first routing entry is the local IP address of the first server.
- the routing device may look up the first routing entry according to the IP address associated with the first server 101 carried in the received message, and determine the next hop address corresponding to the IP address associated with the first server, that is, the first A server 101 has a local IP address, and then sends a message to the first server 101.
- the first server 101 may send a first routing table entry generation instruction to the routing device, where the instruction carries a first mapping relationship. After receiving the first routing table entry generation instruction, the routing device generates a first routing table entry according to the first mapping relationship carried therein.
- the second server 102 sending the second mapping relationship to the target device based on the border gateway protocol may be specifically: the second server 102 sends the second mapping relationship to the routing device based on the border gateway protocol.
- a second routing table entry generation instruction, the second routing table entry generation instruction carries a second mapping relationship, and the second routing table entry generation instruction is used to instruct a routing device to generate a second routing table entry according to the second mapping relationship, and the second routing table
- the destination address of the entry is the IP address associated with the first server 101, and the next hop address of the first routing table entry is the local IP address of the second server 102.
- the routing device may look up the second routing table entry according to the IP address associated with the second server 102 carried in the received message, and determine the next hop address corresponding to the IP address associated with the first server 101, that is, The local IP address of the first server 101 then sends a message to the second server 102.
- the second server 102 may send a second routing table entry generation instruction to the routing device, where the instruction carries a second mapping relationship. After receiving the second routing table entry generation instruction, the routing device generates a second routing table entry according to the second mapping relationship carried therein.
- the target device is a non-routing device, such as a user terminal
- the first server 101 and the second server 102 may be connected to the target device through the routing device.
- the interaction between the first server 101 and the second server and the routing device is as described above. I won't repeat them here.
- the IP address of the routing device may be stored in the user terminal in advance, so as to initiate access to the server corresponding to the IP address of the first server 101 according to the IP address of the routing device. Request.
- the second server 102 in order to automatically switch the target device from accessing the first server 101 to accessing the second server 102, the second server 102 obtains the status of the first server 101, and if the status of the first server 101 is a fault status , The second mapping relationship is sent to the target device, so that the target device accesses the second server 102 according to the second mapping relationship.
- the second server 102 may include a second identity setting module and a second mapping relationship sending module.
- the second identifier setting module is configured to set the master and backup identifiers of the second server 102 according to the status of the first server 101. If the state of the first server 101 is the working state, the second identifier setting module sets the master and backup identifiers of the second server 101 to the identifier corresponding to the standby server, for example, 0. If the state of the first server 101 is a fault state, the second identifier setting module sets the primary and secondary identifiers of the second server 102 to an identifier corresponding to the primary server, for example, 1.
- the second mapping relationship sending module does not send the second mapping relationship to the target device when it detects that the primary and secondary identifications of the second server 102 are identifications corresponding to the standby server.
- the second mapping relationship is sent to the target device.
- the second mapping relationship is not sent to the target device here, and the purpose is to prevent the target device from accessing the second server 102 according to the second mapping relationship.
- the second server 102 controls the target device to access the second server 102 by sending a second routing table entry generation instruction to the target device, not sending the second mapping relationship to the target device means not sending it to the target device.
- the second routing table entry generation instruction is not sent to the target device here, and the purpose is to prevent the target device from accessing the second server 102 according to the second mapping relationship.
- the second mapping relationship is sent to the target device, so that the target device can access the second server 102 according to the second mapping relationship.
- sending the second mapping relationship to the target device means sending the second device to the target device. Routing table entry generation instruction.
- a second delete instruction may be sent to the target device, where the second delete instruction carries a second mapping relationship, and the second delete instruction is used by the target device to delete the second routing table entry in the target device.
- the first server 101 may include a first identity setting module and a first mapping relationship sending module.
- the first identifier setting module is configured to set the master and backup identifiers according to the status of the first server 101. If the state of the first server 101 is the working state, the first identifier setting module sets the master and backup identifiers of the first server 101 to identifiers corresponding to the master server, for example, 1. If the state of the first server 101 is a fault state, the first identifier setting module sets the primary and secondary identifiers of the first server 101 to an identifier corresponding to the secondary server, for example, 0.
- the first mapping relationship sending module sends the first mapping relationship to the target device when it detects that the identifier stored in the first identity setting module is the identity corresponding to the master server; and detects the master stored in the first identity setting module.
- the standby identifier is an identifier corresponding to the standby server, the first mapping relationship is not sent to the target device.
- sending the first mapping relationship to the target device is to allow the target device to access the first server 101 according to the first mapping relationship.
- sending the first mapping relationship to the target device means sending the first device to the target device. Routing table entry generation instruction.
- the first mapping relationship is not sent to the target device, and the purpose is to prevent the target device from accessing the first server 101 according to the first mapping relationship.
- the first server 101 controls the target device to access the first server 101 by sending a first routing table entry generation instruction to the target device, then not sending the first mapping relationship to the target device means not sending the target device The first routing table entry generation instruction.
- a first delete instruction may be sent to the target device, where the first delete instruction carries a first mapping relationship, and the first delete instruction is used by the target device to delete the first routing entry in the target device.
- the second server 102 serving as the standby server may receive the primary server, that is, the heartbeat message periodically sent by the first server 101. If a heartbeat message sent by the server 101, the first server 101 is considered to be faulty.
- the first server 101 when the first server 101 is used as the primary server, the first server 101 needs to synchronize service data to the standby server, that is, the second server 102.
- the second server 102 When the second server 102 is upgraded from the standby server to the primary server, the second server 102 needs to synchronize the business data to the first server 101 where the fault is recovered to ensure the reliability of the data.
- the target device may use the same IP address, that is, the IP address associated with the first server to access the first server 101 and the second server 102, so the user does not need to modify the IP address to access the first server from the first server.
- Switch from server 101 to access second server 102 since the first mapping relationship is stored by the first server 101 instead of the routing device of the first server 101, and the second mapping relationship is stored by the second server 102 instead of the routing device of the second server 102, it is not necessary
- the priority is set on the routing device to control who publishes the IP address associated with the first server to the target device. Instead, the second server 102 obtains the status of the first server 101 by itself.
- the first The two servers 102 publish the IP address associated with the first server to the target device, so that the target device automatically switches from accessing the first server 101 to accessing the second server 102 according to the IP address associated with the first server, reducing management staff Workload.
- the agile controller-campus is a scene management and control system for cloud campus solutions. It supports network business management, network security management, user access management, network monitoring, network quality analysis, and network applications. Analysis, alerting and reporting services.
- the cloud management platform which has higher requirements for the reliability of cloud park products. In addition to data backup and recovery, it also requires the provision of offsite disaster recovery functions.
- the primary and secondary servers are deployed in different regions. When the cloud platform of the primary server fails due to scenarios such as earthquakes, fires, or fiber digging, the sustainability of management services needs to be ensured, that is, it can be switched to a different region from the primary server Standby servers continue to provide business capabilities.
- the system 10 includes a server cluster 20, a server cluster 30, and a routing device 40.
- the server cluster 20, the server cluster 30, and the routing device 40 are connected to each other.
- the routing device 40 is connected to a northbound user terminal or a southbound network device.
- the server cluster 20 and the server cluster 30 may belong to different autonomous domains.
- the server cluster 20 belongs to AS100 and the server cluster 30 belongs to AS200.
- the server cluster 20 includes a server 201, a server 202, and a routing device 203.
- the server 201, the server 202, and the routing device 203 are connected to each other.
- the server cluster 30 includes a server 301, a server 302, and a routing device 303.
- the server 301, the server 302, and the routing device 303 are mutually connected.
- the server cluster 20 is a master server cluster
- the server cluster 30 is a standby server cluster.
- the server 201 is the master server
- the server 202 is the standby server.
- the server 301 is the master server
- the server 302 is the standby server.
- the server cluster 20 and the server cluster 30 may be located in different regions.
- the server cluster 20 is located in Beijing and the server cluster 30 is located in Shanghai.
- each server can also be deployed in a different location.
- server 201 in server cluster 20 is located in Haidian District
- server 202 is located in Chaoyang District.
- the server 201, the server 202, the server 301, and the server 302 are all load balancing servers, that is, they perform a load balancing function. They can be physical servers or virtual servers.
- Each of the above four servers can have a southbound interface and a northbound interface, respectively.
- the IP address of the southbound interface and the IP address of the northbound interface can be the same or different.
- the IP address of the southbound interface is 100.100.10.100/32
- the IP address of the northbound interface is 100.100.10.101/32.
- the disaster recovery processing service may include a disaster recovery management service (drService) and a disaster recovery data synchronization service (repService).
- drService is responsible for disaster recovery operation management such as heartbeat keep-alive and active / standby backup of the disaster recovery master or backup server or cluster
- repService is responsible for disaster recovery database, primary and backup copy tasks of files, etc.
- the drService of the server 201 sets its master and backup identifiers to identifiers corresponding to the master server.
- the server 202 can receive the heartbeat message sent by the server 201, so the drService of the server 202 sets its primary and secondary identifiers to the identifier corresponding to the secondary server.
- the drService of the server 201 sets its primary and secondary identifiers to the identifier corresponding to the secondary server. At this time, if the server 202 cannot receive the heartbeat message sent by the server 201 within a preset period of time, the drService of the server 202 sets its master and backup identifiers to the identifiers corresponding to the master server.
- the repService of the server 201 is responsible for synchronizing its business data and files to the server 202.
- the repService of the server 202 is responsible for synchronizing its business data and files to the server 201.
- BGP Service border gateway protocol service
- the server 201 and the server 202 can achieve the purpose of publishing routing information by calling BGP Service.
- a BGP peer is created by calling a BGP service.
- the peers of the server 201 and the server 202 are devices that are neighbors to each other.
- the routing device 203 may be both a peer of the server 201 and a peer of the server 202.
- the server 201 may send the southbound interface IP address and / or the northbound interface IP address with the server 201 to the routing device 203
- the server 202 may send the southbound interface IP address and / or the northbound interface IP address with the server 202 to the routing device. 203.
- the BGP in the BGP service can be specifically IBGP. If the routing device 203 is located outside the AS 100, the BGP in the BGP service can be specifically EBGP.
- the server 201 can call its own IBGP service to send the mapping relationship between the IP address associated with the server 201 and the local IP address of the server 201 to the routing device 203, and the routing device 203 according to the mapping Relationship establishment routing table entry L1.
- the IP address associated with the server 201 is a southbound interface IP address and / or a northbound interface IP address of the server 201.
- the destination address in the routing entry L1 is the IP address associated with the server 201, and the next hop address is the local IP address of the server 201.
- the local IP address of the server 201 is different from the IP address associated with the server 201, and the local address of the server 201 is, for example, 100.10.1.0/24.
- the routing device 203 may further upload the mapping relationship between the IP address associated with the server 201 and the local IP address of the routing device 203 to the routing device 40 to establish a routing entry L2 in the routing device 40.
- the destination address of L2 is the IP address associated with the server 201, and the next hop address is the local address of the routing device 203.
- the server 202 can call its own IBGP Service to cancel the sending action.
- the sending action is the action of sending the mapping relationship between the IP address associated with the server 201 and the local IP address of the server 202 to the routing device 203, in order not to let The routing device 203 establishes a routing entry L3 according to the mapping relationship.
- the server 202 may call its own IBGP service to send a delete instruction M1 To delete the routing table entry L3 stored in the routing device 203.
- the routing device 40 when the routing device 40 receives the message, it determines the next hop address from the routing entry L2 according to the IP address associated with the server 201 carried in the message, that is, the local IP address of the routing device 203, and The message is forwarded to the routing device 203. After receiving the message, the routing device 203 determines the next hop address from the routing entry L1 according to the IP address associated with the server 201 in the message, that is, the local IP address of the server 201, and then forwards the message. To server 201.
- the server 202 can call its own IBGP service to send the mapping relationship between the IP address associated with the server 201 and the local IP address of the server 202 to the routing device 203, and the routing device 203 according to the mapping Relationship establishment routing entry L3.
- the local IP address of the server 202 is different from the IP address associated with the server 201, and the local address of the server 202 is, for example, 100.10.1.1/24.
- the server 201 Since the server 201 is downgraded from the primary server to the standby server at this time, it calls its own IBGP service to cancel the sending action.
- the sending action is to send the mapping relationship between the IP address associated with the server 201 and the local IP address of the server 201.
- the purpose of cancellation is to prevent the routing device 203 from establishing a routing table entry L1 according to the mapping relationship.
- the server 201 can call its own IBGP service to send a delete instruction M2 To delete the routing table entry L1 stored in the routing device 203.
- the routing device 40 when the routing device 40 receives the message, it determines the next hop address from the routing entry L2 according to the IP address associated with the server 201 carried in the message, that is, the local address of the routing device 203, and The message is forwarded to the routing device 203. After receiving the message, the routing device 203 determines the next hop address from the routing entry L3 according to the IP address associated with the server 201 in the message, that is, the local IP address of the server 202, and then forwards the message. To server 202.
- the server cluster 30 needs to be started.
- the master server in the server cluster 20 may call drService to periodically send a heartbeat message to the server (for example, the server 301) of the server cluster 30. If the server of the server cluster 30 does not receive the heartbeat report within a preset time period Text, it is considered that the server cluster 20 has failed.
- the servers of the server cluster 30, for example, the server 301 calls drService to change its own standby server ID to the primary server ID, and calls BGP Service to send the routing device 303 the IP address associated with the server 201 and the server 301 in the server 301 Mapping relationship between local IP addresses in order to establish routing entry L4 in routing device 303, the destination address of routing entry L4 is the IP address associated with server 201, and the next hop address is the local IP of server 301 address.
- the local IP address of the server 301 is different from the IP address associated with the server 201.
- the local address of the server 301 is 100.10.2.0/24.
- the routing device 303 sends the IP address associated with the server 201 and the local IP address of the routing device 303 to the routing device 40, so that the routing device 40 can establish a routing entry L5, and the destination address of the routing entry L5 is for the server
- the IP address associated with 201, and the next hop address is the local IP address of the routing device 303.
- the southbound interface IP address of the server in server cluster 20 is the same as the southbound interface IP address of the server in server cluster 30, and the northbound interface IP address of the server in server cluster 20 is the same as the northbound interface IP address of the server in server cluster 30.
- switching between the server cluster 20 and the server cluster 30 does not require user awareness, and is convenient for users to access.
- the routing device 40 When the routing device 40 receives the packet, it finds the corresponding next hop address from the routing entry L5 according to the IP address associated with the server 201 in the packet, that is, the local IP address of the routing device 303, and sends the packet Forward to routing device 303.
- the routing device 303 finds the next hop address from the routing table entry L4 according to the IP address associated with the server 201 in the message, that is, the local IP address of the server 301, so that the server 301 receives the message.
- the switching between the server 301 and the server 302 is referred to the above-mentioned switching between the server 201 and the server 202, which is not described herein again.
- FIG. 3 is a schematic flowchart of a communication method according to an embodiment of the present application.
- the communication method provided in the embodiment of the present application can be applied to the first server in the embodiment shown in FIG. 1.
- the method specifically includes the following steps:
- S101 Obtain a first mapping relationship, where the first mapping relationship is a mapping relationship between an Internet Protocol IP address associated with the first server and a local IP address of the first server, and the first mapping relationship
- the IP address associated with a server includes a preset southbound interface IP address and / or a preset northbound interface IP address;
- S102 Send the first mapping relationship to a target device based on a border gateway protocol.
- the first server sends a mapping relationship between the IP address associated with the first server and the local IP address of the first server to the target device, that is, the first mapping relationship.
- the target The device may access the first server according to the first mapping relationship.
- the IP address associated with the first server can be used to access the first server, and the IP address of the first server does not need to be used to access the first server, that is, the user can access without having to sense the first server.
- the target device When the first server fails and needs to be replaced with the second server, the target device only needs to change the mapping relationship between the IP address associated with the first server and the IP address of the first server to be associated with the first server The mapping relationship between the IP address of the IP address and the IP address of the second server is sufficient. The user does not need to change the accessed address when switching between servers, which provides convenience to the user. At the same time, since the IP address associated with the first server is sent to the target device as the first server, not the routing device of the first server, there is no need to set a priority on the routing device to control whether the target device accesses the first server, Reduced workload for managers.
- the sending a first mapping relationship to the target device based on a border gateway protocol includes:
- the first routing table entry generation instruction carries the first mapping relationship, and the first routing table entry generation instruction is used to indicate the The routing device generates a first routing entry according to the first mapping relationship.
- the destination address of the first routing entry is the IP address associated with the first server.
- the one-hop address is the local IP address of the first server.
- the method further includes:
- the sending the first mapping relationship to a target device based on a border gateway protocol includes:
- the first mapping relationship is sent to the target device based on a border gateway protocol.
- the first server includes a load balancing server.
- FIG. 4 is a schematic flowchart of a communication method according to an embodiment of the present application.
- the communication method provided in the embodiment of the present application may be applied to the second server shown in FIG. 1, and specifically includes the following steps:
- S201 Obtain a state of a first server and a second mapping relationship, where the second mapping relationship is a mapping relationship between an IP address associated with the first server and a local IP address of the second server, where The IP address associated with the first server includes a preset southbound interface Internet protocol IP address and / or a preset northbound interface IP address;
- S202 If the state is a fault state, send the second mapping relationship to the target device based on a border gateway protocol.
- the second server sends the mapping relationship between the Internet Protocol IP address associated with the first server and the local IP address of the second server to the target device, that is, the second mapping relationship.
- the target device may access the second server according to the second mapping relationship.
- the IP address associated with the second server can be used to access the second server, and the IP address of the second server does not need to be used to access the second server, that is, the user can access without having to sense the second server. That is, when the first server fails and needs to be replaced with the second server, it is only necessary to change the mapping relationship between the IP address associated with the first server and the first server to the IP associated with the first server.
- the mapping relationship between the address and the second server is sufficient, and the user does not need to change the accessed address when switching between servers, which provides convenience to the user.
- the IP address associated with the first server is sent to the target device as the second server, not the routing device of the second server, there is no need to set a priority on the routing device to control whether the routing device accesses the second server.
- the second server itself obtains the status of the first server, and when the status is faulty, it publishes the IP address associated with the first server to the target device to achieve access to the second server and reduce the management staff ’s Workload.
- the target device includes a routing device
- the sending the second mapping relationship to the target device based on a border gateway protocol includes:
- the routing device sends a second routing table entry generation instruction to the routing device based on a border gateway protocol, the second routing table entry generation instruction carrying the second mapping relationship, and the second routing table entry generation instruction used to instruct the routing device
- the routing device generates a second routing entry according to the second mapping relationship.
- the destination address of the second routing entry is the IP address associated with the first server.
- the one-hop address is the local IP address of the second server.
- the sending the second mapping relationship to the target device based on the border gateway protocol includes:
- the second mapping relationship is sent to the target device based on a border gateway protocol.
- the second server includes a load balancing server.
- this figure is a structural block diagram of a communication device according to an embodiment of the present application.
- the communication device provided in the embodiment of the present application is applied to a first server, and the device includes:
- the obtaining unit 501 is configured to obtain a first mapping relationship, where the first mapping relationship is a mapping relationship between an Internet Protocol IP address associated with the first server and a local IP address of the first server, where The IP address associated with the first server includes a preset southbound interface IP address and / or a preset northbound interface IP address;
- the sending unit 502 is configured to send the first mapping relationship to a target device based on a border gateway protocol.
- the target device includes a routing device
- the sending unit 502 is configured to send a first routing table entry generation instruction to the routing device based on a border gateway protocol, where the first routing table entry generation instruction carries the first mapping relationship, and the first routing table
- the entry generation instruction is used to instruct the routing device to generate a first routing entry according to the first mapping relationship, and a destination address of the first routing entry is the IP address associated with the first server.
- the next hop address of the first routing entry is the local IP address of the first server.
- the device further includes:
- a deleting unit configured to send a first deletion instruction to the routing device if the state of the first server is a fault state, and the first deletion instruction is used to instruct the routing device to delete the first routing entry .
- the sending unit is configured to set an active / standby identifier of the first server to an identifier corresponding to the active server if the state of the first server is a working state; if the first server is detected When the primary and secondary identifiers are the identifiers corresponding to the primary server, the first mapping relationship is sent to the target device based on a border gateway protocol.
- the first server includes a load balancing server.
- this figure is a structural block diagram of another communication device according to an embodiment of the present application.
- the communication device provided in the embodiment of the present application is applied to a second server, and the device includes:
- An obtaining unit 601 is configured to obtain a state of a first server and a second mapping relationship, where the second mapping relationship is a mapping between an IP address associated with the first server and a local IP address of the second server Relationship, the IP address associated with the first server includes a preset southbound interface Internet protocol IP address and / or a preset northbound interface IP address;
- the sending unit 602 is configured to send the second mapping relationship to a target device based on a border gateway protocol if the status is a fault status.
- the target device includes a routing device
- the sending unit 602 is configured to send a second routing table entry generation instruction to the routing device based on a border gateway protocol, where the second routing table entry generation instruction carries the second mapping relationship, and the second routing table
- the entry generation instruction is used to instruct the routing device to generate a second routing table entry according to the second mapping relationship.
- the destination address of the second routing table entry is the IP address associated with the first server.
- the next hop address of the second routing entry is the local IP address of the second server.
- the sending unit 602 is configured to set an active / standby identifier of the second server to an identifier corresponding to the active server if the state of the first server is a fault state; when the second server is detected, When the primary and secondary identifiers of the server are identifiers corresponding to the primary server, the second mapping relationship is sent to the target device based on a border gateway protocol.
- the second server includes a load balancing server.
- this figure is a structural block diagram of a server according to an embodiment of the present application.
- the server 700 provided in this embodiment of the present application is a first server, and the server 700 can implement the functions of the first server in the embodiment shown in FIG. 3.
- the server 700 includes: a processor 701, a memory 702, and a communication unit 703, where the memory 702 is configured to store instructions;
- the processor 701 is configured to execute the instructions in the memory and execute the communication method of the first server in the embodiment shown in FIG. 3.
- the communication unit 703 is configured to communicate with a second server.
- the processor 701, the memory 702, and the communication unit 703 are connected to each other through a bus 704; the bus 704 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus Wait.
- PCI peripheral component interconnect
- EISA extended industry standard architecture
- the bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used in FIG. 7, but it does not mean that there is only one bus or one type of bus.
- the memory 702 may include an obtaining unit 7021 and a sending unit 7022, which respectively store computer-readable instructions for implementing the obtaining unit 501 and the sending unit 502 shown in FIG.
- the processor 701 specifically implements the functions of the obtaining unit 501 by executing instructions in the obtaining unit 7021, and implements the functions of the sending unit 502 by executing instructions of the sending unit 7022.
- this figure is a structural block diagram of another server provided by an embodiment of the present application.
- the server 800 provided in this embodiment of the present application is a second server, and the server 800 can implement the functions of the second server in the embodiment shown in FIG. 4.
- the server 800 includes: a processor 801, a memory 802, and a communication unit 803, where the memory 802 is configured to store instructions;
- the processor 801 is configured to execute the instructions in the memory and execute the communication method of the first server in the embodiment shown in FIG. 3.
- the processor 801, the memory 802, and the communication unit 803 are connected to each other through a bus 804; the bus 804 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus Wait.
- PCI peripheral component interconnect
- EISA extended industry standard architecture
- the bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used in FIG. 8, but it does not mean that there is only one bus or one type of bus.
- the memory 802 may include an obtaining unit 8021 and a sending unit 8022, which respectively store computer-readable instructions for implementing the obtaining unit 601 and the sending unit 602 shown in FIG.
- the processor 801 specifically implements the function of the obtaining unit 601 by executing instructions in the obtaining unit 8021, and implements the function of the sending unit 602 by executing instructions of the sending unit 8022.
- the memory 701 and the memory 801 may be random-access memory (RAM), flash memory, flash, read-only memory (ROM), erasable programmable read-only memory (erasable, programmable, read-only) memory, EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard drives, mobile hard drives, CD-ROMs, or any other form of storage known to those skilled in the art medium.
- RAM random-access memory
- ROM read-only memory
- EEPROM electrically erasable programmable read-only memory
- registers hard drives, mobile hard drives, CD-ROMs, or any other form of storage known to those skilled in the art medium.
- the memory 701 may represent only one memory or a plurality of memories; similarly, the memory 801 may represent only one memory or a plurality of memories.
- the processor 702 and the processor 802 may be, for example, a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), and an application-specific integrated circuit (ASIC). , Field programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logical blocks, modules, and circuits described in connection with the present disclosure.
- a processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and so on.
- the processor 702 may represent only one processor or multiple processors; similarly, the processor 802 may represent only one processor or multiple processors.
- the communication unit 703 and the communication unit 803 may be, for example, an I / O interface, a LAN interface, a WAN interface, and the like.
- An embodiment of the present application further provides a computer-readable storage medium including instructions that, when run on a computer, cause the computer to execute the above communication method applied to the first server and / or the second server.
- the embodiment of the present application further provides a computer program product containing instructions, which when executed on a computer, causes the computer to execute the above communication method applied to the first server and / or the second server.
- the disclosed systems, devices, and methods may be implemented in other ways.
- the device embodiments described above are only schematic.
- the division of the unit is only a logical function division.
- multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not implemented.
- the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, which may be electrical, mechanical or other forms.
- the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objective of the solution of this embodiment.
- each functional unit in each embodiment of the present application may be integrated into one processor, or each unit may exist separately physically, or two or more units may be integrated into one unit.
- the above integrated unit may be implemented in the form of hardware or in the form of software functional unit.
- the integrated unit When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium.
- the technical solution of the present application is essentially a part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium. , Including a plurality of instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present application.
- the foregoing storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes .
- the functions described in the present invention may be implemented by hardware, software, firmware, or any combination thereof.
- the functions may be stored on a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium.
- Computer-readable media includes computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another.
- a storage media may be any available media that can be accessed by a general purpose or special purpose computer.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Embodiments of the present application disclose a communication method, device, and system, which are used to implement automatic switching between servers and to reduce workloads of users and administrators. The communication system proposed in the embodiments of the present application comprises a first server and a second server. The first server is used to acquire a first mapping relationship, and to send, on the basis of the Border Gateway Protocol, the first mapping relationship to a target device. The first mapping relationship is a mapping relationship between an IP address associated with the first server and a local IP address of the first server, and the IP address associated with the first server comprises a preset southbound interface IP address and/or a preset northbound interface IP address. The second server is used to acquire a state of the first server and a second mapping relationship. If the state is a fault state, the second server then sends, on the basis of the Border Gateway Protocol, the second mapping relationship to the target device. The second mapping relationship is a mapping relationship between an IP address associated with the first server and a local IP address of the second server.
Description
本申请要求于2018年9月19日提交中国国家知识产权局、申请号为CN201811095768.6、发明名称为“一种通信系统、方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed on September 19, 2018 with the State Intellectual Property Office of China, with an application number of CN201811095768.6, and an invention name of "a communication system, method and device", the entire contents of which are hereby incorporated by reference Incorporated in this application.
本申请涉及网络通信领域,尤其涉及一种通信系统、方法及装置。The present application relates to the field of network communication, and in particular, to a communication system, method, and device.
随着通信技术的发展,云服务应用越来越广泛。通过云服务例如可以为用户提供网络业务自动化部署、自动化运维等服务,所以保证云服务的正常运行非常重要。为了保证云服务的可靠性,需要支持云服务管理的服务器具有容灾功能,即当主服务器出现故障后,能够及时的将业务切换到备服务器。With the development of communication technology, cloud services are becoming more and more widely used. Cloud services can provide users with services such as automated deployment of network services, automated operation and maintenance, and so it is very important to ensure the normal operation of cloud services. In order to ensure the reliability of cloud services, servers that support cloud service management must have a disaster tolerance function, that is, when the primary server fails, services can be switched to the standby server in a timely manner.
目前,支持云服务管理的服务器具有南向接口和北向接口。在传统技术中,主服务器南向接口的互联网协议(internet protocol,IP)地址和备服务器南向接口的IP地址不同,主服务器北向接口的IP地址和备服务器北向接口的IP地址不同。所以,在主服务器出现故障之后,就需要管理人员手动在访问南向接口的网络设备中将主服务器的南向接口IP地址替换为备服务器的南向接口IP地址,以实现对备服务器的访问。同理,需要用户通过访问北向接口的用户终端将主服务器的北向接口IP地址手动替换为备服务器的北向接口IP地址,以实现对备服务器的访问。Currently, servers that support cloud service management have southbound and northbound interfaces. In traditional technologies, the Internet protocol (IP) address of the southbound interface of the primary server is different from the IP address of the southbound interface of the standby server, and the IP address of the northbound interface of the primary server is different from the IP address of the northbound interface of the standby server. Therefore, after the failure of the primary server, the administrator needs to manually replace the southbound interface IP address of the primary server with the southbound interface IP address of the standby server in the network equipment accessing the southbound interface to achieve access to the standby server. . Similarly, the user needs to manually replace the northbound interface IP address of the primary server with the northbound interface IP address of the standby server through the user terminal accessing the northbound interface to implement access to the standby server.
由此可见,在主服务器切换至备服务器的过程中,需要北向的用户终端和南向的网络设备进行IP地址替换操作,给用户和管理人员造成不便。It can be seen that in the process of switching from the primary server to the standby server, it is necessary to perform IP address replacement operations on the user terminal in the north direction and the network equipment in the south direction, which causes inconvenience to users and management personnel.
发明内容Summary of the Invention
本申请实施例提供了一种通信方法、装置及系统,用于实现主服务器和备服务器之间的自动切换,减少用户和管理人员的工作量。The embodiments of the present application provide a communication method, device, and system, which are used to implement automatic switching between a primary server and a standby server, and reduce the workload of users and management personnel.
本申请实施例提供了一种通信系统,包括第一服务器和第二服务器。第一服务器和第二服务器连接。第一服务器和第二服务器可以是负载均衡服务器或其他类型的服务器,本申请不进行限定。第一服务器和第二服务器可以是实体服务器,也可以是虚拟服务器。第一服务器的数目可以是一个,也可以是多个;第二服务器的数目可以是一个,也可以是多个。第一服务器和第二服务器可以在同一个自治域中,也可以分属于不同的自治域。第一服务器和第二服务器均具有南向接口和北向接口。An embodiment of the present application provides a communication system including a first server and a second server. The first server and the second server are connected. The first server and the second server may be load balancing servers or other types of servers, which are not limited in this application. The first server and the second server may be physical servers or virtual servers. The number of the first servers may be one or multiple; the number of the second servers may be one or multiple. The first server and the second server may be in the same autonomous domain, or may belong to different autonomous domains. Each of the first server and the second server has a southbound interface and a northbound interface.
其中,第一服务器,用于获取第一映射关系,并基于边界网关协议向目标设备发送第一映射关系。第一映射关系为与第一服务器相关联的IP地址和第一服务器的本地IP地址之间的映射关系。与第一服务器相关联的IP地址包括:预设南向接口IP地址和/或预设 北向接口IP地址。其中,预设南向接口IP地址和/或预设北向接口IP地址包括如下三种情况:单独的预设南向接口IP地址,或,单独的预设北向接口IP地址,或,预设南向接口IP地址和预设北向接口IP地址。第一映射关系可以用于目标设备访问第一服务器。The first server is configured to obtain a first mapping relationship and send the first mapping relationship to a target device based on a border gateway protocol. The first mapping relationship is a mapping relationship between an IP address associated with the first server and a local IP address of the first server. The IP address associated with the first server includes: a preset southbound interface IP address and / or a preset northbound interface IP address. The preset southbound interface IP address and / or the preset northbound interface IP address include the following three cases: a separate preset southbound interface IP address, or a separate preset northbound interface IP address, or a preset southbound interface. Forwarding interface IP address and preset northbound interface IP address. The first mapping relationship may be used for the target device to access the first server.
第二服务器,用于获取第一服务器的状态和第二映射关系,若状态为故障状态,则基于边界网关协议向目标设备发送第二映射关系。第二映射关系为与第一服务器相关联的IP地址和第二服务器本地IP地址之间的映射关系。第二映射关系可以用于目标设备访问第二服务器。The second server is configured to obtain the status of the first server and the second mapping relationship, and if the status is a fault status, send the second mapping relationship to the target device based on the border gateway protocol. The second mapping relationship is a mapping relationship between an IP address associated with the first server and a local IP address of the second server. The second mapping relationship may be used for the target device to access the second server.
由于目标设备采用相同的IP地址,即与第一服务器相关联的IP地址来访问第一服务器和第二服务器,所以无需用户或管理人员通过修改IP地址来实现从访问第一服务器到访问第二服务器的切换。同时,由于向目标设备发送与第一服务器相关联的IP地址是第一服务器和第二服务器,而不是第一服务器的路由设备和第二服务器的路由设备,所以不需要在路由设备上设置优先级来控制谁来向目标设备发布与第一服务器相关联的IP地址,而是由第二服务器自己通过获取第一服务器的状态,在状态为故障状态时,向目标设备发布与第一服务器相关联的IP地址,实现了第一服务器和第二服务器之间的自动切换,减少了管理人员的工作量。Because the target device uses the same IP address, that is, the IP address associated with the first server to access the first server and the second server, there is no need for the user or manager to modify the IP address to access the first server to access the second server. Server switching. At the same time, since the IP addresses associated with the first server are sent to the target device as the first server and the second server, rather than the routing device of the first server and the routing device of the second server, there is no need to set priority on the routing device Level to control who publishes the IP address associated with the first server to the target device, but the second server itself obtains the status of the first server, and when the status is faulty, the target server is published to the target device. The linked IP address realizes the automatic switching between the first server and the second server, reducing the workload of the management staff.
本申请实施例还提供了一种通信方法,包括如下步骤:首先,第一服务器获取第一映射关系,第一映射关系为与第一服务器相关联的互联网协议IP地址和第一服务器的本地IP地址之间的映射关系,与第一服务器相关联的IP地址包括预设南向接口IP地址和/或预设北向接口IP地址。其次,第一服务器基于边界网关协议向目标设备发送第一映射关系。第一服务器可以是负载均衡服务器或其他类型的服务器。An embodiment of the present application further provides a communication method including the following steps: First, a first server obtains a first mapping relationship, and the first mapping relationship is an Internet protocol IP address associated with the first server and a local IP of the first server. The mapping relationship between the addresses. The IP address associated with the first server includes a preset southbound interface IP address and / or a preset northbound interface IP address. Second, the first server sends a first mapping relationship to the target device based on the border gateway protocol. The first server may be a load balancing server or another type of server.
在本申请实施例中,第一服务器向目标设备发送与第一服务器相关联的IP地址和第一服务器的本地IP地址之间的映射关系,即第一映射关系,这样,目标设备可以根据第一映射关系访问第一服务器。对于用户而言,可以采用与第一服务器相关联的IP地址来访问第一服务器,而无需采用第一服务器的IP地址来访问第一服务器,即用户无需感知第一服务器就可以实现访问。当第一服务器发生故障,需要更换到第二服务器时,目标设备只需要将与第一服务器相关联的IP地址和第一服务器的IP地址之间的映射关系,改变为与第一服务器相关联的IP地址和第二服务器的IP地址之间的映射关系即可,用户不需要在服务器之间切换的时候改变访问的地址,给用户提供了方便。同时,由于向目标设备发送与第一服务器相关联的IP地址是第一服务器,而不是第一服务器的路由设备,所以不需要在路由设备上设置优先级来控制目标设备是否访问第一服务器,减少了管理人员的工作量。In the embodiment of the present application, the first server sends the mapping relationship between the IP address associated with the first server and the local IP address of the first server to the target device, that is, the first mapping relationship. In this way, the target device can A mapping relationship accesses the first server. For the user, the IP address associated with the first server can be used to access the first server, and the IP address of the first server does not need to be used to access the first server, that is, the user can access without having to sense the first server. When the first server fails and needs to be replaced with the second server, the target device only needs to change the mapping relationship between the IP address associated with the first server and the IP address of the first server to be associated with the first server The mapping relationship between the IP address of the IP address and the IP address of the second server is sufficient. The user does not need to change the accessed address when switching between servers, which provides convenience to the user. At the same time, since the IP address associated with the first server is sent to the target device as the first server, not the routing device of the first server, there is no need to set a priority on the routing device to control whether the target device accesses the first server, Reduced workload for managers.
可选的,目标设备可以包括路由设备。那么,基于边界网关协议向目标设备发送第一映射关系包括:基于边界网关协议向路由设备发送第一路由表项生成指令,第一路由表项生成指令中携带第一映射关系,第一路由表项生成指令用于指示路由设备根据第一映射关系生成第一路由表项,第一路由表项的目的地址为与第一服务器相关联的IP地址,第一路由表项的下一跳地址为第一服务器的本地IP地址。因此,路由设备可以根据接收到的报文携带的与第一服务器相关联的IP地址,查找第一路由表项,确定与第一服务器相关联的IP地址对应的下一跳地址,即第一服务器的本地IP地址,然后将报文发送给第一服务器。Optionally, the target device may include a routing device. Then, sending the first mapping relationship to the target device based on the border gateway protocol includes sending a first routing table entry generation instruction to the routing device based on the border gateway protocol. The first routing table entry generation instruction carries the first mapping relationship and the first routing table. The entry generation instruction is used to instruct the routing device to generate a first routing entry according to the first mapping relationship. The destination address of the first routing entry is the IP address associated with the first server, and the next hop address of the first routing entry is The local IP address of the first server. Therefore, the routing device may look up the first routing table entry according to the IP address associated with the first server carried in the received packet, and determine the next hop address corresponding to the IP address associated with the first server, that is, the first The local IP address of the server, and then sends the message to the first server.
可选的,为了在第一服务器处于故障状态时,令路由设备不再将来自目标设备的报文发送至第一服务器,方法还包括:若第一服务器的状态为故障状态,则向路由设备发送第 一删除指令,第一删除指令用于指示路由设备删除第一路由表项。Optionally, in order to prevent the routing device from sending packets from the target device to the first server when the first server is in a fault state, the method further includes: if the state of the first server is in a fault state, sending the message to the routing device. A first delete instruction is sent. The first delete instruction is used to instruct the routing device to delete the first routing entry.
可选的,基于边界网关协议向目标设备发送第一映射关系具体可以包括:若第一服务器的状态为工作状态,则将第一服务器的主备标识设置为主服务器对应的标识,例如为1。若检测到第一服务器的主备标识为主服务器对应的标识时,则基于边界网关协议向目标设备发送第一映射关系。即作为一种可选的实现方式,通过主备标识来决定是否触发向目标设备发送第一映射关系的动作,而主备标识的具体值可以由第一服务器的状态来决定。Optionally, sending the first mapping relationship to the target device based on the border gateway protocol may specifically include: if the state of the first server is a working state, setting the primary and secondary identifiers of the first server to an identifier corresponding to the primary server, for example, 1 . If the primary and secondary identifications of the first server are detected as the identifications corresponding to the primary server, the first mapping relationship is sent to the target device based on the border gateway protocol. That is, as an optional implementation manner, whether to trigger the action of sending the first mapping relationship to the target device is determined through the active and standby identifiers, and the specific value of the active and standby identifiers may be determined by the status of the first server.
本申请实施例还提供了一种通信方法,包括如下步骤:首先,第二服务器获取第一服务器的状态和第二映射关系,第二映射关系为与第一服务器相关联的IP地址和第二服务器的本地IP地址之间的映射关系,与第一服务器相关联的IP地址包括预设南向接口互联网协议IP地址和/或预设北向接口IP地址。其次,若状态为故障状态,则第二服务器基于边界网关协议向目标设备发送第二映射关系。第二映射关系用于目标设备访问第二服务器。第二服务器可以是负载均衡服务器或其他类型的服务器。An embodiment of the present application further provides a communication method including the following steps: first, the second server obtains a status of the first server and a second mapping relationship, and the second mapping relationship is an IP address associated with the first server and a second mapping relationship; The mapping relationship between the local IP addresses of the servers. The IP address associated with the first server includes a preset southbound interface Internet protocol IP address and / or a preset northbound interface IP address. Secondly, if the state is a fault state, the second server sends a second mapping relationship to the target device based on the border gateway protocol. The second mapping relationship is used for the target device to access the second server. The second server may be a load balancing server or another type of server.
在本申请实施例中,第二服务器向目标设备发送与第一服务器相关联的互联网协议IP地址和第二服务器的本地IP地址之间的映射关系,即第二映射关系,这样,目标设备可以根据第二映射关系访问第二服务器。对于用户而言,可以采用与第二服务器相关联的IP地址来访问第二服务器,而无需采用第二服务器的IP地址来访问第二服务器,即用户无需感知第二服务器就可以实现访问。也就是说,当第一服务器发生故障,需要更换到第二服务器时,只需要将与第一服务器相关联的IP地址和第一服务器之间的映射关系改变为与第一服务器相关联的IP地址和第二服务器之间的映射关系即可,用户不需要在服务器之间切换的时候改变访问的地址,给用户提供了方便。同时,由于向目标设备发送与第一服务器相关联的IP地址是第二服务器,而不是第二服务器的路由设备,所以不需要在路由设备上设置优先级来控制路由设备是否访问第二服务器,而是由第二服务器自己通过获取第一服务器的状态,在状态为故障状态时,向目标设备发布与第一服务器相关联的IP地址,实现了对第二服务器的访问,减少了管理人员的工作量。In the embodiment of the present application, the second server sends the mapping relationship between the Internet Protocol IP address associated with the first server and the local IP address of the second server to the target device, that is, the second mapping relationship. In this way, the target device can And accessing the second server according to the second mapping relationship. For the user, the IP address associated with the second server can be used to access the second server, and the IP address of the second server does not need to be used to access the second server, that is, the user can access without having to sense the second server. That is, when the first server fails and needs to be replaced with the second server, it is only necessary to change the mapping relationship between the IP address associated with the first server and the first server to the IP associated with the first server. The mapping relationship between the address and the second server is sufficient, and the user does not need to change the accessed address when switching between servers, which provides convenience to the user. At the same time, because the IP address associated with the first server is sent to the target device as the second server, not the routing device of the second server, there is no need to set a priority on the routing device to control whether the routing device accesses the second server. Instead, the second server itself obtains the status of the first server, and when the status is faulty, it publishes the IP address associated with the first server to the target device to achieve access to the second server and reduce the management staff ’s Workload.
可选的,目标设备包括路由设备,那么基于边界网关协议向目标设备发送第二映射关系包括:基于边界网关协议向路由设备发送第二路由表项生成指令,第二路由表项生成指令中携带第二映射关系,第二路由表项生成指令用于指示路由设备根据第二映射关系生成第二路由表项,第二路由表项的目的地址为与第一服务器相关联的IP地址,第二路由表项的下一跳地址为第二服务器的本地IP地址。因此,路由设备可以根据接收到的报文携带的与第一服务器相关联的IP地址,查找第二路由表项,确定与第一服务器相关联的IP地址对应的下一跳地址,即第二服务器的本地IP地址,然后将报文发送给第二服务器。Optionally, the target device includes a routing device, and then sending the second mapping relationship to the target device based on the border gateway protocol includes: sending a second routing table entry generation instruction to the routing device based on the border gateway protocol, and the second routing table entry generation instruction carries A second mapping relationship, and a second routing table entry generation instruction is used to instruct a routing device to generate a second routing table entry according to the second mapping relationship, and a destination address of the second routing table entry is an IP address associated with the first server; The next hop address of the routing entry is the local IP address of the second server. Therefore, the routing device may look up the second routing entry according to the IP address associated with the first server carried in the received packet, and determine the next hop address corresponding to the IP address associated with the first server, that is, the second The local IP address of the server, and then sends the message to the second server.
可选的,基于边界网关协议向目标设备发送第二映射关系包括:若第一服务器的状态为故障状态,则将第二服务器的主备标识设置为主服务器对应的标识;当检测到第二服务器的主备标识为主服务器对应的标识时,基于边界网关协议向目标设备发送第二映射关系。即作为一种可选的实现方式,通过主备标识来决定是否触发向目标设备发送第二映射关系的动作,而主备标识的具体值可以由第一服务器的状态来决定。Optionally, sending the second mapping relationship to the target device based on the border gateway protocol includes: if the state of the first server is a fault state, setting the primary and secondary identifiers of the second server to the identifiers corresponding to the primary server; When the primary and secondary identifiers of the server are the identifiers corresponding to the primary server, a second mapping relationship is sent to the target device based on the border gateway protocol. That is, as an optional implementation manner, whether to trigger the action of sending the second mapping relationship to the target device is determined through the primary and secondary identifiers, and the specific value of the primary and secondary identifiers may be determined by the status of the first server.
本申请实施例还提供了一种通信装置,应用于第一服务器,装置包括:获取单元,用于获取第一映射关系,第一映射关系为与第一服务器相关联的互联网协议IP地址和第一服务器的本地IP地址之间的映射关系,与第一服务器相关联的IP地址包括预设南向接口IP地址和/或预设北向接口IP地址;发送单元,用于基于边界网关协议向目标设备发送第一 映射关系。An embodiment of the present application further provides a communication device applied to a first server. The device includes: an obtaining unit configured to obtain a first mapping relationship, where the first mapping relationship is an Internet protocol IP address and a first The mapping relationship between the local IP addresses of a server. The IP address associated with the first server includes a preset southbound interface IP address and / or a preset northbound interface IP address. A sending unit is configured to send a target based on a border gateway protocol. The device sends a first mapping relationship.
可选的,目标设备包括路由设备;发送单元,用于基于边界网关协议向路由设备发送第一路由表项生成指令,第一路由表项生成指令中携带第一映射关系,第一路由表项生成指令用于指示路由设备根据第一映射关系生成第一路由表项,第一路由表项的目的地址为与第一服务器相关联的IP地址,第一路由表项的下一跳地址为第一服务器的本地IP地址。Optionally, the target device includes a routing device, and a sending unit is configured to send a first routing entry generation instruction to the routing device based on the border gateway protocol. The first routing entry generation instruction carries a first mapping relationship and a first routing entry. The generation instruction is used to instruct the routing device to generate a first routing entry according to the first mapping relationship. The destination address of the first routing entry is the IP address associated with the first server, and the next hop address of the first routing entry is the first. The local IP address of a server.
可选的,装置还包括:删除单元,用于若第一服务器的状态为故障状态,则向路由设备发送第一删除指令,第一删除指令用于指示路由设备删除第一路由表项。Optionally, the apparatus further includes: a deleting unit, configured to send a first deletion instruction to the routing device if the state of the first server is a fault state, and the first deletion instruction is used to instruct the routing device to delete the first routing entry.
可选的,发送单元,用于若第一服务器的状态为工作状态,则将第一服务器的主备标识设置为主服务器对应的标识;若检测到第一服务器的主备标识为主服务器对应的标识时,则基于边界网关协议向目标设备发送第一映射关系。Optionally, the sending unit is configured to set the master / slave identifier of the first server as the identifier corresponding to the master server if the state of the first server is the working state; if it is detected that the master / slave identifier of the first server corresponds to the master server When it is identified, the first mapping relationship is sent to the target device based on the border gateway protocol.
可选的,第一服务器包括负载均衡服务器。Optionally, the first server includes a load balancing server.
本申请实施例还提供了一种通信装置,应用于第二服务器,装置包括:获取单元,用于获取第一服务器的状态和第二映射关系,第二映射关系为与第一服务器相关联的IP地址和第二服务器的本地IP地址之间的映射关系,与第一服务器相关联的IP地址包括预设南向接口互联网协议IP地址和/或预设北向接口IP地址;发送单元,用于若状态为故障状态,则基于边界网关协议向目标设备发送第二映射关系。An embodiment of the present application further provides a communication device, which is applied to a second server. The device includes: an obtaining unit, configured to obtain a status of the first server and a second mapping relationship, where the second mapping relationship is associated with the first server. The mapping relationship between the IP address and the local IP address of the second server. The IP address associated with the first server includes a preset southbound interface Internet protocol IP address and / or a preset northbound interface IP address. The sending unit is configured to: If the state is a fault state, the second mapping relationship is sent to the target device based on the border gateway protocol.
可选的,目标设备包括路由设备;发送单元,用于基于边界网关协议向路由设备发送第二路由表项生成指令,第二路由表项生成指令中携带第二映射关系,第二路由表项生成指令用于指示路由设备根据第二映射关系生成第二路由表项,第二路由表项的目的地址为与第一服务器相关联的IP地址,第二路由表项的下一跳地址为第二服务器的本地IP地址。Optionally, the target device includes a routing device; and a sending unit configured to send a second routing entry generation instruction to the routing device based on the border gateway protocol, where the second routing entry generation instruction carries a second mapping relationship and the second routing entry The generation instruction is used to instruct the routing device to generate a second routing entry according to the second mapping relationship. The destination address of the second routing entry is the IP address associated with the first server, and the next hop address of the second routing entry is the first. The local IP address of the server.
可选的,发送单元,用于若第一服务器的状态为故障状态,则将第二服务器的主备标识设置为主服务器对应的标识;当检测到第二服务器的主备标识为主服务器对应的标识时,基于边界网关协议向目标设备发送第二映射关系。Optionally, the sending unit is configured to set the master / slave identifier of the second server as the master server's corresponding identifier if the state of the first server is in the fault state; When identifying, the second mapping relationship is sent to the target device based on the border gateway protocol.
图1为本申请实施例提供的一种通信系统的结构框图;FIG. 1 is a structural block diagram of a communication system according to an embodiment of the present application;
图2为本申请实施例提供的另外一种通信系统的结构框图;2 is a structural block diagram of another communication system according to an embodiment of the present application;
图3为本申请实施例提供的一种通信方法的流程示意图;3 is a schematic flowchart of a communication method according to an embodiment of the present application;
图4为本申请实施例提供的另外一种通信方法的流程示意图;4 is a schematic flowchart of another communication method according to an embodiment of the present application;
图5为本申请实施例提供的一种通信装置的结构框图;5 is a structural block diagram of a communication device according to an embodiment of the present application;
图6为本申请实施例提供的另外一种通信装置的结构框图;6 is a structural block diagram of another communication device according to an embodiment of the present application;
图7为本申请实施例提供的一种服务器的结构框图;7 is a structural block diagram of a server according to an embodiment of the present application;
图8为本申请实施例提供的另外一种服务器的结构框图。FIG. 8 is a structural block diagram of another server provided by an embodiment of the present application.
传统技术中,访问主服务器和备服务器需要使用不同的IP地址进行访问,所以当主服务器出现故障之后,需要将主服务器的IP地址手动修改为备服务器的IP地址,以实现 对备用服务器的访问,给用户和管理人员造成不便。In the traditional technology, access to the primary server and the standby server requires different IP addresses for access. Therefore, when the primary server fails, the IP address of the primary server needs to be manually modified to the IP address of the standby server to achieve access to the standby server. Inconvenience to users and managers.
目前有一种技术方案能够解决上述技术问题。即,在与主服务器连接的第一路由设备中以及在与备服务器连接的第二路由设备中均存储与第一服务器相关联的IP地址,即预设南向接口IP地址和/或预设北向接口IP地址。预先在第一路由设备和第二路由设备中配置优先级,当主服务器可以工作时,主服务器配置的优先级为高优先级,备服务器配置的优先级为低优先级。当第一路由设备配置为高优先级时,第一路由设备向目标设备发送与第一服务器相关联的IP地址。其中,目标设备可以是北向用户终端和/或南向网络设备。因为第二路由设备配置为低优先级,第二路由设备不向目标设备发送该与第一服务器相关联的IP地址,此时,目标设备可以通过与第一服务器相关联的IP地址来访问主服务器。There is currently a technical solution that can solve the above technical problems. That is, both the first routing device connected to the primary server and the second routing device connected to the standby server store the IP address associated with the first server, that is, the preset southbound interface IP address and / or the preset IP address of the northbound interface. Priorities are configured in the first routing device and the second routing device in advance. When the primary server is operational, the priority configured by the primary server is a high priority, and the priority configured by the standby server is a low priority. When the first routing device is configured with a high priority, the first routing device sends an IP address associated with the first server to the target device. The target device may be a northbound user terminal and / or a southbound network device. Because the second routing device is configured with a low priority, the second routing device does not send the IP address associated with the first server to the target device. At this time, the target device can access the master through the IP address associated with the first server. server.
当主服务器故障时,需要将第二路由设备的优先级从低优先级修改为高优先级,将第一路由设备的优先级从高优先级修改为低优先级,以使第二路由设备能够向目标设备发送与第一服务器相关联的IP地址,这样,目标设备可以通过该与第一服务器相关联的IP地址来访问备服务器。When the primary server fails, the priority of the second routing device needs to be changed from low priority to high priority, and the priority of the first routing device is changed from high priority to low priority, so that the second routing device can forward to The target device sends an IP address associated with the first server. In this way, the target device can access the standby server through the IP address associated with the first server.
在主备服务器切换的过程中,目标设备使用相同的IP地址,即与第一服务器相关联的IP地址对主备服务器进行访问,不需要用户对IP地址进行修改,所以有效提高了用户体验。During the process of switching between the active and standby servers, the target device uses the same IP address, that is, the IP address associated with the first server to access the active and standby servers, and does not require the user to modify the IP address, which effectively improves the user experience.
但同时引入了另外一个问题,即在主备服务器切换时,主备服务器的管理人员需要手动更改第一路由设备的优先级和第二路由设备的优先级,导致增大了管理人员的工作量。But it also introduces another problem. When the active and standby servers are switched, the administrators of the active and standby servers need to manually change the priority of the first routing device and the priority of the second routing device, which increases the workload of the management staff. .
为了实现既方便用户又不给主备服务器的管理人员增加额外的工作量,本申请实施例提供了一种通信系统、方法及装置,其中,该通信系统包括第一服务器和第二服务器。第一服务器和第二服务器连接。In order to achieve convenience for users without adding extra workload to the administrators of the active and standby servers, the embodiments of the present application provide a communication system, method, and device, where the communication system includes a first server and a second server. The first server and the second server are connected.
其中,第一服务器,用于获取第一映射关系,并基于边界网关协议向目标设备发送第一映射关系。第一映射关系为与第一服务器相关联的IP地址和第一服务器的本地IP地址之间的映射关系。与第一服务器相关联的IP地址包括:预设南向接口IP地址和/或预设北向接口IP地址。其中,预设南向接口IP地址和/或预设北向接口IP地址包括如下三种情况:单独的预设南向接口IP地址,或,单独的预设北向接口IP地址,或,预设南向接口IP地址和预设北向接口IP地址。第一映射关系可以用于目标设备访问第一服务器。The first server is configured to obtain a first mapping relationship and send the first mapping relationship to a target device based on a border gateway protocol. The first mapping relationship is a mapping relationship between an IP address associated with the first server and a local IP address of the first server. The IP address associated with the first server includes: a preset southbound interface IP address and / or a preset northbound interface IP address. The preset southbound interface IP address and / or the preset northbound interface IP address include the following three cases: a separate preset southbound interface IP address, or a separate preset northbound interface IP address, or a preset southbound interface. Forwarding interface IP address and preset northbound interface IP address. The first mapping relationship may be used for the target device to access the first server.
第二服务器,用于获取第一服务器的状态和第二映射关系,若状态为故障状态,则基于边界网关协议向目标设备发送第二映射关系。第二映射关系为与第一服务器相关联的IP地址和第二服务器本地IP地址之间的映射关系。第二映射关系用于目标设备访问第二服务器。The second server is configured to obtain the status of the first server and the second mapping relationship, and if the status is a fault status, send the second mapping relationship to the target device based on the border gateway protocol. The second mapping relationship is a mapping relationship between an IP address associated with the first server and a local IP address of the second server. The second mapping relationship is used for the target device to access the second server.
由于目标设备采用相同的IP地址,即与第一服务器相关联的IP地址来访问第一服务器和第二服务器,所以无需用户或管理人员通过修改IP地址来实现从访问第一服务器到访问第二服务器的切换。同时,由于向目标设备发送与第一服务器相关联的IP地址是第一服务器和第二服务器,而不是第一服务器的路由设备和第二服务器的路由设备,所以不需要在路由设备上设置优先级来控制谁来向目标设备发布与第一服务器相关联的IP地址,而是由第二服务器自己通过获取第一服务器的状态,在状态为故障状态时,向目标设备发布与第一服务器相关联的IP地址,实现了第一服务器和第二服务器之间的自动切换,减少了管理人员的工作量。Because the target device uses the same IP address, that is, the IP address associated with the first server to access the first server and the second server, there is no need for the user or manager to modify the IP address to access the first server to access the second server. Server switching. At the same time, since the IP addresses associated with the first server are sent to the target device as the first server and the second server, rather than the routing device of the first server and the routing device of the second server, there is no need to set priority on the routing device Level to control who publishes the IP address associated with the first server to the target device, but the second server itself obtains the status of the first server, and when the status is faulty, the target server is published to the target device. The linked IP address realizes the automatic switching between the first server and the second server, reducing the workload of the management staff.
下面将结合附图,详细介绍本申请实施例提供的一种通信系统的技术方案。The technical solution of a communication system provided by an embodiment of the present application will be described in detail below with reference to the accompanying drawings.
参见图1,该图为本申请实施例提供的一种通信系统的结构框图。Refer to FIG. 1, which is a structural block diagram of a communication system according to an embodiment of the present application.
本申请实施例提供的通信系统包括:第一服务器101和第二服务器102。The communication system provided in the embodiment of the present application includes a first server 101 and a second server 102.
在本申请实施例中,第一服务器101和第二服务器102可以是用于负载均衡的服务器,也可以是其他用途的服务器,本申请实施例不具体限定。In the embodiment of the present application, the first server 101 and the second server 102 may be servers for load balancing, or servers for other purposes, which are not specifically limited in the embodiments of the present application.
第一服务器101和第二服务器102可以是实体服务器,也可以是虚拟服务器。The first server 101 and the second server 102 may be physical servers or virtual servers.
若第一服务器101为实体服务器,则第一服务器101的本地IP地址是物理IP地址;若第一服务器101为虚拟服务器,则第一服务器的本地IP地址是虚拟IP地址。If the first server 101 is a physical server, the local IP address of the first server 101 is a physical IP address; if the first server 101 is a virtual server, the local IP address of the first server is a virtual IP address.
同理,若第二服务器102为实体服务器,则第二服务器102的本地IP地址是物理IP地址;若第二服务器102为虚拟服务器,则第二服务器102的本地IP地址是虚拟IP地址。Similarly, if the second server 102 is a physical server, the local IP address of the second server 102 is a physical IP address; if the second server 102 is a virtual server, the local IP address of the second server 102 is a virtual IP address.
第一服务器101的数目可以是一个,也可以是多个;第二服务器102的数目可以是一个,也可以是多个。The number of the first servers 101 may be one or plural; the number of the second servers 102 may be one or plural.
第一服务器101和第二服务器102可以在同一个自治域(autonomous system,AS)中,也可以分属于不同的自治域。The first server 101 and the second server 102 may be in the same autonomous system (AS), or may belong to different autonomous domains.
第一服务器101和第二服务器102均具有南向接口和北向接口,其中南向接口与南向网络设备相对应,北向接口与北向用户终端相对应。其中,南向网络设备例如可以为路由器、无线接入点(access point,AP)、交换机等设备。北向用户终端例如可以为手机、计算机、笔记本电脑、IPAD等设备。The first server 101 and the second server 102 each have a southbound interface and a northbound interface, where the southbound interface corresponds to a southbound network device, and the northbound interface corresponds to a northbound user terminal. The southbound network device may be, for example, a router, a wireless access point (AP), or a switch. The northbound user terminal may be, for example, a device such as a mobile phone, a computer, a notebook computer, or an IPAD.
对于同一个服务器而言,南向接口的IP地址和北向接口的IP地址可以相同,也可以不同。对于不同的服务器而言,南向接口的IP地址统一,北向接口的IP地址统一,即,第一服务器101的南向接口IP地址和第二服务器102的南向接口IP地址均为预设南向接口IP地址;第一服务器101的北向接口IP地址和第二服务器102的北向接口IP地址均为预设北向接口IP地址。For the same server, the IP address of the southbound interface and the IP address of the northbound interface can be the same or different. For different servers, the IP address of the southbound interface is the same, and the IP address of the northbound interface is the same, that is, the IP address of the southbound interface of the first server 101 and the IP address of the southbound interface of the second server 102 are preset south. IP address of the northbound interface; the IP address of the northbound interface of the first server 101 and the IP address of the northbound interface of the second server 102 are both preset northbound interface IP addresses.
第一服务器101,用于获取第一映射关系,并基于边界网关协议(border gateway protocol,BGP)向目标设备发送第一映射关系。The first server 101 is configured to obtain a first mapping relationship, and send the first mapping relationship to a target device based on a border gateway protocol (BGP).
第一映射关系为与第一服务器相关联的互联网协议IP地址和第一服务器101的本地IP地址之间的映射关系,与第一服务器101相关联的IP地址包括预设南向接口IP地址和/或预设北向接口IP地址。第一映射关系用于目标设备访问第一服务器101。The first mapping relationship is a mapping relationship between an Internet protocol IP address associated with the first server and a local IP address of the first server 101. The IP address associated with the first server 101 includes a preset southbound interface IP address and / Or preset northbound interface IP address. The first mapping relationship is used for the target device to access the first server 101.
第二服务器102,用于获取第一服务器101的状态和第二映射关系,若状态为故障状态,则基于边界网关协议向目标设备发送第二映射关系。The second server 102 is configured to obtain a status of the first server 101 and a second mapping relationship. If the status is a fault status, the second server 102 sends a second mapping relationship to the target device based on the border gateway protocol.
第二映射关系为与第一服务器101相关联的IP地址和第二服务器102的本地IP地址之间的映射关系。第二映射关系用于目标设备访问第二服务器102。The second mapping relationship is a mapping relationship between an IP address associated with the first server 101 and a local IP address of the second server 102. The second mapping relationship is used for the target device to access the second server 102.
在实际应用中,与第一服务器101相关联的IP地址可以预先通过配置的方式存储在第一服务器101中和第二服务器102中,或者,也可以由某个与第一服务器101和第二服务器102连接的网络设备统一向第一服务器101和第二服务器102分发,以便形成第一映射关系或第二映射关系。In practical applications, the IP addresses associated with the first server 101 may be stored in the first server 101 and the second server 102 through a configuration method in advance, or may be stored in a certain way by the first server 101 and the second server. The network devices connected to the server 102 are uniformly distributed to the first server 101 and the second server 102 so as to form a first mapping relationship or a second mapping relationship.
第一服务器101基于边界网关协议向目标设备发送第一映射关系。若目标设备与第一服务器101位于同一个自治域,那么则基于内部边界网关协议(internal border gateway protocol,IBGP)发送;若目标设备与第一服务器101不在同一个自治域,那么则基于外部边界网关协议(external border gateway protocol,EBGP)发送。The first server 101 sends a first mapping relationship to the target device based on the border gateway protocol. If the target device and the first server 101 are in the same autonomous domain, they are sent based on the internal border gateway protocol (IBGP); if the target device and the first server 101 are not in the same autonomous domain, they are based on the external border Gateway protocol (external border gateway protocol, EBGP) sending.
同理,第二服务器102基于边界网关协议向目标设备发送第二映射关系。若目标设备与第二服务器102位于同一个自治域,那么则基于IBGP发送;若目标设备与第二服务器102不在同一个自治域,那么则基于EBGP发送.Similarly, the second server 102 sends a second mapping relationship to the target device based on the border gateway protocol. If the target device and the second server 102 are located in the same autonomous domain, then send based on IBGP; if the target device and the second server 102 are not in the same autonomous domain, then send based on EBGP.
在本申请实施例中,目标设备包括南向网络设备和/或北向用户终端。如前文所提,南向网络设备可以包括路由设备,例如路由器、交换机等。In the embodiment of the present application, the target device includes a southbound network device and / or a northbound user terminal. As mentioned above, the southbound network equipment may include routing equipment, such as routers, switches, and so on.
如果目标设备包括路由设备,那么在本申请实施例中,第一服务器101基于边界网关协议向目标设备发送第一映射关系可以具体为:第一服务器101基于边界网关协议向路由设备发送第一路由表项生成指令,第一路由表项生成指令中携带第一映射关系,第一路由表项生成指令用于指示路由设备根据第一映射关系生成第一路由表项,第一路由表项的目的地址为与第一服务器101相关联的IP地址,第一路由表项的下一跳地址为第一服务器的本地IP地址。If the target device includes a routing device, in the embodiment of the present application, the first server 101 sending the first mapping relationship to the target device based on the border gateway protocol may be specifically: the first server 101 sends the first route to the routing device based on the border gateway protocol. An entry generation instruction. The first routing entry generation instruction carries a first mapping relationship. The first routing entry generation instruction is used to instruct a routing device to generate a first routing entry and a purpose of the first routing entry according to the first mapping relationship. The address is the IP address associated with the first server 101, and the next hop address of the first routing entry is the local IP address of the first server.
因而,路由设备可以根据接收到的报文携带的与第一服务器101相关联的IP地址,查找第一路由表项,确定与第一服务器相关联的IP地址对应的下一跳地址,即第一服务器101的本地IP地址,然后将报文发送给第一服务器101。为了令路由设备能够根据第一映射关系生成第一路由表项。可选的,第一服务器101可以向路由设备发送第一路由表项生成指令,该指令中携带有第一映射关系。路由设备在接收到第一路由表项生成指令之后,根据其中携带的第一映射关系生成第一路由表项。Therefore, the routing device may look up the first routing entry according to the IP address associated with the first server 101 carried in the received message, and determine the next hop address corresponding to the IP address associated with the first server, that is, the first A server 101 has a local IP address, and then sends a message to the first server 101. In order to enable the routing device to generate a first routing entry according to the first mapping relationship. Optionally, the first server 101 may send a first routing table entry generation instruction to the routing device, where the instruction carries a first mapping relationship. After receiving the first routing table entry generation instruction, the routing device generates a first routing table entry according to the first mapping relationship carried therein.
同理,如果目标设备包括路由设备,那么在本申请实施例中,第二服务器102基于边界网关协议向目标设备发送第二映射关系可以具体为:第二服务器102基于边界网关协议向路由设备发送第二路由表项生成指令,第二路由表项生成指令中携带第二映射关系,第二路由表项生成指令用于指示路由设备根据第二映射关系生成第二路由表项,第二路由表项的目的地址为与第一服务器101相关联的IP地址,第一路由表项的下一跳地址为第二服务器102的本地IP地址。Similarly, if the target device includes a routing device, in the embodiment of the present application, the second server 102 sending the second mapping relationship to the target device based on the border gateway protocol may be specifically: the second server 102 sends the second mapping relationship to the routing device based on the border gateway protocol. A second routing table entry generation instruction, the second routing table entry generation instruction carries a second mapping relationship, and the second routing table entry generation instruction is used to instruct a routing device to generate a second routing table entry according to the second mapping relationship, and the second routing table The destination address of the entry is the IP address associated with the first server 101, and the next hop address of the first routing table entry is the local IP address of the second server 102.
因而,路由设备可以根据接收到的报文携带的与第二服务器102相关联的IP地址,查找第二路由表项,确定与第一服务器101相关联的IP地址对应的下一跳地址,即第一服务器101的本地IP地址,然后将报文发送给第二服务器102。为了令路由设备能够根据第二映射关系生成第二路由表项。可选的,第二服务器102可以向路由设备发送第二路由表项生成指令,该指令中携带有第二映射关系。路由设备在接收到第二路由表项生成指令之后,根据其中携带的第二映射关系生成第二路由表项。Therefore, the routing device may look up the second routing table entry according to the IP address associated with the second server 102 carried in the received message, and determine the next hop address corresponding to the IP address associated with the first server 101, that is, The local IP address of the first server 101 then sends a message to the second server 102. In order to enable the routing device to generate a second routing entry according to the second mapping relationship. Optionally, the second server 102 may send a second routing table entry generation instruction to the routing device, where the instruction carries a second mapping relationship. After receiving the second routing table entry generation instruction, the routing device generates a second routing table entry according to the second mapping relationship carried therein.
若目标设备为非路由设备,例如用户终端,那么在第一服务器101和第二服务器102可以通过路由设备与目标设备连接,第一服务器101和第二服务器和路由设备之间的交互如上文,此处不再赘述。需要说明的是,为了使用户终端能够访问该路由设备,可以预先在用户终端中存储该路由设备的IP地址,以便根据该路由设备的IP地址发起访问与第一服务器101的IP地址对应的服务器的请求。If the target device is a non-routing device, such as a user terminal, the first server 101 and the second server 102 may be connected to the target device through the routing device. The interaction between the first server 101 and the second server and the routing device is as described above. I won't repeat them here. It should be noted that, in order to enable the user terminal to access the routing device, the IP address of the routing device may be stored in the user terminal in advance, so as to initiate access to the server corresponding to the IP address of the first server 101 according to the IP address of the routing device. Request.
另外,在本申请实施例中,为了实现目标设备由访问第一服务器101自动切换至访问第二服务器102,第二服务器102获取第一服务器101的状态,若第一服务器101的状态为故障状态,则向目标设备发送第二映射关系,以便目标设备根据第二映射关系访问第二服务器102。In addition, in the embodiment of the present application, in order to automatically switch the target device from accessing the first server 101 to accessing the second server 102, the second server 102 obtains the status of the first server 101, and if the status of the first server 101 is a fault status , The second mapping relationship is sent to the target device, so that the target device accesses the second server 102 according to the second mapping relationship.
具体的,第二服务器102可以包括第二标识设置模块和第二映射关系发送模块。Specifically, the second server 102 may include a second identity setting module and a second mapping relationship sending module.
其中,第二标识设置模块,用于根据第一服务器101的状态对第二服务器102的主备 标识进行设置。如果第一服务器101的状态为工作状态,则第二标识设置模块将第二服务器101的主备标识设置为备服务器对应的标识,例如为0。如果第一服务器101的状态为故障状态,则第二标识设置模块将第二服务器102的主备标识设置为主服务器对应的标识,例如为1。The second identifier setting module is configured to set the master and backup identifiers of the second server 102 according to the status of the first server 101. If the state of the first server 101 is the working state, the second identifier setting module sets the master and backup identifiers of the second server 101 to the identifier corresponding to the standby server, for example, 0. If the state of the first server 101 is a fault state, the second identifier setting module sets the primary and secondary identifiers of the second server 102 to an identifier corresponding to the primary server, for example, 1.
而第二映射关系发送模块在检测到第二服务器102的主备标识为备服务器对应的标识时,则不向目标设备发送第二映射关系。在检测到第二服务器102的主备标识为主服务器对应的标识时,则向目标设备发送第二映射关系。The second mapping relationship sending module does not send the second mapping relationship to the target device when it detects that the primary and secondary identifications of the second server 102 are identifications corresponding to the standby server. When the primary and secondary identifications of the second server 102 are detected as the identifications corresponding to the primary server, the second mapping relationship is sent to the target device.
需要注意的是,这里的不向目标设备发送第二映射关系,目的在于不让目标设备根据第二映射关系访问第二服务器102。如前文,若第二服务器102是通过向目标设备发送第二路由表项生成指令来控制目标设备访问第二服务器102的,那么不向目标设备发送第二映射关系的意思是不向目标设备发送第二路由表项生成指令。It should be noted that the second mapping relationship is not sent to the target device here, and the purpose is to prevent the target device from accessing the second server 102 according to the second mapping relationship. As before, if the second server 102 controls the target device to access the second server 102 by sending a second routing table entry generation instruction to the target device, not sending the second mapping relationship to the target device means not sending it to the target device. The second routing table entry generation instruction.
同理,向目标设备发送第二映射关系,目的在于让目标设备根据第二映射关系访问第二服务器102。如前文,若第二服务器102是通过向目标设备发送第二路由表项生成指令来控制目标设备访问第二服务器102的,那么向目标设备发送第二映射关系的意思是向目标设备发送第二路由表项生成指令。Similarly, the second mapping relationship is sent to the target device, so that the target device can access the second server 102 according to the second mapping relationship. As described above, if the second server 102 controls the target device to access the second server 102 by sending a second routing table entry generation instruction to the target device, sending the second mapping relationship to the target device means sending the second device to the target device. Routing table entry generation instruction.
可选的,若第二映射关系发送模块曾经向目标设备发送过第二路由表项生成指令,那么当第二映射关系发送模块在检测到第二标识设置模块中存储的主备标识为备服务器对应的标识时,可以向目标设备发送第二删除指令,该第二删除指令中携带有第二映射关系,该第二删除指令用于目标设备删除目标设备中的第二路由表项。Optionally, if the second mapping relationship sending module has ever sent a second routing table entry generation instruction to the target device, when the second mapping relationship sending module detects that the primary and backup identifiers stored in the second identity setting module are standby servers At the corresponding identification, a second delete instruction may be sent to the target device, where the second delete instruction carries a second mapping relationship, and the second delete instruction is used by the target device to delete the second routing table entry in the target device.
相应的,第一服务器101可以包括第一标识设置模块和第一映射关系发送模块。Accordingly, the first server 101 may include a first identity setting module and a first mapping relationship sending module.
其中,第一标识设置模块,用于根据第一服务器101的状态对主备标识进行设置。如果第一服务器101的状态为工作状态,则第一标识设置模块将第一服务器101的主备标识设置为主服务器对应的标识,例如为1。如果第一服务器101的状态为故障状态,则第一标识设置模块将第一服务器101的主备标识设置为备服务器对应的标识,例如为0。The first identifier setting module is configured to set the master and backup identifiers according to the status of the first server 101. If the state of the first server 101 is the working state, the first identifier setting module sets the master and backup identifiers of the first server 101 to identifiers corresponding to the master server, for example, 1. If the state of the first server 101 is a fault state, the first identifier setting module sets the primary and secondary identifiers of the first server 101 to an identifier corresponding to the secondary server, for example, 0.
而第一映射关系发送模块在在检测到第一标识设置模块中存储的标识为主服务器对应的标识时,则向目标设备发送第一映射关系;在检测到第一标识设置模块中存储的主备标识为备服务器对应的标识时,则不向目标设备发送第一映射关系。The first mapping relationship sending module sends the first mapping relationship to the target device when it detects that the identifier stored in the first identity setting module is the identity corresponding to the master server; and detects the master stored in the first identity setting module. When the standby identifier is an identifier corresponding to the standby server, the first mapping relationship is not sent to the target device.
需要注意的是,这里的向目标设备发送第一映射关系,目的在于让目标设备根据第一映射关系访问第一服务器101。如前文,若第一服务器101是通过向目标设备发送第一路由表项生成指令来控制目标设备访问第一服务器101的,那么向目标设备发送第一映射关系的意思是向目标设备发送第一路由表项生成指令。It should be noted that the purpose of sending the first mapping relationship to the target device is to allow the target device to access the first server 101 according to the first mapping relationship. As described above, if the first server 101 controls the target device to access the first server 101 by sending a first routing table entry generation instruction to the target device, then sending the first mapping relationship to the target device means sending the first device to the target device. Routing table entry generation instruction.
同理,不向目标设备发送第一映射关系,目的在于不让目标设备根据第一映射关系访问第一服务器101。如前文,若第一服务器101是通过向目标设备发送第一路由表项生成指令来控制目标设备访问第一服务器101的,那么不向目标设备发送第一映射关系的意思是不向目标设备发送第一路由表项生成指令。Similarly, the first mapping relationship is not sent to the target device, and the purpose is to prevent the target device from accessing the first server 101 according to the first mapping relationship. As mentioned above, if the first server 101 controls the target device to access the first server 101 by sending a first routing table entry generation instruction to the target device, then not sending the first mapping relationship to the target device means not sending the target device The first routing table entry generation instruction.
可选的,若第一映射关系发送模块曾经向目标设备发送过第一路由表项生成指令,那么当第一映射关系发送模块在检测到第一标识设置模块中存储的主备标识为备服务器对应的标识时,可以向目标设备发送第一删除指令,该第一删除指令中携带有第一映射关系,该第一删除指令用于目标设备删除目标设备中的第一路由表项。Optionally, if the first mapping relationship sending module has sent the first routing table entry generation instruction to the target device, when the first mapping relationship sending module detects that the primary and backup identifiers stored in the first identity setting module are the standby server At the corresponding identification, a first delete instruction may be sent to the target device, where the first delete instruction carries a first mapping relationship, and the first delete instruction is used by the target device to delete the first routing entry in the target device.
为了能够及时的获取到第一服务器101的状态,作为备服务器的第二服务器102可以 接收主服务器,即第一服务器101周期性发送的心跳报文,若在预设时间段内未接收到第一服务器101发送的心跳报文,那么认为第一服务器101出现故障。In order to be able to obtain the status of the first server 101 in time, the second server 102 serving as the standby server may receive the primary server, that is, the heartbeat message periodically sent by the first server 101. If a heartbeat message sent by the server 101, the first server 101 is considered to be faulty.
此外,当第一服务器101作为主服务器时,第一服务器101需要将业务数据同步至备服务器,即第二服务器102中。而当第二服务器102由备服务器升为主服务器时,第二服务器102需要将业务数据同步至故障得到恢复的第一服务器101中,以保证数据的可靠性。In addition, when the first server 101 is used as the primary server, the first server 101 needs to synchronize service data to the standby server, that is, the second server 102. When the second server 102 is upgraded from the standby server to the primary server, the second server 102 needs to synchronize the business data to the first server 101 where the fault is recovered to ensure the reliability of the data.
本申请实施例中,目标设备可以采用相同的IP地址,即与第一服务器相关联的IP地址来访问第一服务器101和第二服务器102,所以无需用户通过修改IP地址来实现从访问第一服务器101到访问第二服务器102的切换。同时,由于存储第一映射关系的是第一服务器101,而不是第一服务器101的路由设备,存储第二映射关系的是第二服务器102,而不是第二服务器102的路由设备,所以不需要在路由设备上设置优先级来控制谁来向目标设备发布与第一服务器相关联的IP地址,而是由第二服务器102自己通过获取第一服务器101的状态,在状态为故障状态时,第二服务器102向目标设备发布与第一服务器相关联的IP地址,以使目标设备根据与第一服务器相关联的IP地址由访问第一服务器101自动切换至访问第二服务器102,减少了管理人员的工作量。In the embodiment of the present application, the target device may use the same IP address, that is, the IP address associated with the first server to access the first server 101 and the second server 102, so the user does not need to modify the IP address to access the first server from the first server. Switch from server 101 to access second server 102. At the same time, since the first mapping relationship is stored by the first server 101 instead of the routing device of the first server 101, and the second mapping relationship is stored by the second server 102 instead of the routing device of the second server 102, it is not necessary The priority is set on the routing device to control who publishes the IP address associated with the first server to the target device. Instead, the second server 102 obtains the status of the first server 101 by itself. When the status is faulty, the first The two servers 102 publish the IP address associated with the first server to the target device, so that the target device automatically switches from accessing the first server 101 to accessing the second server 102 according to the IP address associated with the first server, reducing management staff Workload.
下面以一个应用场景为例来对上述实施例的通信系统进行进一步介绍。The following uses an application scenario as an example to further introduce the communication system in the foregoing embodiment.
园区敏捷控制器(agile controller-campus,ACC)是针对云园区(cloud campus)解决方案场景管理控制系统,支持网络业务管理、网络安全管理、用户准入管理、网络监控、网络质量分析、网络应用分析、告警和报表等业务。The agile controller-campus (ACC) is a scene management and control system for cloud campus solutions. It supports network business management, network security management, user access management, network monitoring, network quality analysis, and network applications. Analysis, alerting and reporting services.
多个中大型网络被云管理平台集中管理,对云园区产品的可靠性有着更高的要求,除了数据备份恢复之外,还要求提供异地容灾功能。主备服务器部署在不同的地域,当主服务器的云平台例如因为地震、火灾或光纤挖断等场景而出现故障时,需要保证管理服务的可持续性,即具备可以切换到与主服务器处于不同地域的备服务器继续提供业务的能力。Multiple medium and large networks are centrally managed by the cloud management platform, which has higher requirements for the reliability of cloud park products. In addition to data backup and recovery, it also requires the provision of offsite disaster recovery functions. The primary and secondary servers are deployed in different regions. When the cloud platform of the primary server fails due to scenarios such as earthquakes, fires, or fiber digging, the sustainability of management services needs to be ensured, that is, it can be switched to a different region from the primary server Standby servers continue to provide business capabilities.
所以本申请实施例提供一种通信系统,参见图2,该系统10包括服务器集群20、服务器集群30和路由设备40。服务器集群20、服务器集群30和路由设备40之间相互连接。Therefore, an embodiment of the present application provides a communication system. Referring to FIG. 2, the system 10 includes a server cluster 20, a server cluster 30, and a routing device 40. The server cluster 20, the server cluster 30, and the routing device 40 are connected to each other.
其中,路由设备40与北向用户终端或南向网络设备连接。The routing device 40 is connected to a northbound user terminal or a southbound network device.
服务器集群20和服务器集群30可以属于不同的自治域,例如服务器集群20属于AS100,服务器集群30属于AS200。The server cluster 20 and the server cluster 30 may belong to different autonomous domains. For example, the server cluster 20 belongs to AS100 and the server cluster 30 belongs to AS200.
其中服务器集群20包括服务器201、服务器202和路由设备203。服务器201、服务器202和路由设备203之间相互连接。The server cluster 20 includes a server 201, a server 202, and a routing device 203. The server 201, the server 202, and the routing device 203 are connected to each other.
服务器集群30包括服务器301、服务器302和路由设备303。服务器301、服务器302和路由设备303之间相互连接。The server cluster 30 includes a server 301, a server 302, and a routing device 303. The server 301, the server 302, and the routing device 303 are mutually connected.
其中,服务器集群20为主服务器集群,服务器集群30为备服务器集群。在服务器集群20中,服务器201为主服务器,服务器202为备服务器。在服务器集群30中,服务器301为主服务器,服务器302为备服务器。Among them, the server cluster 20 is a master server cluster, and the server cluster 30 is a standby server cluster. In the server cluster 20, the server 201 is the master server, and the server 202 is the standby server. In the server cluster 30, the server 301 is the master server, and the server 302 is the standby server.
服务器集群20和服务器集群30可以位于不同的地域,例如服务器集群20位于北京,服务器集群30位于上海。在服务器集群内部,各服务器也可以部署于不同的地点。例如,服务器集群20中的服务器201位于海淀区,服务器202位于朝阳区。The server cluster 20 and the server cluster 30 may be located in different regions. For example, the server cluster 20 is located in Beijing and the server cluster 30 is located in Shanghai. Within a server cluster, each server can also be deployed in a different location. For example, server 201 in server cluster 20 is located in Haidian District, and server 202 is located in Chaoyang District.
服务器201、服务器202、服务器301和服务器302均为负载均衡服务器,即执行负载均衡功能。它们可以是实体服务器,也可以是虚拟服务器。The server 201, the server 202, the server 301, and the server 302 are all load balancing servers, that is, they perform a load balancing function. They can be physical servers or virtual servers.
上述四个服务器中的每个服务器都可以分别具有南向接口和北向接口。其中,南向接口的IP地址与北向接口的IP地址可以相同,也可以不同。举例而言,南向接口的IP地址为100.100.10.100/32,北向接口的IP地址为100.100.10.101/32。Each of the above four servers can have a southbound interface and a northbound interface, respectively. The IP address of the southbound interface and the IP address of the northbound interface can be the same or different. For example, the IP address of the southbound interface is 100.100.10.100/32, and the IP address of the northbound interface is 100.100.10.101/32.
在本申请实施例中,既涉及服务器集群20和服务器集群30之间的自动切换,又涉及服务器集群20内部服务器201和服务器202之间的自动切换,以及服务器集群30内部服务器301和服务器302之间的自动切换。下面将一一详细描述。In the embodiment of the present application, both automatic switching between the server cluster 20 and the server cluster 30, and automatic switching between the server 201 and the server 202 inside the server cluster 20, and between the internal server 301 and the server 302 of the server cluster 30 Between automatic switching. Each will be described in detail below.
对于实现服务器集群20内部服务器201和服务器202之间的自动切换,可以包括如下步骤:For the automatic switching between the server 201 and the server 202 in the server cluster 20, the following steps may be included:
1、首先配置服务器201的南向接口IP地址和北向接口IP地址,以及服务器202中南向接口IP地址和北向接口IP地址。1. First configure the southbound interface IP address and northbound interface IP address of the server 201, and the southbound interface IP address and northbound interface IP address of the server 202.
其中,服务器201的南向接口IP地址和服务器202的南向接口IP地址相同,例如均为100.100.10.100/32。服务器201的北向接口IP地址和服务器202的北向接口IP地址相同,例如均为100.100.10.101/32。掩码可以设置为32位。The IP address of the southbound interface of the server 201 and the IP address of the southbound interface of the server 202 are the same, for example, both are 100.100.10.100/32. The northbound interface IP address of the server 201 and the northbound interface IP address of the server 202 are the same, for example, both are 100.100.10.101/32. The mask can be set to 32 bits.
2、在服务器201和服务器202中配置容灾处理服务。2. Configure the disaster tolerance processing service in the server 201 and the server 202.
例如,容灾处理服务可以包括容灾管理服务(drService)和容灾数据同步服务(repService)。其中,drService负责处理容灾主备服务器或集群的心跳保活、升主降备等容灾操作管理,而repService负责容灾数据库、文件的主备拷贝任务等。For example, the disaster recovery processing service may include a disaster recovery management service (drService) and a disaster recovery data synchronization service (repService). Among them, drService is responsible for disaster recovery operation management such as heartbeat keep-alive and active / standby backup of the disaster recovery master or backup server or cluster, and repService is responsible for disaster recovery database, primary and backup copy tasks of files, etc.
具体的,当服务器201的状态为工作状态时,服务器201的drService将其主备标识设置为主服务器对应的标识。相应的,此时服务器202能够接收到服务器201发送的心跳报文,所以服务器202的drService将其主备标识设置为备服务器对应的标识。Specifically, when the state of the server 201 is a working state, the drService of the server 201 sets its master and backup identifiers to identifiers corresponding to the master server. Correspondingly, at this time, the server 202 can receive the heartbeat message sent by the server 201, so the drService of the server 202 sets its primary and secondary identifiers to the identifier corresponding to the secondary server.
当服务器201的状态为故障状态时,服务器201的drService将其主备标识设置为备服务器对应的标识。此时,若服务器202在预设时间段内无法接收到服务器201发送的心跳报文,则服务器202的drService将其主备标识设置为主服务器对应的标识。When the state of the server 201 is a fault state, the drService of the server 201 sets its primary and secondary identifiers to the identifier corresponding to the secondary server. At this time, if the server 202 cannot receive the heartbeat message sent by the server 201 within a preset period of time, the drService of the server 202 sets its master and backup identifiers to the identifiers corresponding to the master server.
另外,当服务器201作为主服务器时,服务器201的repService负责向服务器202同步其业务数据和文件。当服务器202作为主服务器时,服务器202的repService负责向服务器201同步其业务数据和文件。In addition, when the server 201 serves as the main server, the repService of the server 201 is responsible for synchronizing its business data and files to the server 202. When the server 202 serves as the main server, the repService of the server 202 is responsible for synchronizing its business data and files to the server 201.
3、在服务器201和服务器202中配置边界网关协议服务(BGP Service)。3. Configure a border gateway protocol service (BGP Service) in the server 201 and the server 202.
服务器201和服务器202可以通过调用BGP Service来实现向外发布路由信息的目的。具体的,首先通过调用BGP Service来创建BGP对等体(peer)。服务器201和服务器202的对等体为与这两个服务器互为邻居的设备,比如说路由设备203可以既为服务器201的对等体,又为服务器202的对等体。服务器201可以将与服务器201的南向接口IP地址和/或北向接口IP地址发送给路由设备203,服务器202可以将与服务器202的南向接口IP地址和/或北向接口IP地址发送给路由设备203。The server 201 and the server 202 can achieve the purpose of publishing routing information by calling BGP Service. Specifically, first, a BGP peer is created by calling a BGP service. The peers of the server 201 and the server 202 are devices that are neighbors to each other. For example, the routing device 203 may be both a peer of the server 201 and a peer of the server 202. The server 201 may send the southbound interface IP address and / or the northbound interface IP address with the server 201 to the routing device 203, and the server 202 may send the southbound interface IP address and / or the northbound interface IP address with the server 202 to the routing device. 203.
由于服务器201、服务器202和路由设备203属于相同的自治域,所以BGP Service中的BGP具体可以为IBGP。倘若路由设备203位于AS100之外,那么BGP Service中的BGP具体可以为EBGP。Since the server 201, the server 202, and the routing device 203 belong to the same autonomous domain, the BGP in the BGP service can be specifically IBGP. If the routing device 203 is located outside the AS 100, the BGP in the BGP service can be specifically EBGP.
当服务器201处于工作状态时,服务器201可以调用自身的IBGP Service将与服务器201相关联的IP地址以及服务器201的本地IP地址之间的映射关系发送给路由设备203,由路由设备203根据该映射关系建立路由表项L1。其中与服务器201相关联的IP地址为服务器201的南向接口IP地址和/或北向接口IP地址。路由表项L1中的目的地址为 该与服务器201相关联的IP地址,下一跳地址为服务器201的本地IP地址。其中,服务器201的本地IP地址和与服务器201相关联的IP地址不同,服务器201的本地地址例如为100.10.1.0/24。When the server 201 is in a working state, the server 201 can call its own IBGP service to send the mapping relationship between the IP address associated with the server 201 and the local IP address of the server 201 to the routing device 203, and the routing device 203 according to the mapping Relationship establishment routing table entry L1. The IP address associated with the server 201 is a southbound interface IP address and / or a northbound interface IP address of the server 201. The destination address in the routing entry L1 is the IP address associated with the server 201, and the next hop address is the local IP address of the server 201. The local IP address of the server 201 is different from the IP address associated with the server 201, and the local address of the server 201 is, for example, 100.10.1.0/24.
路由设备203还可以进一步将与服务器201相关联的IP地址以及路由设备203的本地IP地址之间的映射关系上传至路由设备40,以在路由设备40中建立路由表项L2,该路由表项L2的目的地址为与服务器201相关联的IP地址,下一跳地址为路由设备203的本地地址。The routing device 203 may further upload the mapping relationship between the IP address associated with the server 201 and the local IP address of the routing device 203 to the routing device 40 to establish a routing entry L2 in the routing device 40. The destination address of L2 is the IP address associated with the server 201, and the next hop address is the local address of the routing device 203.
而服务器202可以调用自身的IBGP Service取消发送动作,该发送动作为将与服务器201相关联的IP地址以及服务器202的本地IP地址之间的映射关系发送给路由设备203的动作,目的为不让路由设备203根据该映射关系建立路由表项L3。The server 202 can call its own IBGP Service to cancel the sending action. The sending action is the action of sending the mapping relationship between the IP address associated with the server 201 and the local IP address of the server 202 to the routing device 203, in order not to let The routing device 203 establishes a routing entry L3 according to the mapping relationship.
可选的,若路由设备203之前根据与服务器201相关联的IP地址以及服务器202的本地IP地址之间的映射关系建立过路由表项L3,那么服务器202可以调用自身的IBGP Service发送删除指令M1,以删除路由设备203中存储的该路由表项L3。Optionally, if the routing device 203 has previously established the routing entry L3 according to the mapping relationship between the IP address associated with the server 201 and the local IP address of the server 202, the server 202 may call its own IBGP service to send a delete instruction M1 To delete the routing table entry L3 stored in the routing device 203.
这样,当路由设备40在接收到报文时,根据报文中携带的与服务器201相关联的IP地址从路由表项L2中确定下一跳地址,即路由设备203的本地IP地址,并将该报文转发给路由设备203。而路由设备203在接收到报文后,根据报文中的与服务器201相关联的IP地址从路由表项L1中确定下一跳地址,即服务器201的本地IP地址,然后将该报文转发给服务器201。In this way, when the routing device 40 receives the message, it determines the next hop address from the routing entry L2 according to the IP address associated with the server 201 carried in the message, that is, the local IP address of the routing device 203, and The message is forwarded to the routing device 203. After receiving the message, the routing device 203 determines the next hop address from the routing entry L1 according to the IP address associated with the server 201 in the message, that is, the local IP address of the server 201, and then forwards the message. To server 201.
当服务器201处于故障状态时,服务器202可以调用自身的IBGP Service将与服务器201相关联的IP地址以及服务器202的本地IP地址之间的映射关系发送给路由设备203,由路由设备203根据该映射关系建立路由表项L3。其中,服务器202的本地IP地址和与服务器201相关联的IP地址不同,服务器202的本地地址例如为100.10.1.1/24。When the server 201 is in a fault state, the server 202 can call its own IBGP service to send the mapping relationship between the IP address associated with the server 201 and the local IP address of the server 202 to the routing device 203, and the routing device 203 according to the mapping Relationship establishment routing entry L3. The local IP address of the server 202 is different from the IP address associated with the server 201, and the local address of the server 202 is, for example, 100.10.1.1/24.
而服务器201此时因为由主服务器降为备服务器,所以调用自身的IBGP Service取消发送动作,该发送动作为将与服务器201相关联的IP地址以及服务器201的本地IP地址之间的映射关系发送给路由设备203的动作,取消的目的为不让路由设备203根据该映射关系建立路由表项L1。Since the server 201 is downgraded from the primary server to the standby server at this time, it calls its own IBGP service to cancel the sending action. The sending action is to send the mapping relationship between the IP address associated with the server 201 and the local IP address of the server 201. For the action of the routing device 203, the purpose of cancellation is to prevent the routing device 203 from establishing a routing table entry L1 according to the mapping relationship.
可选的,由于路由设备203之前根据与服务器201相关联的IP地址以及服务器202的本地IP地址之间的映射关系建立过路由表项L1,那么服务器201可以调用自身的IBGP Service发送删除指令M2,以删除路由设备203中存储的该路由表项L1。Optionally, since the routing device 203 has previously established the routing entry L1 according to the mapping relationship between the IP address associated with the server 201 and the local IP address of the server 202, the server 201 can call its own IBGP service to send a delete instruction M2 To delete the routing table entry L1 stored in the routing device 203.
这样,当路由设备40在接收到报文时,根据报文中携带的与服务器201相关联的IP地址从路由表项L2中确定下一跳地址,即路由设备203的本地地址,并将该报文转发给路由设备203。而路由设备203在接收到报文后,根据报文中的与服务器201相关联的IP地址从路由表项L3中确定下一跳地址,即服务器202的本地IP地址,然后将该报文转发给服务器202。In this way, when the routing device 40 receives the message, it determines the next hop address from the routing entry L2 according to the IP address associated with the server 201 carried in the message, that is, the local address of the routing device 203, and The message is forwarded to the routing device 203. After receiving the message, the routing device 203 determines the next hop address from the routing entry L3 according to the IP address associated with the server 201 in the message, that is, the local IP address of the server 202, and then forwards the message. To server 202.
由于整个服务器集群20内部的主备服务器切换的过程是自动实现的,无需用户修改IP地址,也无需增加管理人员额外修改优先权的工作量,所以更加便捷。Since the process of switching between the active and standby servers in the entire server cluster 20 is realized automatically, it is not necessary for the user to modify the IP address, and it does not need to increase the workload of the administrator to additionally modify the priority, so it is more convenient.
当服务器集群20中的服务器201和服务器202都出现故障,那么则需要启动服务器集群30。When both the server 201 and the server 202 in the server cluster 20 fail, the server cluster 30 needs to be started.
具体的,服务器集群20中的主服务器可以调用drService周期性的向服务器集群30的服务器(例如服务器301)发送心跳报文,如果服务器集群30的服务器在预设时间段内 没有接收到该心跳报文,则认为服务器集群20出现故障。此时,服务器集群30的服务器,例如服务器301调用drService将自身的备服务器标识修改为主服务器标识,并且调用BGP Service向路由设备303发送服务器301中的与服务器201相关联的IP地址和服务器301的本地IP地址之间的映射关系,以便在路由设备303中建立路由表项L4,路由表项L4的目的地址为该与服务器201相关联的IP地址,下一跳地址为服务器301的本地IP地址。服务器301的本地IP地址和与服务器201相关联的IP地址不同,例如服务器301的本地地址为100.10.2.0/24。Specifically, the master server in the server cluster 20 may call drService to periodically send a heartbeat message to the server (for example, the server 301) of the server cluster 30. If the server of the server cluster 30 does not receive the heartbeat report within a preset time period Text, it is considered that the server cluster 20 has failed. At this time, the servers of the server cluster 30, for example, the server 301 calls drService to change its own standby server ID to the primary server ID, and calls BGP Service to send the routing device 303 the IP address associated with the server 201 and the server 301 in the server 301 Mapping relationship between local IP addresses in order to establish routing entry L4 in routing device 303, the destination address of routing entry L4 is the IP address associated with server 201, and the next hop address is the local IP of server 301 address. The local IP address of the server 301 is different from the IP address associated with the server 201. For example, the local address of the server 301 is 100.10.2.0/24.
进一步的,路由设备303将与服务器201相关联的IP地址和路由设备303的本地IP地址发送给路由设备40,以便路由设备40能够建立路由表项L5,路由表项L5的目的地址为与服务器201相关联的IP地址,下一跳地址为路由设备303的本地IP地址。Further, the routing device 303 sends the IP address associated with the server 201 and the local IP address of the routing device 303 to the routing device 40, so that the routing device 40 can establish a routing entry L5, and the destination address of the routing entry L5 is for the server The IP address associated with 201, and the next hop address is the local IP address of the routing device 303.
由于服务器集群20中服务器的南向接口IP地址和服务器集群30中服务器的南向接口IP地址相同,服务器集群20中服务器的北向接口IP地址和服务器集群30中服务器的北向接口IP地址相同,所以对于用户而言,服务器集群20和服务器集群30之间的切换无需用户感知,方便用户访问。The southbound interface IP address of the server in server cluster 20 is the same as the southbound interface IP address of the server in server cluster 30, and the northbound interface IP address of the server in server cluster 20 is the same as the northbound interface IP address of the server in server cluster 30. For the user, switching between the server cluster 20 and the server cluster 30 does not require user awareness, and is convenient for users to access.
当路由设备40接收到报文之后,根据报文中的与服务器201相关联的IP地址从路由表项L5中找到对应的下一跳地址,即路由设备303的本地IP地址,并将报文转发给路由设备303。而路由设备303根据报文中的与服务器201相关联的IP地址从路由表项L4中找到下一跳地址,即服务器301的本地IP地址,从而使服务器301接收到该报文。When the routing device 40 receives the packet, it finds the corresponding next hop address from the routing entry L5 according to the IP address associated with the server 201 in the packet, that is, the local IP address of the routing device 303, and sends the packet Forward to routing device 303. The routing device 303 finds the next hop address from the routing table entry L4 according to the IP address associated with the server 201 in the message, that is, the local IP address of the server 301, so that the server 301 receives the message.
可见,服务器集群20和服务器集群30之间的切换过程也是自动实现的,给用户和管理人员提高体验。It can be seen that the switching process between the server cluster 20 and the server cluster 30 is also automatically implemented, which improves the experience for users and managers.
由于服务器集群30和服务器集群20的内部架构相似,所以其服务器301和服务器302中之间的切换,参见上述关于服务器201和服务器202之间的切换,此处不再赘述。Since the internal architectures of the server cluster 30 and the server cluster 20 are similar, the switching between the server 301 and the server 302 is referred to the above-mentioned switching between the server 201 and the server 202, which is not described herein again.
基于上述提供的通信系统,参见图3,该图为本申请实施例提供的一种通信方法的流程示意图。Based on the communication system provided above, refer to FIG. 3, which is a schematic flowchart of a communication method according to an embodiment of the present application.
本申请实施例提供的通信方法可以应用于如图1所示实施例的第一服务器,该方法具体包括如下步骤:The communication method provided in the embodiment of the present application can be applied to the first server in the embodiment shown in FIG. 1. The method specifically includes the following steps:
S101:获取第一映射关系,所述第一映射关系为与所述第一服务器相关联的互联网协议IP地址和所述第一服务器的本地IP地址之间的映射关系,所述与所述第一服务器相关联的IP地址包括预设南向接口IP地址和/或预设北向接口IP地址;S101: Obtain a first mapping relationship, where the first mapping relationship is a mapping relationship between an Internet Protocol IP address associated with the first server and a local IP address of the first server, and the first mapping relationship The IP address associated with a server includes a preset southbound interface IP address and / or a preset northbound interface IP address;
S102:基于边界网关协议向目标设备发送所述第一映射关系。S102: Send the first mapping relationship to a target device based on a border gateway protocol.
在本申请实施例中,第一服务器向目标设备发送与所述第一服务器相关联的IP地址和所述第一服务器的本地IP地址之间的映射关系,即第一映射关系,这样,目标设备可以根据第一映射关系访问第一服务器。对于用户而言,可以采用与第一服务器相关联的IP地址来访问第一服务器,而无需采用第一服务器的IP地址来访问第一服务器,即用户无需感知第一服务器就可以实现访问。当第一服务器发生故障,需要更换到第二服务器时,目标设备只需要将与第一服务器相关联的IP地址和第一服务器的IP地址之间的映射关系,改变为与第一服务器相关联的IP地址和第二服务器的IP地址之间的映射关系即可,用户不需要在服务器之间切换的时候改变访问的地址,给用户提供了方便。同时,由于向目标设备发送与第一服务器相关联的IP地址是第一服务器,而不是第一服务器的路由设 备,所以不需要在路由设备上设置优先级来控制目标设备是否访问第一服务器,减少了管理人员的工作量。In the embodiment of the present application, the first server sends a mapping relationship between the IP address associated with the first server and the local IP address of the first server to the target device, that is, the first mapping relationship. In this way, the target The device may access the first server according to the first mapping relationship. For the user, the IP address associated with the first server can be used to access the first server, and the IP address of the first server does not need to be used to access the first server, that is, the user can access without having to sense the first server. When the first server fails and needs to be replaced with the second server, the target device only needs to change the mapping relationship between the IP address associated with the first server and the IP address of the first server to be associated with the first server The mapping relationship between the IP address of the IP address and the IP address of the second server is sufficient. The user does not need to change the accessed address when switching between servers, which provides convenience to the user. At the same time, since the IP address associated with the first server is sent to the target device as the first server, not the routing device of the first server, there is no need to set a priority on the routing device to control whether the target device accesses the first server, Reduced workload for managers.
可选的,所述目标设备包括路由设备;Optionally, the target device includes a routing device;
所述基于边界网关协议向所述目标设备发送第一映射关系包括:The sending a first mapping relationship to the target device based on a border gateway protocol includes:
基于边界网关协议向所述路由设备发送第一路由表项生成指令,所述第一路由表项生成指令中携带所述第一映射关系,所述第一路由表项生成指令用于指示所述路由设备根据所述第一映射关系生成第一路由表项,所述第一路由表项的目的地址为所述与所述第一服务器相关联的IP地址,所述第一路由表项的下一跳地址为所述第一服务器的本地IP地址。Send a first routing table entry generation instruction to the routing device based on a border gateway protocol, the first routing table entry generation instruction carries the first mapping relationship, and the first routing table entry generation instruction is used to indicate the The routing device generates a first routing entry according to the first mapping relationship. The destination address of the first routing entry is the IP address associated with the first server. The one-hop address is the local IP address of the first server.
可选的,所述方法还包括:Optionally, the method further includes:
若所述第一服务器的状态为故障状态,则向所述路由设备发送第一删除指令,所述第一删除指令用于指示所述路由设备删除所述第一路由表项。If the state of the first server is a fault state, sending a first deletion instruction to the routing device, where the first deletion instruction is used to instruct the routing device to delete the first routing entry.
可选的,所述基于边界网关协议向目标设备发送所述第一映射关系包括:Optionally, the sending the first mapping relationship to a target device based on a border gateway protocol includes:
若所述第一服务器的状态为工作状态,则将所述第一服务器的主备标识设置为主服务器对应的标识;If the state of the first server is a working state, setting an active-standby identifier of the first server to an identifier corresponding to the primary server;
若检测到所述第一服务器的主备标识为所述主服务器对应的标识时,则基于边界网关协议向所述目标设备发送所述第一映射关系。If it is detected that the primary and secondary identifiers of the first server are identifiers corresponding to the primary server, the first mapping relationship is sent to the target device based on a border gateway protocol.
可选的,所述第一服务器包括负载均衡服务器。Optionally, the first server includes a load balancing server.
参见图4,该图为本申请实施例提供的一种通信方法的流程示意图。Refer to FIG. 4, which is a schematic flowchart of a communication method according to an embodiment of the present application.
本申请实施例提供的通信方法可以应用于如图1所示的第二服务器,具体包括如下步骤:The communication method provided in the embodiment of the present application may be applied to the second server shown in FIG. 1, and specifically includes the following steps:
S201:获取第一服务器的状态和第二映射关系,所述第二映射关系为与所述第一服务器相关联的IP地址和所述第二服务器的本地IP地址之间的映射关系,所述与所述第一服务器相关联的IP地址包括预设南向接口互联网协议IP地址和/或预设北向接口IP地址;S201: Obtain a state of a first server and a second mapping relationship, where the second mapping relationship is a mapping relationship between an IP address associated with the first server and a local IP address of the second server, where The IP address associated with the first server includes a preset southbound interface Internet protocol IP address and / or a preset northbound interface IP address;
S202:若所述状态为故障状态,则基于边界网关协议向目标设备发送所述第二映射关系。S202: If the state is a fault state, send the second mapping relationship to the target device based on a border gateway protocol.
在本申请实施例中,第二服务器向目标设备发送与所述第一服务器相关联的互联网协议IP地址和所述第二服务器的本地IP地址之间的映射关系,即第二映射关系,这样,目标设备可以根据第二映射关系访问第二服务器。对于用户而言,可以采用与第二服务器相关联的IP地址来访问第二服务器,而无需采用第二服务器的IP地址来访问第二服务器,即用户无需感知第二服务器就可以实现访问。也就是说,当第一服务器发生故障,需要更换到第二服务器时,只需要将与第一服务器相关联的IP地址和第一服务器之间的映射关系改变为与第一服务器相关联的IP地址和第二服务器之间的映射关系即可,用户不需要在服务器之间切换的时候改变访问的地址,给用户提供了方便。同时,由于向目标设备发送与第一服务器相关联的IP地址是第二服务器,而不是第二服务器的路由设备,所以不需要在路由设备上设置优先级来控制路由设备是否访问第二服务器,而是由第二服务器自己通过获取第一服务器的状态,在状态为故障状态时,向目标设备发布与第一服务器相关联的IP地址,实现了对第二服务器的访问,减少了管理人员的工作量。In the embodiment of the present application, the second server sends the mapping relationship between the Internet Protocol IP address associated with the first server and the local IP address of the second server to the target device, that is, the second mapping relationship. , The target device may access the second server according to the second mapping relationship. For the user, the IP address associated with the second server can be used to access the second server, and the IP address of the second server does not need to be used to access the second server, that is, the user can access without having to sense the second server. That is, when the first server fails and needs to be replaced with the second server, it is only necessary to change the mapping relationship between the IP address associated with the first server and the first server to the IP associated with the first server. The mapping relationship between the address and the second server is sufficient, and the user does not need to change the accessed address when switching between servers, which provides convenience to the user. At the same time, because the IP address associated with the first server is sent to the target device as the second server, not the routing device of the second server, there is no need to set a priority on the routing device to control whether the routing device accesses the second server. Instead, the second server itself obtains the status of the first server, and when the status is faulty, it publishes the IP address associated with the first server to the target device to achieve access to the second server and reduce the management staff ’s Workload.
可选的,所述目标设备包括路由设备;Optionally, the target device includes a routing device;
所述基于边界网关协议向所述目标设备发送所述第二映射关系包括:The sending the second mapping relationship to the target device based on a border gateway protocol includes:
基于边界网关协议向所述路由设备发送第二路由表项生成指令,所述第二路由表项生成指令中携带所述第二映射关系,所述第二路由表项生成指令用于指示所述路由设备根据所述第二映射关系生成第二路由表项,所述第二路由表项的目的地址为所述与所述第一服务器相关联的IP地址,所述第二路由表项的下一跳地址为所述第二服务器的本地IP地址。Sending a second routing table entry generation instruction to the routing device based on a border gateway protocol, the second routing table entry generation instruction carrying the second mapping relationship, and the second routing table entry generation instruction used to instruct the routing device The routing device generates a second routing entry according to the second mapping relationship. The destination address of the second routing entry is the IP address associated with the first server. The one-hop address is the local IP address of the second server.
可选的,所述基于边界网关协议向目标设备发送所述第二映射关系包括:Optionally, the sending the second mapping relationship to the target device based on the border gateway protocol includes:
若所述第一服务器的状态为故障状态,则将所述第二服务器的主备标识设置为主服务器对应的标识;If the state of the first server is a fault state, setting an active-standby identifier of the second server to an identifier corresponding to the primary server;
当检测到所述第二服务器的主备标识为所述主服务器对应的标识时,基于边界网关协议向所述目标设备发送所述第二映射关系。When it is detected that the primary and secondary identifiers of the second server are identifiers corresponding to the primary server, the second mapping relationship is sent to the target device based on a border gateway protocol.
可选的,所述第二服务器包括负载均衡服务器。Optionally, the second server includes a load balancing server.
参见图5,该图为本申请实施例提供的一种通信装置的结构框图。Referring to FIG. 5, this figure is a structural block diagram of a communication device according to an embodiment of the present application.
本申请实施例提供的通信装置,应用于第一服务器,所述装置包括:The communication device provided in the embodiment of the present application is applied to a first server, and the device includes:
获取单元501,用于获取第一映射关系,所述第一映射关系为与所述第一服务器相关联的互联网协议IP地址和所述第一服务器的本地IP地址之间的映射关系,所述与所述第一服务器相关联的IP地址包括预设南向接口IP地址和/或预设北向接口IP地址;The obtaining unit 501 is configured to obtain a first mapping relationship, where the first mapping relationship is a mapping relationship between an Internet Protocol IP address associated with the first server and a local IP address of the first server, where The IP address associated with the first server includes a preset southbound interface IP address and / or a preset northbound interface IP address;
发送单元502,用于基于边界网关协议向目标设备发送所述第一映射关系。The sending unit 502 is configured to send the first mapping relationship to a target device based on a border gateway protocol.
可选的,所述目标设备包括路由设备;Optionally, the target device includes a routing device;
所述发送单元502,用于基于边界网关协议向所述路由设备发送第一路由表项生成指令,所述第一路由表项生成指令中携带所述第一映射关系,所述第一路由表项生成指令用于指示所述路由设备根据所述第一映射关系生成第一路由表项,所述第一路由表项的目的地址为所述与所述第一服务器相关联的IP地址,所述第一路由表项的下一跳地址为所述第一服务器的本地IP地址。The sending unit 502 is configured to send a first routing table entry generation instruction to the routing device based on a border gateway protocol, where the first routing table entry generation instruction carries the first mapping relationship, and the first routing table The entry generation instruction is used to instruct the routing device to generate a first routing entry according to the first mapping relationship, and a destination address of the first routing entry is the IP address associated with the first server. The next hop address of the first routing entry is the local IP address of the first server.
可选的,所述装置还包括:Optionally, the device further includes:
删除单元,用于若所述第一服务器的状态为故障状态,则向所述路由设备发送第一删除指令,所述第一删除指令用于指示所述路由设备删除所述第一路由表项。A deleting unit, configured to send a first deletion instruction to the routing device if the state of the first server is a fault state, and the first deletion instruction is used to instruct the routing device to delete the first routing entry .
可选的,所述发送单元,用于若所述第一服务器的状态为工作状态,则将所述第一服务器的主备标识设置为主服务器对应的标识;若检测到所述第一服务器的主备标识为所述主服务器对应的标识时,则基于边界网关协议向所述目标设备发送所述第一映射关系。Optionally, the sending unit is configured to set an active / standby identifier of the first server to an identifier corresponding to the active server if the state of the first server is a working state; if the first server is detected When the primary and secondary identifiers are the identifiers corresponding to the primary server, the first mapping relationship is sent to the target device based on a border gateway protocol.
可选的,所述第一服务器包括负载均衡服务器。Optionally, the first server includes a load balancing server.
参见图6,该图为本申请实施例提供的另外一种通信装置的结构框图。Referring to FIG. 6, this figure is a structural block diagram of another communication device according to an embodiment of the present application.
本申请实施例提供的通信装置,应用于第二服务器,所述装置包括:The communication device provided in the embodiment of the present application is applied to a second server, and the device includes:
获取单元601,用于获取第一服务器的状态和第二映射关系,所述第二映射关系为与所述第一服务器相关联的IP地址和所述第二服务器的本地IP地址之间的映射关系,所述与所述第一服务器相关联的IP地址包括预设南向接口互联网协议IP地址和/或预设北向接口IP地址;An obtaining unit 601 is configured to obtain a state of a first server and a second mapping relationship, where the second mapping relationship is a mapping between an IP address associated with the first server and a local IP address of the second server Relationship, the IP address associated with the first server includes a preset southbound interface Internet protocol IP address and / or a preset northbound interface IP address;
发送单元602,用于若所述状态为故障状态,则基于边界网关协议向目标设备发送所述第二映射关系。The sending unit 602 is configured to send the second mapping relationship to a target device based on a border gateway protocol if the status is a fault status.
可选的,所述目标设备包括路由设备;Optionally, the target device includes a routing device;
所述发送单元602,用于基于边界网关协议向所述路由设备发送第二路由表项生成指令,所述第二路由表项生成指令中携带所述第二映射关系,所述第二路由表项生成指令用于指示所述路由设备根据所述第二映射关系生成第二路由表项,所述第二路由表项的目的地址为所述与所述第一服务器相关联的IP地址,所述第二路由表项的下一跳地址为所述第二服务器的本地IP地址。The sending unit 602 is configured to send a second routing table entry generation instruction to the routing device based on a border gateway protocol, where the second routing table entry generation instruction carries the second mapping relationship, and the second routing table The entry generation instruction is used to instruct the routing device to generate a second routing table entry according to the second mapping relationship. The destination address of the second routing table entry is the IP address associated with the first server. The next hop address of the second routing entry is the local IP address of the second server.
可选的,所述发送单元602,用于若所述第一服务器的状态为故障状态,则将所述第二服务器的主备标识设置为主服务器对应的标识;当检测到所述第二服务器的主备标识为所述主服务器对应的标识时,基于边界网关协议向所述目标设备发送所述第二映射关系。Optionally, the sending unit 602 is configured to set an active / standby identifier of the second server to an identifier corresponding to the active server if the state of the first server is a fault state; when the second server is detected, When the primary and secondary identifiers of the server are identifiers corresponding to the primary server, the second mapping relationship is sent to the target device based on a border gateway protocol.
可选的,所述第二服务器包括负载均衡服务器。Optionally, the second server includes a load balancing server.
参见图7,该图为本申请实施例提供的一种服务器的结构框图。Referring to FIG. 7, this figure is a structural block diagram of a server according to an embodiment of the present application.
本申请实施例提供的服务器700为第一服务器,服务器700可以实现图3所示实施例中第一服务器的功能。服务器700包括:处理器701、存储器702和通信单元703,其中,所述存储器702,用于存储指令;The server 700 provided in this embodiment of the present application is a first server, and the server 700 can implement the functions of the first server in the embodiment shown in FIG. 3. The server 700 includes: a processor 701, a memory 702, and a communication unit 703, where the memory 702 is configured to store instructions;
所述处理器701,用于执行所述存储器中的所述指令,执行如图3所示实施例中第一服务器的通信方法。The processor 701 is configured to execute the instructions in the memory and execute the communication method of the first server in the embodiment shown in FIG. 3.
所述通信单元703,用于与第二服务器进行通信。The communication unit 703 is configured to communicate with a second server.
处理器701、存储器702和通信单元703通过总线704相互连接;总线704可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图7中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The processor 701, the memory 702, and the communication unit 703 are connected to each other through a bus 704; the bus 704 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus Wait. The bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used in FIG. 7, but it does not mean that there is only one bus or one type of bus.
在具体实现时,存储器702可以包括获取单元7021和发送单元7022,分别存储用于实现图5所示的获取单元501和发送单元502的计算机可读指令。相应的,处理器701具体通过执行获取单元7021中的指令实现获取单元501的功能,并通过执行发送单元7022的指令实现发送单元502的功能。In specific implementation, the memory 702 may include an obtaining unit 7021 and a sending unit 7022, which respectively store computer-readable instructions for implementing the obtaining unit 501 and the sending unit 502 shown in FIG. Correspondingly, the processor 701 specifically implements the functions of the obtaining unit 501 by executing instructions in the obtaining unit 7021, and implements the functions of the sending unit 502 by executing instructions of the sending unit 7022.
参见图8,该图为本申请实施例提供的另外一种服务器的结构框图。Referring to FIG. 8, this figure is a structural block diagram of another server provided by an embodiment of the present application.
本申请实施例提供的服务器800为第二服务器,服务器800可以实现图4所示实施例中第二服务器的功能。服务器800包括:处理器801、存储器802和通信单元803,其中,所述存储器802,用于存储指令;The server 800 provided in this embodiment of the present application is a second server, and the server 800 can implement the functions of the second server in the embodiment shown in FIG. 4. The server 800 includes: a processor 801, a memory 802, and a communication unit 803, where the memory 802 is configured to store instructions;
所述处理器801,用于执行所述存储器中的所述指令,执行如图3所示实施例中第一服务器的通信方法。The processor 801 is configured to execute the instructions in the memory and execute the communication method of the first server in the embodiment shown in FIG. 3.
所述通信单元803,用于与第二服务器进行通信。The communication unit 803 is configured to communicate with a second server.
处理器801、存储器802和通信单元803通过总线804相互连接;总线804可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图8中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The processor 801, the memory 802, and the communication unit 803 are connected to each other through a bus 804; the bus 804 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus Wait. The bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used in FIG. 8, but it does not mean that there is only one bus or one type of bus.
在具体实现时,存储器802可以包括获取单元8021和发送单元8022,分别存储用于 实现图6所示的获取单元601和发送单元602的计算机可读指令。相应的,处理器801具体通过执行获取单元8021中的指令实现获取单元601的功能,并通过执行发送单元8022的指令实现发送单元602的功能。In specific implementation, the memory 802 may include an obtaining unit 8021 and a sending unit 8022, which respectively store computer-readable instructions for implementing the obtaining unit 601 and the sending unit 602 shown in FIG. Correspondingly, the processor 801 specifically implements the function of the obtaining unit 601 by executing instructions in the obtaining unit 8021, and implements the function of the sending unit 602 by executing instructions of the sending unit 8022.
上述存储器701和存储器801可以是随机存取存储器(random-access memory,RAM)、闪存(flash)、只读存储器(read only memory,ROM)、可擦写可编程只读存储器(erasable programmable read only memory,EPROM)、电可擦除可编程只读存储器(electrically erasable programmable read only memory,EEPROM)、寄存器(register)、硬盘、移动硬盘、CD-ROM或者本领域技术人员知晓的任何其他形式的存储介质。存储器701可以仅表示一个存储器,也可以表示多个存储器;类似地,存储器801可以仅表示一个存储器,也可以表示多个存储器。The memory 701 and the memory 801 may be random-access memory (RAM), flash memory, flash, read-only memory (ROM), erasable programmable read-only memory (erasable, programmable, read-only) memory, EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard drives, mobile hard drives, CD-ROMs, or any other form of storage known to those skilled in the art medium. The memory 701 may represent only one memory or a plurality of memories; similarly, the memory 801 may represent only one memory or a plurality of memories.
上述处理器702和处理器802例如可以是中央处理器(central processing unit,CPU)、通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application-specific integrated circuit,ASIC)、现场可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等等。处理器702可以仅表示一个处理器,也可以表示多个处理器;类似的,处理器802可以仅表示一个处理器,也可以表示多个处理器。The processor 702 and the processor 802 may be, for example, a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), and an application-specific integrated circuit (ASIC). , Field programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logical blocks, modules, and circuits described in connection with the present disclosure. A processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and so on. The processor 702 may represent only one processor or multiple processors; similarly, the processor 802 may represent only one processor or multiple processors.
上述通信单元703和通信单元803例如可以是I/O接口、LAN接口和WAN接口等。The communication unit 703 and the communication unit 803 may be, for example, an I / O interface, a LAN interface, a WAN interface, and the like.
本申请实施例还提供了一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得计算机执行以上应用于第一服务器和/或第二服务器的通信方法。An embodiment of the present application further provides a computer-readable storage medium including instructions that, when run on a computer, cause the computer to execute the above communication method applied to the first server and / or the second server.
本申请实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行以上应用于第一服务器和/或第二服务器的通信方法。The embodiment of the present application further provides a computer program product containing instructions, which when executed on a computer, causes the computer to execute the above communication method applied to the first server and / or the second server.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and are not repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods may be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the unit is only a logical function division. In actual implementation, 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 implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, which may be electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objective of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理器中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processor, or each unit may exist separately physically, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially a part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium. , Including a plurality of instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present application. The foregoing storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes .
本领域技术人员应该可以意识到,在上述一个或多个示例中,本发明所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。Those skilled in the art should be aware that, in one or more of the above examples, the functions described in the present invention may be implemented by hardware, software, firmware, or any combination thereof. When implemented in software, the functions may be stored on a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media includes computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
以上所述的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施方式而已。The specific embodiments described above further describe the objectives, technical solutions, and beneficial effects of the present invention in detail, and it should be understood that the above are only specific embodiments of the present invention.
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。As mentioned above, the above embodiments are only used to describe the technical solution of the present application, rather than limiting them. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still apply the foregoing The technical solutions described in the embodiments are modified, or some technical features are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions outside the scope of the technical solutions of the embodiments of the present application.
Claims (19)
- 一种通信方法,其特征在于,应用于第一服务器,所述方法包括:A communication method, which is applied to a first server, and the method includes:获取第一映射关系,所述第一映射关系为与所述第一服务器相关联的互联网协议IP地址和所述第一服务器的本地IP地址之间的映射关系,所述与所述第一服务器相关联的IP地址包括预设南向接口IP地址和/或预设北向接口IP地址;A first mapping relationship is obtained, where the first mapping relationship is a mapping relationship between an Internet Protocol IP address associated with the first server and a local IP address of the first server, and the first server The associated IP address includes a preset southbound interface IP address and / or a preset northbound interface IP address;基于边界网关协议向目标设备发送所述第一映射关系。And sending the first mapping relationship to a target device based on a border gateway protocol.
- 根据权利要求1所述的方法,其特征在于,所述目标设备包括路由设备;The method according to claim 1, wherein the target device comprises a routing device;所述基于边界网关协议向所述目标设备发送第一映射关系包括:The sending a first mapping relationship to the target device based on a border gateway protocol includes:基于边界网关协议向所述路由设备发送第一路由表项生成指令,所述第一路由表项生成指令中携带所述第一映射关系,所述第一路由表项生成指令用于指示所述路由设备根据所述第一映射关系生成第一路由表项,所述第一路由表项的目的地址为所述与所述第一服务器相关联的IP地址,所述第一路由表项的下一跳地址为所述第一服务器的本地IP地址。Send a first routing table entry generation instruction to the routing device based on a border gateway protocol, the first routing table entry generation instruction carries the first mapping relationship, and the first routing table entry generation instruction is used to indicate the The routing device generates a first routing entry according to the first mapping relationship. The destination address of the first routing entry is the IP address associated with the first server. The one-hop address is the local IP address of the first server.
- 根据权利要求2所述的方法,其特征在于,所述方法还包括:The method according to claim 2, further comprising:若所述第一服务器的状态为故障状态,则向所述路由设备发送第一删除指令,所述第一删除指令用于指示所述路由设备删除所述第一路由表项。If the state of the first server is a fault state, sending a first deletion instruction to the routing device, where the first deletion instruction is used to instruct the routing device to delete the first routing entry.
- 根据权利要求1-3任一项所述的方法,其特征在于,所述基于边界网关协议向目标设备发送所述第一映射关系包括:The method according to any one of claims 1-3, wherein the sending the first mapping relationship to a target device based on a border gateway protocol comprises:若所述第一服务器的状态为工作状态,则将所述第一服务器的主备标识设置为主服务器对应的标识;If the state of the first server is a working state, setting an active-standby identifier of the first server to an identifier corresponding to the primary server;若检测到所述第一服务器的主备标识为所述主服务器对应的标识时,则基于边界网关协议向所述目标设备发送所述第一映射关系。If it is detected that the primary and secondary identifiers of the first server are identifiers corresponding to the primary server, the first mapping relationship is sent to the target device based on a border gateway protocol.
- 根据权利要求1-4任一项所述的方法,其特征在于,所述第一服务器包括负载均衡服务器。The method according to any one of claims 1-4, wherein the first server comprises a load balancing server.
- 一种通信方法,其特征在于,应用于第二服务器,所述方法包括:A communication method, which is applied to a second server, and the method includes:获取第一服务器的状态和第二映射关系,所述第二映射关系为与所述第一服务器相关联的IP地址和所述第二服务器的本地IP地址之间的映射关系,所述与所述第一服务器相关联的IP地址包括预设南向接口互联网协议IP地址和/或预设北向接口IP地址;Acquiring a state of a first server and a second mapping relationship, where the second mapping relationship is a mapping relationship between an IP address associated with the first server and a local IP address of the second server, and the The IP address associated with the first server includes a preset southbound interface Internet protocol IP address and / or a preset northbound interface IP address;若所述状态为故障状态,则基于边界网关协议向目标设备发送所述第二映射关系。If the state is a fault state, the second mapping relationship is sent to the target device based on a border gateway protocol.
- 根据权利要求6所述的方法,其特征在于,所述目标设备包括路由设备;The method according to claim 6, wherein the target device comprises a routing device;所述基于边界网关协议向所述目标设备发送所述第二映射关系包括:The sending the second mapping relationship to the target device based on a border gateway protocol includes:基于边界网关协议向所述路由设备发送第二路由表项生成指令,所述第二路由表项生成指令中携带所述第二映射关系,所述第二路由表项生成指令用于指示所述路由设备根据所述第二映射关系生成第二路由表项,所述第二路由表项的目的地址为所述与所述第一服务器相关联的IP地址,所述第二路由表项的下一跳地址为所述第二服务器的本地IP地址。Sending a second routing table entry generation instruction to the routing device based on a border gateway protocol, the second routing table entry generation instruction carrying the second mapping relationship, and the second routing table entry generation instruction used to instruct the routing device The routing device generates a second routing entry according to the second mapping relationship. The destination address of the second routing entry is the IP address associated with the first server. The one-hop address is the local IP address of the second server.
- 根据权利要求6或7所述的方法,其特征在于,所述基于边界网关协议向目标设备发送所述第二映射关系包括:The method according to claim 6 or 7, wherein the sending the second mapping relationship to a target device based on a border gateway protocol comprises:若所述第一服务器的状态为故障状态,则将所述第二服务器的主备标识设置为主服务器对应的标识;If the state of the first server is a fault state, setting an active-standby identifier of the second server to an identifier corresponding to the primary server;当检测到所述第二服务器的主备标识为所述主服务器对应的标识时,基于边界网关协议向所述目标设备发送所述第二映射关系。When it is detected that the primary and secondary identifiers of the second server are identifiers corresponding to the primary server, the second mapping relationship is sent to the target device based on a border gateway protocol.
- 根据权利要求6-8任一项所述的方法,其特征在于,所述第二服务器包括负载均衡服务器。The method according to any one of claims 6 to 8, wherein the second server comprises a load balancing server.
- 一种通信装置,其特征在于,应用于第一服务器,所述装置包括:A communication device, which is applied to a first server, and the device includes:获取单元,用于获取第一映射关系,所述第一映射关系为与所述第一服务器相关联的互联网协议IP地址和所述第一服务器的本地IP地址之间的映射关系,所述与所述第一服务器相关联的IP地址包括预设南向接口IP地址和/或预设北向接口IP地址;An obtaining unit, configured to obtain a first mapping relationship, where the first mapping relationship is a mapping relationship between an Internet Protocol IP address associated with the first server and a local IP address of the first server, and the The IP address associated with the first server includes a preset southbound interface IP address and / or a preset northbound interface IP address;发送单元,用于基于边界网关协议向目标设备发送所述第一映射关系。A sending unit, configured to send the first mapping relationship to a target device based on a border gateway protocol.
- 根据权利要求10所述的装置,其特征在于,所述目标设备包括路由设备;The apparatus according to claim 10, wherein the target device comprises a routing device;所述发送单元,用于基于边界网关协议向所述路由设备发送第一路由表项生成指令,所述第一路由表项生成指令中携带所述第一映射关系,所述第一路由表项生成指令用于指示所述路由设备根据所述第一映射关系生成第一路由表项,所述第一路由表项的目的地址为所述与所述第一服务器相关联的IP地址,所述第一路由表项的下一跳地址为所述第一服务器的本地IP地址。The sending unit is configured to send a first routing table entry generation instruction to the routing device based on a border gateway protocol, where the first routing table entry generation instruction carries the first mapping relationship, and the first routing table entry The generating instruction is used to instruct the routing device to generate a first routing entry according to the first mapping relationship, and a destination address of the first routing entry is the IP address associated with the first server. The next hop address of the first routing entry is the local IP address of the first server.
- 根据权利要求11所述的装置,其特征在于,所述装置还包括:The device according to claim 11, further comprising:删除单元,用于若所述第一服务器的状态为故障状态,则向所述路由设备发送第一删除指令,所述第一删除指令用于指示所述路由设备删除所述第一路由表项。A deleting unit, configured to send a first deletion instruction to the routing device if the state of the first server is a fault state, and the first deletion instruction is used to instruct the routing device to delete the first routing entry .
- 根据权利要求10-12任一项所述的装置,其特征在于,The device according to any one of claims 10-12, wherein:所述发送单元,用于若所述第一服务器的状态为工作状态,则将所述第一服务器的主备标识设置为主服务器对应的标识;若检测到所述第一服务器的主备标识为所述主服务器对应的标识时,则基于边界网关协议向所述目标设备发送所述第一映射关系。The sending unit is configured to set the master / slave identifier of the first server as the identifier corresponding to the master server if the state of the first server is the working state; if the master / slave identifier of the first server is detected When it is the identifier corresponding to the main server, the first mapping relationship is sent to the target device based on a border gateway protocol.
- 根据权利要求10-13任一项所述的装置,其特征在于,所述第一服务器包括负载均衡服务器。The apparatus according to any one of claims 10-13, wherein the first server comprises a load balancing server.
- 一种通信装置,其特征在于,应用于第二服务器,所述装置包括:A communication device, which is applied to a second server, and the device includes:获取单元,用于获取第一服务器的状态和第二映射关系,所述第二映射关系为与所述第一服务器相关联的IP地址和所述第二服务器的本地IP地址之间的映射关系,所述与所述第一服务器相关联的IP地址包括预设南向接口互联网协议IP地址和/或预设北向接口IP地址;An obtaining unit, configured to obtain a state of the first server and a second mapping relationship, where the second mapping relationship is a mapping relationship between an IP address associated with the first server and a local IP address of the second server The IP address associated with the first server includes a preset southbound interface Internet protocol IP address and / or a preset northbound interface IP address;发送单元,用于若所述状态为故障状态,则基于边界网关协议向目标设备发送所述第二映射关系。A sending unit is configured to send the second mapping relationship to a target device based on a border gateway protocol if the status is a fault status.
- 根据权利要求15所述的装置,其特征在于,所述目标设备包括路由设备;The apparatus according to claim 15, wherein the target device comprises a routing device;所述发送单元,用于基于边界网关协议向所述路由设备发送第二路由表项生成指令,所述第二路由表项生成指令中携带所述第二映射关系,所述第二路由表项生成指令用于指示所述路由设备根据所述第二映射关系生成第二路由表项,所述第二路由表项的目的地址为所述与所述第一服务器相关联的IP地址,所述第二路由表项的下一跳地址为所述第二服务器的本地IP地址。The sending unit is configured to send a second routing table entry generation instruction to the routing device based on a border gateway protocol, where the second routing table entry generation instruction carries the second mapping relationship, and the second routing table entry The generating instruction is used to instruct the routing device to generate a second routing entry according to the second mapping relationship, and a destination address of the second routing entry is the IP address associated with the first server. The next hop address of the second routing entry is the local IP address of the second server.
- 根据权利要求15或16所述的装置,其特征在于,The device according to claim 15 or 16, wherein:所述发送单元,用于若所述第一服务器的状态为故障状态,则将所述第二服务器的主备标识设置为主服务器对应的标识;当检测到所述第二服务器的主备标识为所述主服务器对应的标识时,基于边界网关协议向所述目标设备发送所述第二映射关系。The sending unit is configured to set the master / slave identifier of the second server as the identifier corresponding to the master server if the state of the first server is in a fault state; when the master / slave identifier of the second server is detected When the identifier corresponds to the main server, the second mapping relationship is sent to the target device based on a border gateway protocol.
- 根据权利要求15-17任一项所述的装置,其特征在于,所述第二服务器包括负载 均衡服务器。The apparatus according to any one of claims 15 to 17, wherein the second server comprises a load balancing server.
- 一种通信系统,其特征在于,所述系统包括第一服务器和第二服务器;A communication system, characterized in that the system includes a first server and a second server;所述第一服务器,用于获取第一映射关系,并基于边界网关协议向目标设备发送所述第一映射关系;所述第一映射关系为与所述第一服务器相关联的互联网协议IP地址和所述第一服务器的本地IP地址之间的映射关系,所述与所述第一服务器相关联的IP地址包括预设南向接口互联网协议IP地址和/或预设北向接口IP地址;The first server is configured to obtain a first mapping relationship and send the first mapping relationship to a target device based on a border gateway protocol; the first mapping relationship is an Internet protocol IP address associated with the first server Mapping relationship with the local IP address of the first server, the IP address associated with the first server includes a preset southbound interface Internet protocol IP address and / or a preset northbound interface IP address;所述第二服务器,用于获取第一服务器的状态和第二映射关系,若所述状态为故障状态,则基于边界网关协议向目标设备发送所述第二映射关系,所述第二映射关系为与所述第一服务器相关联的IP地址和所述第二服务器的本地IP地址之间的映射关系。The second server is configured to obtain a status of the first server and a second mapping relationship, and if the status is a fault status, send the second mapping relationship to the target device based on a border gateway protocol, and the second mapping relationship Is a mapping relationship between an IP address associated with the first server and a local IP address of the second server.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811095768.6A CN110932876B (en) | 2018-09-19 | 2018-09-19 | Communication system, method and device |
CN201811095768.6 | 2018-09-19 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020057445A1 true WO2020057445A1 (en) | 2020-03-26 |
Family
ID=69856078
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/105770 WO2020057445A1 (en) | 2018-09-19 | 2019-09-12 | Communication system, method, and device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110932876B (en) |
WO (1) | WO2020057445A1 (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113794644A (en) * | 2021-10-12 | 2021-12-14 | 新华三信息安全技术有限公司 | Method and device for deleting routing table items |
CN114245400A (en) * | 2021-11-11 | 2022-03-25 | 新华三大数据技术有限公司 | Cloud management platform system and method for dynamically managing users |
CN114301989A (en) * | 2021-12-28 | 2022-04-08 | 中国电信股份有限公司 | Information transmission method, device and system |
CN114499778A (en) * | 2021-12-31 | 2022-05-13 | 武汉达梦数据技术有限公司 | Device, method, system and storage medium for maintaining double activities of cloud platform |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113014426B (en) * | 2021-02-10 | 2023-04-07 | 优刻得科技股份有限公司 | Method and device for establishing communication between cloud server and client server |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2009265690A (en) * | 2008-04-21 | 2009-11-12 | Toshiba Corp | Cluster system and program |
CN103346903A (en) * | 2013-06-20 | 2013-10-09 | 北京捷成世纪科技股份有限公司 | Dual-machine backup method and device |
CN106789246A (en) * | 2016-12-22 | 2017-05-31 | 广西防城港核电有限公司 | The changing method and device of a kind of active/standby server |
CN107465556A (en) * | 2017-09-07 | 2017-12-12 | 郑州云海信息技术有限公司 | A kind of switching method of active/standby server, apparatus and system |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004032452A (en) * | 2002-06-26 | 2004-01-29 | Nec Corp | System changing method and system of cluster-configured machines |
CN1306777C (en) * | 2004-10-18 | 2007-03-21 | 北京首信股份有限公司 | Method for realizing seamless changing of master and spare service module |
CN101150439A (en) * | 2007-09-25 | 2008-03-26 | 华为技术有限公司 | A method, system and device for realizing master/slave switching |
CN101572676B (en) * | 2009-06-17 | 2011-06-29 | 杭州华三通信技术有限公司 | Load sharing method and equipment of double outlets at data center |
US10129142B2 (en) * | 2015-08-11 | 2018-11-13 | Nicira, Inc. | Route configuration for logical router |
CN108494675A (en) * | 2018-02-07 | 2018-09-04 | 华为技术有限公司 | Realize the method, apparatus and routing device of Virtual Router Redundacy Protocol backup group |
-
2018
- 2018-09-19 CN CN201811095768.6A patent/CN110932876B/en active Active
-
2019
- 2019-09-12 WO PCT/CN2019/105770 patent/WO2020057445A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2009265690A (en) * | 2008-04-21 | 2009-11-12 | Toshiba Corp | Cluster system and program |
CN103346903A (en) * | 2013-06-20 | 2013-10-09 | 北京捷成世纪科技股份有限公司 | Dual-machine backup method and device |
CN106789246A (en) * | 2016-12-22 | 2017-05-31 | 广西防城港核电有限公司 | The changing method and device of a kind of active/standby server |
CN107465556A (en) * | 2017-09-07 | 2017-12-12 | 郑州云海信息技术有限公司 | A kind of switching method of active/standby server, apparatus and system |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113794644A (en) * | 2021-10-12 | 2021-12-14 | 新华三信息安全技术有限公司 | Method and device for deleting routing table items |
CN114245400A (en) * | 2021-11-11 | 2022-03-25 | 新华三大数据技术有限公司 | Cloud management platform system and method for dynamically managing users |
CN114245400B (en) * | 2021-11-11 | 2023-11-03 | 新华三大数据技术有限公司 | Cloud management platform system and method for dynamically managing users thereof |
CN114301989A (en) * | 2021-12-28 | 2022-04-08 | 中国电信股份有限公司 | Information transmission method, device and system |
CN114499778A (en) * | 2021-12-31 | 2022-05-13 | 武汉达梦数据技术有限公司 | Device, method, system and storage medium for maintaining double activities of cloud platform |
Also Published As
Publication number | Publication date |
---|---|
CN110932876A (en) | 2020-03-27 |
CN110932876B (en) | 2022-12-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020057445A1 (en) | Communication system, method, and device | |
CN115460068B (en) | Method and system for high availability enhancement to computer networks | |
US10601656B2 (en) | Network element upgrade method and device | |
US8943490B1 (en) | Intelligent non-stop software upgrade | |
US10560550B1 (en) | Automatic configuration of a replacement network device in a high-availability cluster | |
CN103118148B (en) | A kind of ARP buffering updating method and equipment | |
CN113572831B (en) | Communication method, computer equipment and medium between Kubernetes clusters | |
WO2018090386A1 (en) | Method, device and system for processing abnormities of nf modules | |
TWI740210B (en) | Method for terminal device management and server | |
CN114143283B (en) | Tunnel self-adaptive configuration method and device, central terminal equipment and communication system | |
WO2021227863A1 (en) | Disaster recovery method and apparatus for hybrid cloud private line access network | |
CN110474802B (en) | Equipment switching method and device and service system | |
US8880932B2 (en) | System and method for signaling dynamic reconfiguration events in a middleware machine environment | |
WO2018068588A1 (en) | Method and software-defined networking (sdn) controller for providing multicast service | |
WO2017114363A1 (en) | Packet processing method, bng and bng cluster system | |
WO2016177231A1 (en) | Dual-control-based active-backup switching method and device | |
US11403319B2 (en) | High-availability network device database synchronization | |
CN104144124B (en) | Data forwarding method, Apparatus and system | |
US20200287784A1 (en) | Priority based selection of time services | |
CN112995027B (en) | Route publishing method and VTEP node | |
CN112564983B (en) | Data transmission method, device, computer system and medium | |
CN108366087B (en) | ISCSI service realization method and device based on distributed file system | |
WO2020181733A1 (en) | Vpc-based multi-data center intercommunication method and related device | |
WO2020119317A1 (en) | Message forwarding method and apparatus, storage medium, and electronic apparatus | |
CN108900422B (en) | Multicast forwarding method and device and electronic equipment |
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: 19863448 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: 19863448 Country of ref document: EP Kind code of ref document: A1 |