Server expansion and contraction method, server, system and storage medium
Through the mechanism of automatically triggering update messages to notify the registration center and diversion of the server, the automatic expansion and scaling of the server is realized, solving the cumbersome processes and inefficiency problems caused by manual configuration in the existing technology, and improving the scaling of the server efficiency.
Patent Information
- Application Number
- CN202110043822.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-13
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2041-01-13
AI Technical Summary
In the prior art, server expansion or reduction requires manual configuration modification by professionals, resulting in cumbersome and inefficient process.
The application server automatically triggers the sending of update messages to notify the registration center application server to be online or offline, and the registration center adds or deletes nodes and sends notification messages to the relevant diversion server, so that the diversion server automatically adds or deletes communication information to realize the application server's Automatic expansion and shrinkage.
Reduce or avoid manual intervention, simplify the server expansion and capacity expansion process, improve the efficiency of server expansion and capacity expansion and capacity expansion and capacity automation of application servers.
Smart Images

Figure CN112783647B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a server expansion and contraction method, a server, a system and a storage medium. Background Art
[0002] When a user uses a certain network service, the distribution server will distribute the user's access request to the corresponding application server, and the application server will provide the corresponding service. When the service network architecture changes, the number of application servers will increase or decrease, that is, the server capacity will be expanded or reduced.
[0003] At present, the expansion or reduction of application servers requires professional staff to manually configure and modify the diversion servers. However, the manual intervention of professionals makes the process of server expansion or reduction more cumbersome and inefficient. Summary of the invention
[0004] The embodiments of the present application provide a server scaling method, a server, a system and a storage medium, which can improve the efficiency of server scaling.
[0005] In a first aspect, an embodiment of the present application provides a server scaling method, which is applied to a registration center, and the method includes: receiving an update message triggered by an application server, the update message is used to indicate that the application server is online or offline; in response to the update message, adding or deleting a node corresponding to the application server in the registration center; sending a first notification message to a diversion server that has a subscription relationship with the node corresponding to the application server, the first notification message is used to indicate that the application server is online or offline.
[0006] In the second aspect, an embodiment of the present application provides a server scaling method, which is applied to a diversion server, and the method includes: receiving a first notification message sent by a registration center, the first notification message is generated by the registration center based on an update message triggered by an application server, and is used to characterize that the application server is online or offline, and the diversion server has a subscription relationship with the node corresponding to the application server in the registration center; in response to the first notification message, adding or deleting communication information of the application server on the diversion server.
[0007] In a third aspect, an embodiment of the present application provides a registration center server, including: a receiving module, used to receive an update message triggered by an application server, the update message is used to indicate that the application server is online or offline; a node management module, used to add or delete a node corresponding to the application server in the registration center in response to the update message; a sending module, used to send a first notification message to a diversion server that has a subscription relationship with the node corresponding to the application server, the first notification message is used to indicate that the application server is online or offline.
[0008] In a fourth aspect, an embodiment of the present application provides a diversion server, comprising: a receiving module, used to receive a first notification message sent by a registration center, the first notification message is generated by the registration center based on an update message triggered by an application server, and is used to characterize that the application server is online or offline, and the diversion server has a subscription relationship with the node corresponding to the application server in the registration center; a processing module, used to add or delete the communication information of the application server in the diversion server in response to the first notification message.
[0009] In a fifth aspect, an embodiment of the present application provides a registration center server, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the server scaling method of the first aspect is implemented.
[0010] In a sixth aspect, an embodiment of the present application provides a traffic distribution server, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the server expansion and contraction method of the second aspect is implemented.
[0011] In a seventh aspect, an embodiment of the present application provides a server expansion and contraction system, comprising the registration center server of the fifth aspect and the diversion server of the sixth aspect.
[0012] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the server scaling method of the first aspect or the server scaling method of the second aspect is implemented.
[0013] The present application provides a server scaling method, server, system and storage medium, which notifies a registration center that an application server is online or offline through an update message automatically triggered by an application server. The registration center can add or delete the node corresponding to the application server in the registration center according to whether the application server is online or offline. The registration center sends a first notification message to a diversion server that has a subscription relationship with the node corresponding to the application server, so that the diversion server knows that the application server is online or offline, so that the diversion server can divert the application server corresponding to the node with which it has a subscription relationship, that is, the online application server, thereby realizing automatic scaling of the application server, reducing or even avoiding the process and time of manual intervention in server expansion or reduction, thereby simplifying the server scaling process and improving the efficiency of server scaling. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0015] Figure 1 A schematic diagram of an example of an application scenario of the server expansion and contraction method provided in an embodiment of the present application;
[0016] Figure 2 A flowchart of an embodiment of the server expansion and contraction method provided in the first aspect of the present application;
[0017] Figure 3 A flowchart of another embodiment of the server expansion and contraction method provided in the first aspect of the present application;
[0018] Figure 4 A flowchart of an embodiment of a server expansion and contraction method provided in the second aspect of the present application;
[0019] Figure 5 A flowchart of another embodiment of the server expansion and contraction method provided in the second aspect of the present application;
[0020] Figure 6 A flowchart of an example of a server expansion process provided in an embodiment of the present application;
[0021] Figure 7 A flowchart of an example of a server scaling-down process provided in an embodiment of the present application;
[0022] Figure 8 A flowchart of another example of a server scaling-down process provided in an embodiment of the present application;
[0023] Fig. 9 A schematic diagram of the structure of an embodiment of a registration center server provided in the third aspect of the present application;
[0024] Fig.10 A schematic diagram of the structure of an embodiment of a traffic distribution server provided in the fourth aspect of the present application;
[0025] Fig.11 A schematic diagram of the structure of an embodiment of a registration center server provided in the fifth aspect of the present application;
[0026] Fig.12 A schematic structural diagram of an embodiment of a diversion server provided in the sixth aspect of the present application. DETAILED DESCRIPTION
[0027] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0028] With the development of network technology, the types of services that the network can provide are increasing. In order to meet user needs, it is necessary to adjust the network architecture, for example, to expand or reduce the capacity of the application server used to provide services, that is, to increase or reduce the application server. At present, if the application server needs to be expanded or reduced, professional staff are required to manually configure and modify the diversion server, which is a large workload, cumbersome process and low efficiency.
[0029] The present application provides a server expansion and contraction method, server, system and storage medium, which can reduce or avoid manual intervention in the process and time of server expansion or contraction, thereby simplifying the server expansion and contraction process and improving the efficiency of server expansion and contraction.
[0030] The server expansion and contraction method provided in the present application may involve a shunt server, a registration center, and an application server. The shunt server may specifically include a HyperText Transfer Protocol server, such as an nginx server, an apache server, etc., which is not limited here. The application server may include a tomcat server, an upjas server, etc., which is not limited here. The registration center may include a Zookeeper server, etc., which is not limited here. The shunt server, the registration center, and the application server may be a virtual server or a physical server, which is not limited here.
[0031] Figure 1 A schematic diagram of an example of an application scenario of the server expansion and contraction method provided in an embodiment of the present application. Figure 1 As shown, the distribution server 11 can communicate with the application server 12, and the registration center 13 can communicate with the application server 12 and the distribution server 11.
[0032] The following is a detailed description of the server expansion and reduction method.
[0033] A first aspect of the present application provides a server expansion and contraction method, which can be applied to a registration center. Figure 2 This is a flow chart of an embodiment of the server expansion and contraction method provided in the first aspect of the present application. Figure 2As shown, the server expansion and contraction method may include steps S201 to S203.
[0034] In step S201, an update message triggered by an application server is received.
[0035] When an application server goes online or offline, the application server triggers the sending of an update message to the registration center. Correspondingly, the update message is used to indicate whether an application server is online or offline. When an application server goes online, it means that the application server is added to the network architecture, that is, the application server participates in the communication and services in the network architecture. When an application server goes offline, it means that the application server is removed from the network architecture, that is, the application server no longer participates in the communication and services in the network architecture.
[0036] In some examples, when the update message is used to indicate that the application server is online, the update message is triggered to be sent after the application server is started. That is, the application server is added to the network architecture, and after the application server is started, it actively triggers the sending of the update message to the registration center to achieve the expansion of the application server.
[0037] In other examples, when the update message is used to indicate that the application server is offline, the update message is triggered to be sent before the application server stops working. That is, before the application server is removed from the network architecture, the application server actively triggers the sending of the update message to the registration center to achieve the reduction of the application server.
[0038] The registration center can obtain relevant information about the online and offline status of the application server through the update messages automatically sent by the application server.
[0039] In step S202, in response to the update message, a node corresponding to the application server is added or deleted in the registration center.
[0040] The registration center includes multiple nodes, each of which corresponds to an application server. When the update message indicates that the application server is online, the registration center adds the node corresponding to the online server represented by the update message. When the update message indicates that the application server is offline, the registration center deletes the node corresponding to the offline server represented by the update message.
[0041] For example, the registration center includes nodes A1 to A10. When the registration center receives an update message indicating that the application server B11 is online, the registration center adds a new node A11, and the new node A11 corresponds to the application server B11.
[0042] For another example, the registration center includes nodes A1 to A10, and nodes A1 to A10 correspond to servers B1 to B10 respectively. When the registration center receives an update message indicating that application server B7 is offline, the registration center deletes node A7 corresponding to application server B7.
[0043] In some examples, the registration center may also establish or delete a subscription relationship between the node corresponding to the application server and the shunt server. When the update message is used to indicate that the application server is online, the registration center establishes a subscription relationship between the node corresponding to the application server and the shunt server. When the update message is used to ensure that the application server is offline, the registration center deletes the subscription relationship between the node corresponding to the application server and the shunt server.
[0044] The registration center will actively send the relevant information of the application server corresponding to the node with which the distribution server has a subscription relationship to the distribution server. The registration center can manage the communication between the distribution server and the application server by establishing or deleting the subscription relationship.
[0045] In step S203, a first notification message is sent to a distribution server having a subscription relationship with a node corresponding to the application server.
[0046] The shunt server can perform shunt of the application server corresponding to the node subscribed by the shunt server. In the case of multiple shunt servers, each shunt server can subscribe to at least one node. The registration center adds the node corresponding to the online application server, and the registration center can actively establish a subscription relationship between the node and a shunt server, or the shunt server actively configures the subscription relationship between the node corresponding to the online application server, which is not limited here.
[0047] For example, the registration center includes nodes A1 to A10, and the shunt server includes shunt servers C1 and C2. Among them, the shunt server C1 has a subscription relationship with nodes A1 to A6, and the shunt server C2 has a subscription relationship with nodes A7 to A10. The shunt server C1 can shunt traffic to the application servers corresponding to nodes A1 to A6. The shunt server C2 can shunt traffic to the application servers corresponding to nodes A7 to A10.
[0048] The first notification message is used to indicate that the application server is online or offline. The registration center sends the first notification message to the shunt server of the node that subscribes to the update message indicating that the application server is online or offline, so that the shunt server can shunt the updated application server.
[0049] In an embodiment of the present application, the registration center is notified of the online or offline application server through an update message automatically triggered by the application server. The registration center can add or delete the node corresponding to the application server in the registration center according to whether the application server is online or offline. The registration center sends a first notification message to the diversion server that has a subscription relationship with the node corresponding to the application server, so that the diversion server knows that the application server is online or offline, so that the diversion server can divert the application server corresponding to the node with which it has a subscription relationship, that is, the online application server, thereby realizing automatic expansion and contraction of the application server, reducing or even avoiding the process and time of manual intervention in server expansion or contraction, thereby simplifying the server expansion and contraction process and improving the efficiency of server expansion and contraction. The expansion and contraction of the application server is automatically completed by the application server, the registration center and the diversion server, and is transparent.
[0050] In some examples, the update message in the above embodiments may include the address information of the application server and the port information of the application server. The application server can be located by the address information of the application server and the port information of the reference server, so the application server can be identified by the address information and port information of the application server. The address information is used to characterize the address of the application server, and may specifically include an Internet Protocol (IP) address and other types of addresses, etc., which are not limited here. The port information may characterize the port required to access the application server, and may specifically include a port name, etc., which are not limited here.
[0051] Correspondingly, the first notification message may include the address information of the application server and the port information of the application server. The address information of the application server and the port information of the application server can refer to the above-mentioned related descriptions, which will not be repeated here. The traffic distribution server that receives the first notification message can perform traffic distribution of the application server according to the address information and the port information in the subsequent process.
[0052] In some examples, the update message in the above embodiment may also include the address information of the health page of the application server. The address information of the application server and the address information of the health page of the application server can be located to the health page of the application server. The health page of the application server records the health status of the application server. The health status may include the power-on status of the application server, the memory status of the application server, etc., which are not limited here. The health status of the application server can be determined by accessing the health page of the application server. In the event of a failure of the application server, the health page of the application server cannot be accessed successfully.
[0053] In some examples, the health page of the application server can be accessed regularly to detect whether the application server has a fault causing the application server to go offline. The health page of the application server can be accessed regularly by sending a health page access message to the application server regularly. The health page access message can be sent to the application server by a detection system that can communicate with the registration center, or by the registration center.
[0054] Figure 3 A flowchart of another embodiment of the server scaling method provided in the first aspect of the present application. Figure 3 and Figure 2 The difference is that Figure 3 The server expansion and contraction method shown may further include step S204 and step S205.
[0055] In step S204, when no health page feedback information of the application server is received within a timeout period, the node corresponding to the application server is deleted in the registration center.
[0056] When the application server receives the health page access message and the health page access to the application server is successful, the application server will feedback the health page feedback information. However, if the application server is offline due to a downtime failure such as power failure or disk damage, the application server will not feedback the health page feedback information.
[0057] When the detection system sends a health page access message to the application server, if the application server has not failed, the application server will feedback the health page feedback information to the detection system, and the detection system will send the health page feedback information to the registration center; if the application server has failed, the application server cannot feedback the health page feedback information to the detection system, and the detection system cannot send the health page feedback information to the registration center, resulting in the registration center timing out and not receiving the health page feedback information, thereby causing the registration center to determine that the application server has failed.
[0058] When the registration system sends a health page access message to the application server, if the application server has not failed, the application server will feedback the health page information to the registration center; if the application server has failed, the application server cannot feedback the health page feedback information to the registration center, resulting in the registration center timing out and not receiving the health page feedback information, thereby causing the registration center to determine that the application server has failed.
[0059] The timeout period can be set according to the scenario and needs and is not limited here.
[0060] If the registration center fails to receive the health page feedback information of the application server, it means that the application server has a fault and is offline. The registration center can delete the node corresponding to the application server, that is, the registration center automatically completes the reduction of the application server that has abnormally gone offline.
[0061] In step S205, a second notification message is sent to a distribution server having a subscription relationship with a node corresponding to the application server.
[0062] The second notification message is used to indicate that the application server is offline. The registration center can notify the shunt server with a subscription relationship with the node corresponding to the abnormal offline application server through the second notification message, so that the shunt server determines the abnormal offline application server and no longer shunts traffic to the abnormal offline application server.
[0063] Through health monitoring, application servers that have gone offline abnormally can be discovered in a timely manner. The registration center can automatically delete the nodes corresponding to the application servers that have gone offline abnormally and notify the diversion servers to automatically and efficiently complete the reduction in capacity to remove the application servers that have gone offline abnormally.
[0064] A second aspect of the present application provides a server expansion and contraction method, which can be applied to a diversion server. Figure 4 This is a flow chart of an embodiment of the server expansion and contraction method provided in the second aspect of the present application. Figure 4 As shown, the server scaling method may include step S301 and step S302.
[0065] In step S301, a first notification message sent by a registration center is received.
[0066] The first notification message is generated by the registration center based on the update message triggered by the application server, and is used to indicate that the application server is online or offline. The shunt server has a subscription relationship with the node corresponding to the application server in the registration center. The first notification message, update message, application server online, application server offline, subscription relationship, etc. can be found in the relevant descriptions in the above embodiments, and will not be repeated here.
[0067] In step S302, in response to the first notification message, the communication information of the application server is added or deleted in the offload server.
[0068] The shunt server can determine the online or offline application server corresponding to the shunt server through the first notification message. Thus, according to whether the application server is online or offline, the communication information of the application server is determined to be added or deleted. The communication information of the application server is used for the shunt server to communicate with the application server. The first notification message may include the communication information of the online or offline application server. Through the communication information of the application server, the shunt server can communicate with the application server, thereby completing the shunt.
[0069] In the case where the first communication message indicates that the application server is online, the diversion server adds the communication information of the application server. After adding the communication information of the application server, the diversion server can communicate with the application server, thereby realizing the diversion of the application server. In the case where the first communication message indicates that the application server is offline, the diversion server deletes the communication information of the application server. After deleting the communication information of the application server, the diversion server will not communicate with the application server, thereby avoiding the situation where the application server is offline and the diversion server still diverts it.
[0070] In some examples, the diversion server includes a load balancing (i.e., loadbalance) list, which can be implemented by a loadbalance component. The load balancing list includes communication information of application servers that the diversion server can communicate with. The diversion server responds to the first notification message, and specifically can add or delete the communication information of the application server in the load balancing list in the diversion server. When the first communication message indicates that the application server is online, the diversion server adds the communication information of the application server to the load balancing list. When the first communication message indicates that the application server is offline, the diversion server deletes the communication information of the application server in the load balancing list.
[0071] In an embodiment of the present application, the diversion server receives a first notification message sent by the registration center that can characterize the online or offline status of the application server. The diversion server determines whether the application server is online or offline based on the first notification message, thereby adding or deleting the communication information of the application server, so as to realize the diversion of the diversion server and the online application server in the subsequent process, avoid the diversion of the diversion server and the offline application server, automatically complete the expansion and contraction of the application server, reduce or avoid manual intervention in the process and time of server expansion or contraction, thereby simplifying the server expansion and contraction process and improving the efficiency of server expansion and contraction. The expansion and contraction of the application server is automatically completed by the application server, the registration center and the diversion server, and is transparent.
[0072] In some examples, the first notification message includes address information of the application server and port information of the application server. The communication information includes address information of the application server and port information of the application server.
[0073] For specific contents of the first notification message, the address information of the server, the port information of the application server, etc., please refer to the relevant descriptions in the above embodiments, which will not be repeated here.
[0074] In some examples, the application server may be offline due to unexpected failure. The health of the application server can be monitored by the detection system or the registration center. The detection system or the registration center periodically sends a health page access message to the application server, and determines whether the application server is offline due to unexpected failure by whether the health page feedback information corresponding to the health page access information can be received within the timeout period.
[0075] Figure 5 A flowchart of another embodiment of the server scaling method provided in the second aspect of the present application. Figure 5 and Figure 4 The difference is that Figure 5 The server expansion and contraction method shown may also include step S303 and step S304.
[0076] In step S303, a second notification message sent by the registration center is received.
[0077] The second notification message is sent by the registration center when the registration center fails to receive the health page feedback information of the application server within a timeout period, and is used to indicate that the application server is offline.
[0078] In step S304, in response to the second notification message, the communication information of the application server is deleted at the offload server.
[0079] For specific contents such as the second notification message, health page feedback information, health page access message, communication information, etc., please refer to the relevant descriptions in the above embodiments and will not be repeated here.
[0080] The following further illustrates the various processes involved in the server expansion and contraction method through the interaction between the application server, the registration center, and the distribution server.
[0081] Figure 6 This is a flow chart of an example of a server expansion process provided by an embodiment of the present application. In the server expansion process, the application server is online, and the update message can be specifically an expansion update message, which is used to indicate that the application server is online. Figure 6 As shown, the server expansion update message may include steps S401 to S405.
[0082] In step S401, the address information of the registration center is configured for the application server.
[0083] In step S402, the application server is started, triggering the sending of a capacity expansion update message to the registration center.
[0084] In step S403, the registration center adds a node corresponding to the application service in response to the expansion update message.
[0085] In step S404, the registration center sends a first notification message to the offload server that has a subscription relationship with the node. The first notification message is used to indicate that the application server is online.
[0086] In step S405, the offload server adds the communication information of the application server in response to the first notification message.
[0087] Figure 7 The flowchart of an example of the server scaling-down process provided in the embodiment of the present application. In the server scaling-down process, the application server is normally offline, and the update message can be a scaling-down update message, which is used to indicate that the application server is offline. Figure 7 As shown, the server scaling-down update message may include steps S501 to S504.
[0088] In step S501, the application server triggers sending a capacity reduction update message to the registration center before stopping working normally.
[0089] In step S502, the registration center deletes the node corresponding to the application server in response to the scaling-down update message.
[0090] In step S503, the registration center sends a first notification message to the offload server that has a subscription relationship with the node. The first notification message is used to indicate that the application server is offline.
[0091] In step S505, the offload server deletes the communication information of the application server in response to the first notification message.
[0092] Figure 8 This is another example of a flow chart of the server scaling process provided in the embodiment of the present application. In the server scaling process, the detection system can perform health checks on the application server regularly, and the application server goes offline abnormally. The detection system can be integrated with the registration center or independently set. In this embodiment, the detection system and the registration center are independently set as an example. Figure 8 As shown, the server scaling-down update message may include steps S601 to S604.
[0093] In step S601, the detection system periodically sends a health page access message to the application server.
[0094] When the application server is working normally, the application server will feedback the health page feedback information to the detection system, and the detection system will forward the received feedback health page feedback information to the registration center. When the application server is offline due to a fault, the application server will not feedback the health page feedback information to the detection system, and the detection system will not be able to forward the health page feedback information to the registration center.
[0095] In step S602, when the registration center does not receive the health page feedback information of the application server within a timeout period, the registration center deletes the node corresponding to the application server.
[0096] In step S603, the registration center sends a second notification message to the offload server that has a subscription relationship with the node. The second notification message is used to ensure that the application server is offline.
[0097] In step S604, the offload server deletes the communication information of the application server in response to the second notification message.
[0098] The above-mentioned server expansion process and server reduction process can be combined with each other, which is not limited here.
[0099] The third aspect of the present application provides a registration center server. The registration center in the above embodiment may include at least one registration center server, which is not limited here. Fig. 9 This is a schematic diagram of the structure of an embodiment of the registration center server provided in the third aspect of the present application. Fig. 9 As shown, the registration center server 700 may include a receiving module 701 , a node management module 702 and a sending module 703 .
[0100] The receiving module 701 may be configured to receive an update message triggered by an application server.
[0101] Update messages are used to indicate that an application server is online or offline.
[0102] The node management module 702 may be configured to add or delete a node corresponding to an application server in the registration center in response to an update message.
[0103] The sending module 703 may be configured to send a first notification message to a traffic distribution server having a subscription relationship with a node corresponding to the application server.
[0104] The first notification message is used to indicate that the application server is online or offline.
[0105] In an embodiment of the present application, the registration center is notified of the online or offline application server through an update message automatically triggered by the application server. The registration center can add or delete the node corresponding to the application server in the registration center according to whether the application server is online or offline. The registration center sends a first notification message to the diversion server that has a subscription relationship with the node corresponding to the application server, so that the diversion server knows that the application server is online or offline, so that the diversion server can divert the application server corresponding to the node with which it has a subscription relationship, that is, the online application server, thereby realizing automatic expansion and contraction of the application server, reducing or even avoiding the process and time of manual intervention in server expansion or contraction, thereby simplifying the server expansion and contraction process and improving the efficiency of server expansion and contraction. The expansion and contraction of the application server is automatically completed by the application server, the registration center and the diversion server, and is transparent.
[0106] In some examples, the update message includes address information of the application server and port information of the application server. The first notification message includes address information of the application server and port information of the application server.
[0107] In some examples, the update message also includes address information of a health page of the application server, where the health page records the health status of the application server.
[0108] In some examples, the node management module 702 may also be used to establish or delete a subscription relationship between a node corresponding to an application server and a distribution server in a registration center.
[0109] In some examples, the node management module 702 may also be configured to delete a node corresponding to an application server in a registration center when no health page feedback information of the application server is received within a timeout period.
[0110] The sending module 703 can also be used to send a second notification message to a shunt server having a subscription relationship with a node corresponding to the application server when the health page feedback information of the application server is not received within a timeout period. The second notification message is used to indicate that the application server is offline.
[0111] In some examples, when the update message is used to indicate that the application server is online, the update message is triggered to be sent after the application server is started.
[0112] In the case where the update message is used to indicate that the application server is offline, the update message is triggered and sent before the application server stops working.
[0113] A fourth aspect of the present application provides a traffic diversion server. Fig.10 This is a schematic diagram of the structure of an embodiment of the diversion server provided in the fourth aspect of the present application. Fig.10As shown, the distribution server 800 may include a receiving module 801 and a processing module 802.
[0114] The receiving module 801 may be configured to receive a first notification message sent by a registration center.
[0115] The first notification message is generated by the registration center based on the update message triggered by the application server and is used to indicate that the application server is online or offline. The distribution server has a subscription relationship with the node corresponding to the application server in the registration center.
[0116] The processing module 802 may be configured to add or delete the communication information of the application server in the offload server in response to the first notification message.
[0117] In an embodiment of the present application, the diversion server receives a first notification message sent by the registration center that can characterize the online or offline status of the application server. The diversion server determines whether the application server is online or offline based on the first notification message, thereby adding or deleting the communication information of the application server, so as to realize the diversion of the diversion server and the online application server in the subsequent process, avoid the diversion of the diversion server and the offline application server, automatically complete the expansion and contraction of the application server, reduce or avoid manual intervention in the process and time of server expansion or contraction, thereby simplifying the server expansion and contraction process and improving the efficiency of server expansion and contraction. The expansion and contraction of the application server is automatically completed by the application server, the registration center and the diversion server, and is transparent.
[0118] In some examples, the first notification message includes address information of the application server and port information of the application server. The communication information includes address information of the application server and port information of the application server.
[0119] In some examples, the processing module 802 may be used to add or delete communication information of the application server in the load balancing list in the offload server in response to the first notification message.
[0120] In some examples, the receiving module 801 may also be used to receive a second notification message sent by the registration center. The second notification message is sent by the registration center when the registration center fails to receive the health page feedback information of the application server within a timeout period, and is used to indicate that the application server is offline.
[0121] The processing module 802 may be configured to delete the communication information of the application server at the offload server in response to the second notification message.
[0122] A fifth aspect of the present application provides a registration center server. Fig.11 This is a schematic diagram of the structure of an embodiment of a registration center server provided in the fifth aspect of the present application. Fig.11As shown, the registration center server 900 includes a memory 901 , a processor 902 , and a computer program stored in the memory 901 and executable on the processor 902 .
[0123] In an example, the processor 902 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0124] The memory 901 may include a read-only memory (ROM), a random access memory (RAM), a disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the server scaling method applied to the registration center according to the present application.
[0125] The processor 902 runs a computer program corresponding to the executable program code by reading the executable program code stored in the memory 901, so as to implement the server expansion and contraction method applied to the registration center in the above embodiment.
[0126] In one example, the registration center server 900 may further include a communication interface 903 and a bus 904. Fig.11 As shown, the memory 901, the processor 902, and the communication interface 903 are connected via a bus 904 and communicate with each other.
[0127] The communication interface 903 is mainly used to realize the communication between the modules, devices, units and / or equipment in the embodiment of the present application. The communication interface 903 can also be used to access input devices and / or output devices.
[0128] The bus 904 includes hardware, software, or both, coupling the components of the registry server 900 to each other. By way of example and not limitation, the bus 904 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industrial Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pincount (LPC) bus, a Memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, the bus 904 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.
[0129] A sixth aspect of the present application provides a diversion server. Fig.12 This is a structural diagram of an embodiment of a traffic distribution server provided in the sixth aspect of the present application. Fig.12 As shown, the distribution server 1000 includes a memory 1001, a processor 1002, and a computer program stored in the memory 1001 and executable on the processor 1002.
[0130] In an example, the processor 1002 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0131] The memory 1001 may include a read-only memory (ROM), a random access memory (RAM), a disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the server scaling method applied to the diversion server according to the present application.
[0132] The processor 1002 runs a computer program corresponding to the executable program code by reading the executable program code stored in the memory 1001, so as to implement the server scaling method applied to the offload server in the above embodiment.
[0133] In one example, the offload server 1000 may further include a communication interface 1003 and a bus 1004. Fig.12 As shown, the memory 1001, the processor 1002, and the communication interface 1003 are connected via a bus 1004 and communicate with each other.
[0134] The communication interface 1003 is mainly used to realize the communication between the modules, devices, units and / or equipment in the embodiment of the present application. The communication interface 1003 can also be used to access input devices and / or output devices.
[0135] The bus 1004 includes hardware, software, or both, coupling the components of the offload server 1000 to each other. By way of example and not limitation, the bus 1004 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industrial Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a Memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, the bus 1004 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.
[0136] The seventh aspect of the present application provides a server expansion and contraction system. The server expansion and contraction system may include the registration center server and the distribution server in the above embodiment. The specific content can be found in the relevant description in the above embodiment, which will not be repeated here.
[0137] In some examples, the server expansion and contraction system may further include an application server. The specific content of the application server can be found in the relevant description of the above embodiment, which will not be repeated here.
[0138] In some examples, the server expansion and contraction system may further include a detection system. The specific content of the detection system can be found in the relevant description of the above embodiments, which will not be repeated here.
[0139] In an eighth aspect, the present application provides a computer-readable storage medium. Computer program instructions are stored on the computer-readable storage medium. When the computer program instructions are executed by the processor, the server expansion and contraction method of the first aspect or the server expansion and contraction method of the second aspect in the above-mentioned embodiment can be implemented, and the same technical effect can be achieved. In order to avoid repetition, it will not be repeated here. Among them, the above-mentioned computer-readable storage medium may include a non-transitory computer-readable storage medium, such as a read-only memory (Read-Only Memory, referred to as ROM), a random access memory (Random Access Memory, referred to as RAM), a disk or an optical disk, etc., which is not limited here.
[0140] It should be clear that each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. For server embodiments, system embodiments, and computer-readable storage medium embodiments, the relevant parts can refer to the description part of the method embodiment. The present application is not limited to the specific steps and structures described above and shown in the figures. Those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application. In addition, for the sake of brevity, a detailed description of known method technologies is omitted here.
[0141] The above reference is according to the method of the embodiment of the present application, the flow chart of the device (system) and the computer program product and / or the block diagram described various aspects of the present application.It should be understood that each square box in the flow chart and / or the block diagram and the combination of each square box in the flow chart and / or the block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the realization of the function / action specified in one or more square boxes of the flow chart and / or the block diagram.Such a processor can be but is not limited to a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit.It can also be understood that each square box in the block diagram and / or the flow chart and the combination of the square boxes in the block diagram and / or the flow chart can also be realized by the dedicated hardware that performs the specified function or action, or can be realized by the combination of dedicated hardware and computer instructions.
[0142] Those skilled in the art should understand that the above embodiments are exemplary rather than restrictive. Different technical features appearing in different embodiments can be combined to achieve beneficial effects. Based on the study of the drawings, the specification and the claims, those skilled in the art should be able to understand and implement other variations of the disclosed embodiments. In the claims, the term "comprising" does not exclude other devices or steps; the quantifier "one" does not exclude multiple; the terms "first" and "second" are used to indicate names rather than to indicate any specific order. Any figure marks in the claims should not be understood as limiting the scope of protection. The functions of multiple parts appearing in the claims can be implemented by a single hardware or software module. The appearance of certain technical features in different dependent claims does not mean that these technical features cannot be combined to achieve beneficial effects.
Claims
1. A server expansion and contraction method, characterized in that: Applied to a registration center, the method comprises: Receiving an update message triggered by an application server, wherein the update message is used to indicate whether the application server is online or offline; In response to the update message, adding or deleting a node corresponding to the application server in the registration center; Sending a first notification message to a distribution server having a subscription relationship with a node corresponding to the application server, wherein the first notification message is used to indicate that the application server is online or offline; The update message includes address information of the application server and address information of a health page of the application server, and the method further includes: In the case where no health page feedback information of the application server is received within a timeout period, deleting the node corresponding to the application server in the registration center; A second notification message is sent to a shunt server that has a subscription relationship with a node corresponding to the application server, where the second notification message is used to indicate that the application server is offline, so that the shunt server no longer shunts traffic to the application server.
2. The method according to claim 1, characterized in that The update message also includes port information of the application server; The first notification message includes address information of the application server and port information of the application server.
3. The method according to claim 1, characterized in that The health page records the health status of the application server.
4. The method according to claim 1, characterized in that: Also includes: A subscription relationship between the node corresponding to the application server and the distribution server is established or deleted in the registration center.
5. The method according to claim 1, characterized in that In the case where the update message is used to indicate that the application server is online, the update message is triggered and sent after the application server is started; In the case where the update message is used to indicate that the application server is offline, the update message is triggered and sent before the application server stops working.
6. A server expansion and contraction method, characterized in that: Applied to a traffic distribution server, the method comprises: Receiving a first notification message sent by a registration center, where the first notification message is generated by the registration center based on an update message triggered by an application server and is used to indicate that the application server is online or offline, and the offload server has a subscription relationship with a node corresponding to the application server in the registration center; In response to the first notification message, adding or deleting communication information of the application server in the offloading server; receiving a second notification message sent by the registration center, where the second notification message is sent by the registration center when the registration center fails to receive health page feedback information of the application server within a timeout period, and is used to indicate that the application server is offline; In response to the second notification message, the communication information of the application server is deleted at the distribution server, and traffic is no longer distributed to the application server; The update message includes the address information of the application server and the address information of the health page of the application server. If the health page feedback information of the application server is not received within a timeout period, the registration center deletes the node corresponding to the application server.
7. The method according to claim 6, characterized in that The first notification message includes address information of the application server and port information of the application server; The update information also includes port information of the application server.
8. The method according to claim 6, characterized in that In response to the first notification message, adding or deleting the communication information of the application server on the offload server includes: In response to the first notification message, the communication information of the application server is added or deleted in the load balancing list in the offload server.
9. A registration center server, characterized in that: include: A receiving module, used to receive an update message triggered by an application server, wherein the update message is used to indicate whether the application server is online or offline; A node management module, configured to add or delete a node corresponding to the application server in the registration center in response to the update message; A sending module, configured to send a first notification message to a shunt server having a subscription relationship with a node corresponding to the application server, wherein the first notification message is used to indicate that the application server is online or offline; The update message includes the address information of the application server and the address information of the health page of the application server, wherein the node management module is further used to delete the node corresponding to the application server in the registration center when the health page feedback information of the application server is not received within a timeout period; The sending module is also used to send a second notification message to a shunt server that has a subscription relationship with a node corresponding to the application server, wherein the second notification message is used to indicate that the application server is offline, so that the shunt server no longer shunts traffic to the application server.
10. A traffic distribution server, characterized in that: include: A receiving module, configured to receive a first notification message sent by a registration center, wherein the first notification message is generated by the registration center based on an update message triggered by an application server and is used to indicate that the application server is online or offline, and the offload server has a subscription relationship with a node corresponding to the application server in the registration center; A processing module, configured to add or delete the communication information of the application server in the distribution server in response to the first notification message; The receiving module is further used to receive a second notification message sent by the registration center, where the second notification message is sent by the registration center when the registration center fails to receive the health page feedback information of the application server within a timeout period, and is used to indicate that the application server is offline; The processing module is further configured to, in response to the second notification message, delete the communication information of the application server at the distribution server and no longer distribute traffic to the application server; The update message includes the address information of the application server and the address information of the health page of the application server. If the health page feedback information of the application server is not received within a timeout period, the registration center deletes the node corresponding to the application server.
11. A registration center server, characterized in that: include: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the server scaling method as described in any one of claims 1 to 5 is implemented.
12. A traffic distribution server, characterized in that: include: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the server scaling method as described in any one of claims 6 to 8 is implemented.
13. A server expansion and contraction system, characterized in that: It includes the registration center server as described in claim 11 and the distribution server as described in claim 12.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the server scaling method according to any one of claims 1 to 8 is implemented.
