CN118075121A - Micro-service upgrading method and device - Google Patents
Micro-service upgrading method and device Download PDFInfo
- Publication number
- CN118075121A CN118075121A CN202211426477.7A CN202211426477A CN118075121A CN 118075121 A CN118075121 A CN 118075121A CN 202211426477 A CN202211426477 A CN 202211426477A CN 118075121 A CN118075121 A CN 118075121A
- Authority
- CN
- China
- Prior art keywords
- node
- service
- micro
- information
- indication information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 39
- 238000012544 monitoring process Methods 0.000 claims abstract description 38
- 238000012545 processing Methods 0.000 claims description 13
- 238000012423 maintenance Methods 0.000 abstract description 22
- 230000003993 interaction Effects 0.000 abstract 1
- 230000004044 response Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 6
- 230000008901 benefit Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 4
- 238000004590 computer program Methods 0.000 description 3
- 230000036541 health Effects 0.000 description 3
- 238000007792 addition Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 238000000354 decomposition reaction Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000005215 recombination Methods 0.000 description 1
- 230000006798 recombination Effects 0.000 description 1
Landscapes
- Stored Programmes (AREA)
Abstract
The application provides a micro-service upgrading method and device, which are applied to a micro-service upgrading system, wherein the system comprises a first micro-service, a service center, a management device and a gateway, the service center is used for registering at least one node of the first micro-service, providing information of a callable node in the at least one node for the gateway, and the gateway is used for providing calling service of an interface in the callable node for a user client according to the information of the callable node, wherein the callable node comprises the first node. The method indicates to the service center to stop calling the first node through the management device, and realizes the stop calling of the first micro-service by utilizing the interaction between the service center and the gateway. And then acquiring monitoring information, if the monitoring information indicates that no traffic accesses the first node, the management device indicates to upgrade the first node, and indicates to the service center that the first node is online. The method can upgrade the micro-service without being limited by time, and is convenient for operation and maintenance personnel to manage the micro-service upgrade.
Description
Technical Field
The present application relates to the field of internet communications technologies, and in particular, to a method and an apparatus for micro-service upgrade.
Background
A micro-service architecture is an architectural style, and a large complex software application to which the micro-service architecture is applied may be composed of one or more micro-service components (also referred to as micro-services). Each micro-service in one software application may be deployed independently. Each micro-service is focused on completing only one task.
A micro-service typically includes a plurality of nodes, each node deploying the same application to share requests initiated by clients to the micro-service. Micro-service upgrades are typically upgrades to the software package of each node in the micro-service, which requires that each node of the micro-service be upgraded with its operation stopped. However, when there is traffic to access a node that needs to be upgraded, the operation of that node stops, which can result in loss of data associated with the user that is accessing the node. At present, since the access amount of users is less after the early morning, most operation and maintenance personnel select to upgrade the micro-service after the early morning so as to reduce the influence caused by data loss due to micro-service upgrade. However, the way in which micro-services are upgraded after the early morning is extremely inconvenient for the operation and maintenance personnel.
Thus, there is a need for a solution for upgrading micro services that is not limited in time.
Disclosure of Invention
The application provides a method and a device for upgrading a micro-service, which can upgrade the micro-service without being limited by time, and are convenient for operation and maintenance personnel to manage the micro-service upgrade.
In a first aspect, a micro service upgrade method is provided, applied to a micro service upgrade system, where the micro service upgrade system includes a first micro service, a service center, and a gateway, where the service center is configured to register at least one node of the first micro service, and provide information of a callable node in the at least one node to the gateway, and the gateway is configured to provide a call service of an interface in the callable node to a user client according to the information of the callable node, where the callable node includes the first node, and the method includes:
The management device responds to the operation of suspending the calling of the service of the first node and sends first indication information to the service center, wherein the first indication information is used for indicating the stopping of calling of the first node;
The management device acquires monitoring information, wherein the monitoring information is used for indicating whether the first node is accessed by the traffic;
if the monitoring information indicates that no traffic accesses the first node, the management device indicates to upgrade the first node;
and if the first node is upgraded, the management device sends second indication information to the service center, wherein the second indication information is used for indicating the first node to be online.
In one example, if the monitoring information indicates that no traffic is accessing the first node, the management device indicates to upgrade the first node, including:
If the monitoring information indicates that no flow accesses the first node, the management device sends stop indication information to the first node, wherein the stop indication information is used for indicating stopping service operation;
the management device instructs the upgrade to the first node.
In one example, if the first node is upgraded, the management device sends the second indication information to the service center includes:
the management device receives information used for indicating that upgrading is finished from the first node;
The management device determines that the first node is upgraded according to the information for indicating that the upgrade is finished, and sends second indication information to the service center.
In one example, the first indication information and the second indication information each include an address and a port number of the first node.
In one example, the method further comprises:
The management device acquires a classification identifier of the first micro service, wherein the classification identifier is used for representing an application to which the first micro service belongs;
and the management device determines the corresponding operation area of the first micro-service on the display interface of the management device according to the classification identification of the first micro-service.
In a second aspect, the present application further provides a micro service upgrade method, applied to a micro service upgrade system, where the micro service upgrade system includes a first micro service, a service center, and a gateway, where the service center is used for registering at least one node of the first micro service, and providing information of a callable node in the at least one node to the gateway, and the gateway is used for providing a calling service of an interface in the callable node to a user client according to the information of the callable node, where the callable node includes the first node, and the method includes:
the service center determines a service registration list, wherein the service registration list comprises information of the nodes which can be called;
the service center receives first indication information, wherein the first indication information is used for indicating to stop calling the first node;
the service center updates the service registration list according to the first indication information;
the service center sends the updated service registration list to the gateway;
The service center receives second indication information, wherein the second indication information is used for indicating the first node to be online;
The service center updates the service registration list again according to the second indication information;
The service center sends the updated service registration list to the gateway.
In one example, the first indication information and the second indication information each include an address and a port number of the first node.
In a third aspect, the present application provides a micro service upgrade apparatus, applied to a micro service upgrade system, where the micro service upgrade system includes a first micro service, a service center, and a gateway, where the service center is used for registering at least one node of the first micro service, and providing information of a callable node in the at least one node to the gateway, the gateway is used for providing a call service of an interface in the callable node to a user client according to the information of the callable node, the callable node includes a first node, and the apparatus includes:
The sending module is used for responding to the operation of suspending the calling of the service of the first node, sending first indication information to the service center by the management device, and the first indication information is used for indicating the stopping of calling of the first node;
The receiving module is used for acquiring monitoring information by the management device, wherein the monitoring information is used for indicating whether the first node is accessed by the traffic;
The processing module is used for the management device to instruct the first node to be updated if the monitoring information indicates that the first node is not accessed by the traffic;
If the first node is upgraded, the sending module is further configured to send second indication information to the service center by using the management device, where the second indication information is used to instruct the first node to be online.
In a fourth aspect, the present application provides a micro service upgrade apparatus, applied to a micro service upgrade system, where the micro service upgrade system includes a first micro service, a service center, and a gateway, where the service center is used for registering at least one node of the first micro service, and providing information of a callable node in the at least one node to the gateway, the gateway is used for providing a call service of an interface in the callable node to a user client according to the information of the callable node, the callable node includes a first node, and the apparatus includes:
the processing module is used for determining a service registration list by the service center, wherein the service registration list comprises information of the nodes which can be called;
the receiving module is used for receiving first indication information by the service center, wherein the first indication information is used for indicating to stop calling the first node;
the processing module is also used for updating the service registration list by the service center according to the first indication information;
The sending module is used for sending the updated service registration list to the gateway by the service center;
The receiving module is also used for receiving second indication information by the service center, wherein the second indication information is used for indicating the first node to be online;
The processing module is also used for updating the service registration list again by the service center according to the second indication information;
the sending module is also used for sending the updated service registration list to the gateway by the service center.
A computer device comprising a memory storing a computer program and a processor implementing the steps of the method provided in any of the embodiments above when the computer program is executed.
A computer readable storage medium having stored thereon a computer program which when executed by a processor implements the steps of the method provided by any of the above embodiments.
As can be seen from the foregoing embodiments, the management apparatus in the present application sends, to the service center, first indication information for indicating that the service center stops calling the first node in response to an operation of suspending the calling of the service of the first node. After receiving the first indication information, the service center updates the service registration list and then sends the updated service registration list to the gateway. The gateway can stop the call to the first node after receiving the updated service registration list, and before that, the first node is also called, that is, still receives the access request of the traffic. In order to avoid losing data generated by the first node when the traffic accesses the first node, the management device determines whether the traffic accesses the first node or not through the monitoring information, and the first node is not instructed to be upgraded until the traffic does not access the first node, so that the first node can be upgraded safely. When the first node is upgraded, the management device indicates that the service center can call the first node, so that service operation of the first node is restored. The method and the system can upgrade the micro-service without being limited by time when no traffic accesses the node of the micro-service, and operation and maintenance personnel are not required to wait in the early morning, so that the operation of the operation and maintenance personnel for upgrading the micro-service is greatly facilitated, and the physical health of the operation and maintenance personnel is facilitated.
Drawings
In order to more clearly illustrate the technical solution of the present application, the drawings that are needed in the embodiments will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic diagram of an exemplary micro-service upgrade system architecture according to an embodiment of the present application;
FIG. 2 is a flowchart of an exemplary micro-service upgrade method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a display interface of an exemplary management device according to an embodiment of the present application;
FIG. 4 is a flowchart of another example of a micro-service upgrade method according to an embodiment of the present application;
Fig. 5 is a schematic diagram of a display interface of a management device according to another embodiment of the present application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the application. It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless expressly stated otherwise, as understood by those skilled in the art. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. The term "and/or" as used herein includes all or any element and all combination of one or more of the associated listed items.
At present, as the access amount of users is less after the early morning, most operation and maintenance personnel select the nodes of the micro service to be upgraded after the early morning so as to reduce the influence caused by data loss due to the node upgrade of the micro service. However, the manner of upgrading the micro-service after the early morning brings inconvenience to the operation and maintenance personnel. Accordingly, in view of the above problems, the present application provides a solution for upgrading micro services that is not limited in time.
Fig. 1 is a schematic diagram of an exemplary micro-service upgrade system architecture according to an embodiment of the present application, and as shown in fig. 1, the micro-service upgrade system 100 includes a first micro-service 110, a service center 120, a gateway 130, a user client 140, and a management device 150.
Wherein the first micro service 110 includes at least one node, the at least one node includes a first node 111 and a second node 112, and the first node 111 and the second node 112 deploy the same application program to share a request initiated by a client to the first micro service 110. After the first node 111 and the second node 112 are started, the respective information is registered in the service center 120. The information includes the address of the node, the name of the node, and the like.
The service center 120 is responsible for registration and discovery of individual micro-services. Specifically, the service center 120 may generate a service registration list storing information of the callable node of the at least one node according to the registered node information. Service center 120 may send the service registration list to gateway 130 after receiving the information that the gateway requests to obtain the service registration list. The service registration list may also be sent to gateway 130 after the service registration list is updated.
Gateway 130 determines the nodes that can be invoked based on the acquired service registration list. The user client 140 is then provided with a call service for the interface in the node that can be invoked, according to the node that can be invoked.
The management device 150 enables upgrades to the first micro service 110 by interacting with the registry 120 and nodes of the first micro service 110.
Illustratively, the management device 150 includes an input module for inputting information, and a display for displaying content through a display interface.
In one example, the first micro service 110 is a service in Spring Boot framework (service) layer, the service center 120 is a service center (Eureka) developed by Spring Cloud, and the gateway 130 is a gateway framework Spring Cloud Gateway developed by Spring Cloud.
Based on the scenario architecture shown in fig. 1, the present application provides a micro service upgrade method, which is applied to a micro service upgrade system 100, as shown in fig. 2, and includes:
S210, the management device 150 sends, to the service center 120, first instruction information for instructing to stop calling the first node 111 in response to an operation to suspend the service of the first node 111 from being called.
In one example, the operator inputs an instruction to pause the first node from being invoked to the management device 150 through an input module of the management device 150. The management device 150 transmits first instruction information for instructing to stop calling the service of the first node 111 to the service center 120 in response to an operation of suspending the service of the first node by the operation and maintenance personnel from being called.
In one example, the first indication information includes an address and a port number of the first node 111, so that the service center 120 can quickly and accurately delete the first node 111 from the service registration list and the information corresponding to the first node according to the address and the port number of the first node 111.
In one example, since in most cases an application includes multiple micro services, in order to efficiently manage upgrades to individual micro services on the management device 150, the micro service upgrade method provided by the present application further includes: the management device 150 obtains a classification identifier of the first micro service 110, where the classification identifier is used to represent an application to which the first micro service 110 belongs. The management device 150 determines an operation area corresponding to the first micro service on the display interface of the management device 150 according to the classification identifier of the first micro service 110.
Further exemplary ways in which the management device 150 obtains the classification identifier of the first micro service 110 include: the operation and maintenance personnel inputs the classification identification of the first micro service 110 to the management device 150 through the input module of the management device 150.
For example, as shown in fig. 3, the first micro-service 110 belongs to the application a, and its classification identifier is A1, and the second micro-service also belongs to the application a, and its classification identifier is A1. The management device 150 determines that both belong to the application a according to the classification identifier A1 of the first micro service 110 and the classification identifier A1 of the second micro service. And then determining the operation areas for upgrading of the first micro-service 110 and the second micro-service on the display interface according to the classification identifiers of the first micro-service and the second micro-service. As shown in fig. 3, on the display interface, the operation areas of the first micro service 110 and the second micro service are displayed after the key area of the application a is triggered.
Because of the large variety and number of micro services that the management device 150 is responsible for, it is difficult for the operator to find and select a node of a certain micro service from for upgrade. Therefore, in the above manner, the management device 150 can classify the micro services on the display interface according to the classification identifier of the micro services, so that the operation and maintenance personnel can conveniently and rapidly find the nodes of the micro services to be upgraded according to the application types, and perform subsequent operations, thereby further enhancing the operation convenience of the management device 150.
S220, the management device 150 obtains monitoring information, where the monitoring information is used to indicate whether there is traffic accessing the first node 111.
In one example, the management device 150 receives monitoring information sent from the first node 111, the monitoring information including a first identification indicating whether there is traffic to access the first node 111. If the first identifier is used to indicate that there is a traffic accessing the first node 111, the monitoring information further includes an internet protocol address (Internet Protocol Address, IP address) of the traffic accessing the first node 111, a thread number of the first node 111 accessed by the traffic, a uniform resource locator (Uniform Resource Locator, URL) of the traffic, a returned status code, a time when the traffic accesses the first node 111, a duration of time when the traffic accesses the first node 111, and the like. The status code is used to describe the returned request when the client sends the request to the server. Through the returned status code, the user can know whether the server side has normally processed the request or has made an error.
In this way, the management device 150 can accurately determine whether there is traffic accessing the first node according to the monitoring information, so as to determine whether the first node 111 can be upgraded subsequently.
If the monitoring information indicates that no traffic has accessed the first node 111, the management device 150 instructs to upgrade the first node 111S 230.
In one example, if the monitoring information indicates that no traffic has accessed the first node 111, the management device 150 instructs to upgrade the first node 111 through the display interface, and after the operator sees the content on the display interface for indicating to upgrade the first node 111, the operator manually stops the operation of the service of the first node 111, and upgrades the first node 111.
In one example, if the monitoring information indicates that no traffic is accessing the first node 111, the management device 150 sends a shutdown instruction message to the first node 111, where the shutdown instruction message is used to instruct the first node 111 to stop the service operation. The manner in which the management device 150 instructs the first node 111 to upgrade includes: the management device 150 instructs to upgrade the first node 111 through the display interface, and after the operation and maintenance personnel sees the content on the display interface for instructing to upgrade the first node 111, the operation and maintenance personnel upgrades the first node 111; or alternatively
The stop indication information further includes information such as a patch package required for the first node 111 to upgrade, and after the first node 111 receives the stop indication information, service operation is stopped, and upgrade is automatically performed according to the information such as the patch package required for the upgrade.
In the above manner, the management device 150 sends the shutdown instruction information to the first node 111, so that the first node 111 can be timely stopped from service operation, so that the first node 111 can be upgraded conveniently. Further, if the shutdown instruction information further includes information such as a patch package required for upgrading the first node 111, the first node 111 can automatically upgrade according to the shutdown instruction information.
S240, if the first node 111 is upgraded, the management device 150 sends second instruction information to the service center 120, where the second instruction information is used to instruct the first node 111 to be online.
In one example, the first node 111 initiates program operation after the upgrade is completed and transmits information indicating the upgrade completion to the management device 150. After receiving the information, the management device 150 determines that the first node 111 is completely upgraded according to the information for indicating that the upgrade is completed, and sends second indication information to the service center 120.
In one example, the second indication information includes an address and a port number of the first node 111, so that the service center 120 can quickly and accurately add corresponding information of the first node 111 to the service registration list according to the address and the port number of the first node 111.
In the above manner, the management device 150 can ensure that the first node 111 is online to the service center 120 after the upgrade of the first node 111 is completed according to the information for indicating the upgrade completion from the first node 111, so as to avoid the problem that the service center 120 brings the first node 111 online in advance, resulting in the user client 140 accessing the first node 111 to fail.
As can be seen from the foregoing embodiments, the management apparatus in the present application sends, to the service center, first indication information for indicating that the service center stops calling the first node in response to an operation of suspending the calling of the service of the first node. After receiving the first indication information, the service center updates the service registration list and then sends the updated service registration list to the gateway. The gateway can stop the call to the first node after receiving the updated service registration list, and before that, the first node is also called, that is, still receives the access request of the traffic. In order to avoid losing data generated by the first node when the traffic accesses the first node, the management device determines whether the traffic accesses the first node or not through the monitoring information, and the first node is not instructed to be upgraded until the traffic does not access the first node, so that the first node can be upgraded safely. When the first node is upgraded, the management device indicates that the service center can call the first node, so that service operation of the first node is restored. The method and the system can upgrade the micro-service without being limited by time when no traffic accesses the node of the micro-service, and operation and maintenance personnel are not required to wait in the early morning, so that the operation of the operation and maintenance personnel for upgrading the micro-service is greatly facilitated, and the physical health of the operation and maintenance personnel is facilitated.
In one example, after the management device 150 sends the second indication information to the service center 120, operation in response to suspending the next node's service from being invoked (e.g., the second node 112) is continued and the service center 120 is instructed to stop invoking the node. And when the monitoring information of the next node indicates that no traffic accesses the node, the node is indicated to be upgraded. After the node upgrade is completed, the service center 120 is instructed to resume the call to the node (see methods S210 to S240 for further scheme details, which are not described herein), and to continue upgrading the next node of the node, so iterating until all nodes of the first microservice are upgraded.
In the above manner, when one node is upgraded and service operation is restored, the next node is upgraded, and compared with the manner that all nodes are upgraded at the same time, the method enables the user client to access the first micro service normally, and meanwhile, if the upgrade has a problem, the user client can find out and stop damage timely.
Correspondingly, in combination with fig. 1, the application also provides a micro-service upgrading method, which comprises the following steps:
s310, the service center 120 determines a service registration list including information of nodes that can be called.
S320, the service center 120 receives the first instruction information from the management device 150, where the first instruction information is used to instruct to stop calling the first node.
S330, the service center 120 updates the service registration list according to the first indication information.
Specifically, the service center 120 deletes the information on the first node in the service registration list according to the address and port number of the first node 111 in the first instruction information.
S340, the service center 120 transmits the updated service registration list to the gateway 130.
Service center 120 may send an updated service registration list to gateway 130 after receiving information from gateway 130 requesting acquisition of the service registration list. The updated service registration list may be actively transmitted to gateway 130 after the service registration list is updated. After receiving the updated service registration list, gateway 130 stops invoking the service of first node 111.
S350, the service center 120 receives second indication information from the management device 150, where the second indication information is used to indicate that the first node 111 is online.
S360, the service center 120 updates the service registration list again according to the second indication information.
Specifically, the service center 120 adds information about the first node 111 to the service registration list according to the address and port number of the first node 111 in the second instruction information.
S370, the service center 120 transmits the service registration list updated again to the gateway 130.
The service center 120 may send the service registration list updated again to the gateway 130 after receiving the information that the gateway 130 requests to acquire the service registration list. The updated service registration list may be sent to gateway 130 after the service registration list is updated. After receiving the service registration list updated again, gateway 130 resumes invoking the service of first node 111.
As can be seen from the above embodiments, after receiving the first indication information, the service center in the present application updates the service registration list, and then sends the updated service registration list to the gateway. After receiving the updated service registration list, the gateway stops calling the first node so that the management device starts the upgrade of the first node, and thus the first node can be upgraded safely. After the first node is upgraded, the service center receives the second indication information capable of calling the first node, updates the service registration list again, and then sends the service registration list updated again to the gateway. And after receiving the service registration list updated again, the gateway resumes the call to the first node. The proposal can cooperate with the management device to upgrade the micro service without being limited by time.
In connection with the above embodiment, the present application provides another example of a micro service upgrade method, which is described below with reference to fig. 4. Wherein the first micro service 110 is a service in Spring Boot framework (service) layer, the service center 120 is a service center (Eureka) developed by Spring Cloud, and the gateway 130 is a gateway framework Spring Cloud Gateway developed by Spring Cloud. After the first micro service 110 is registered with the service center 120, the service center 120 determines a service registration list including information of nodes of the first micro service 110. Gateway 130 is able to obtain information of the node of first micro service 110 through the service registration list to provide calling service of the interface in the node of first micro service 110 to user client 140, and the upgrade method will be described below taking first micro service including first node 111 as an example.
S410, the management device 150 determines the corresponding operation area of the first micro-service on the display interface of the management device 150 according to the classification identifier of the first micro-service.
Specifically, the operation and maintenance personnel inputs the classification identifier A1 of the first micro service 110 to the management device 150 through the input module of the management device 150, which indicates that the application to which the first micro service 110 belongs is the application a. The management device 150 determines, according to the classification identifier A1 of the first micro service, that the operation area of the display interface for upgrading the first micro service is an operation area D2 corresponding to the first micro service, which is displayed after the key area D1 of the application a is triggered, as shown in fig. 5, for example.
S420, the management device 150 transmits the first instruction information to the service center 120 in response to the operation to suspend the service of the first node 111 from being invoked, and the service center 120 receives the first instruction information from the management device 150.
Wherein. The first indication information is used for indicating that the first node 111 is stopped being called, and the first indication information includes an address and a port number of the first node 111.
Specifically, referring to fig. 5, an operator clicks an "upgrade" key area corresponding to the first micro service 110 through an input module, and then invokes attribute information and operation items corresponding to each node of the first micro service 110, where the attribute information includes a classification identifier, an application name corresponding to the classification identifier, a host name, an instance identifier (INSTANCE ID), an IP address, a first micro service name and a state, and other attribute information may be set according to requirements, which is not described herein again. The operation item includes "pause", and when the key region of "pause" is clicked, the management device 150 transmits first instruction information to the service center 120.
S430, the service center 120 updates the service registration list according to the first indication information.
Specifically, the service center 120 deletes the information on the first node in the service registration list according to the address and port number of the first node 111 in the first instruction information.
S440, the service center 120 transmits the updated service registration list to the gateway 130, and the gateway 130 receives the updated service registration list.
S450, the gateway 130 redetermines the node that can be invoked according to the updated service registration list.
Specifically, the node that can be invoked, which is redetermined by gateway 130, does not include first node 111, and therefore, the service interface of first node 111 implements the invoked stop.
S460, the first node 111 transmits the monitoring information to the management device 150 through the tomcat, and the management device 150 receives the monitoring information from the first node 111.
The tomcat is a web server deployed on the first node 111, and may be used to monitor traffic information accessing the first node 111. The content of the monitoring information is referred to the description in S220 and will not be described here again.
S470, if the monitoring information indicates that no traffic has accessed the first node 111, the management device 150 sends a shutdown instruction message to the first node 111, and instructs the operation and maintenance personnel to upgrade the first node 111 through the display interface, and the first node 111 receives the shutdown instruction message.
The outage indication information is used for indicating the first node 111 to stop service operation, and the outage indication information further includes information such as a patch package required for upgrading the first node 111.
And S480, the first node 111 stops service operation and upgrades according to the shutdown instruction information.
S490, after the first node 111 finishes upgrading, it starts the program operation, and sends information indicating that upgrading is finished to the management device 150, and the management device 150 receives the information.
S4100, the management device 150 transmits the second instruction information to the service center 120, and the service center 120 receives the second instruction information.
The content of the second indication information is referred to S240, and will not be described herein.
Specifically, after receiving the second instruction information, the management device 150 determines that the first node 111 is upgraded according to the information for indicating that the upgrade is completed, and then sends the second instruction information to the service center 120.
S4110, the service center 120 updates the service registration list again according to the second instruction information.
Specifically, the service center 120 adds information about the first node 111 to the service registration list according to the address and port number of the first node 111 in the second instruction information.
S4120, service center 120 transmits the re-updated service registration list to gateway 130, and gateway 130 receives the re-updated service registration list.
The gateway 130 again re-determines the nodes that can be invoked according to the again updated service registration list S4130.
Specifically, the nodes that can be invoked that are redetermined by gateway 130 again include first node 111, and thus, the service interface of first node 111 enables restoration of being invoked.
As can be seen from the above-described embodiments, the management apparatus 150 in the present application transmits the first instruction information to the service center 120 indicating to stop calling the first node 111 in response to the operation of suspending the service of the first node 111 from being called. After receiving the first indication information, the service center 120 updates the service registration list and then transmits the updated service registration list to the gateway 130. So that gateway 130 re-determines the callable node from the updated service registration list before which first node 111 would be invoked, i.e. would also receive the traffic access request. In order to enable the data generated by the traffic access to the first node 111 not to be lost, the management device 150 determines whether there is traffic access to the first node 111 by monitoring the information, and does not instruct the first node to be upgraded until there is no traffic access to the first node 111, so that the first node 111 can be upgraded safely. When the first node 111 finishes upgrading, the management device indicates that the service center 120 can call the first node, so that service operation of the first node is restored. The method and the system can upgrade the micro-service without being limited by time when no traffic accesses the node of the micro-service, and operation and maintenance personnel are not required to wait in the early morning, so that the operation of the operation and maintenance personnel for upgrading the micro-service is greatly facilitated, and the physical health of the operation and maintenance personnel is facilitated.
Based on the above embodiment, the present application further provides a micro service upgrade apparatus 500, which is applied to a micro service upgrade system, where the micro service upgrade system includes a first micro service, a service center, and a gateway, where the service center is used for registering at least one node of the first micro service, and providing information of a callable node in the at least one node to the gateway, and the gateway is used for providing a calling service of an interface in the callable node to a user client according to the information of the callable node, and the callable node includes the first node, where the apparatus 500 includes:
The sending module 510 is configured to send, to the service center, first indication information in response to an operation of suspending the service of the first node from being invoked by the management device, where the first indication information is used to indicate that invocation of the first node is stopped;
The receiving module 520 is used for the management device to acquire monitoring information, wherein the monitoring information is used for indicating whether the first node is accessed by the traffic;
The processing module 530 is configured to instruct the management device to upgrade the first node if the monitoring information indicates that no traffic has access to the first node;
If the first node is upgraded, the sending module 510 is further configured to send second indication information to the service center, where the second indication information is used to instruct the first node to be online.
Other implementation manners and effects of the device refer to the embodiments of the foregoing micro service upgrade method, and are not described herein.
Correspondingly, the present application also provides a micro service upgrade apparatus 600 applied to a micro service upgrade system, the micro service upgrade system including a first micro service, a service center, and a gateway, wherein the service center is used for registering at least one node of the first micro service, and providing information of a callable node in the at least one node to the gateway, and the gateway is used for providing a calling service of an interface in the callable node to a user client according to the information of the callable node, the callable node includes a first node, the apparatus 600 includes:
The processing module 610, the processing module 610 is configured to determine a service registry by the service center, where the service registry includes information of nodes that can be invoked;
The receiving module 620, the receiving module 620 is configured to receive first indication information from the service center, where the first indication information is used to indicate to stop calling the first node;
The processing module 610 is further configured to update the service registry according to the first indication information;
The sending module 630, the sending module 630 is configured to send the updated service registration list to the gateway by the service center;
The receiving module 620 is further configured to receive second indication information, where the second indication information is used to indicate that the first node is online;
The processing module 610 is further configured to update the service registration list again according to the second indication information by the service center;
The sending module 630 is further configured to send the service center to the gateway the service registration list updated again.
Other implementation manners and effects of the device refer to the embodiments of the foregoing micro service upgrade method, and are not described herein.
The basic principles of the present application have been described above in connection with specific embodiments, but it should be noted that the advantages, benefits, effects, etc. mentioned in the present application are merely examples and not intended to be limiting, and these advantages, benefits, effects, etc. are not to be construed as necessarily possessed by the various embodiments of the application. Furthermore, the specific details disclosed herein are for purposes of illustration and understanding only, and are not intended to be limiting, as the application is not necessarily limited to practice with the above described specific details.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
The block diagrams of the devices, apparatuses, devices, systems referred to in the present application are only illustrative examples and are not intended to require or imply that the connections, arrangements, configurations must be made in the manner shown in the block diagrams. As will be appreciated by one of skill in the art, the devices, apparatuses, devices, systems may be connected, arranged, configured in any manner. Words such as "including," "comprising," "having," and the like are words of openness and mean "including but not limited to," and are used interchangeably therewith. The terms "or" and "as used herein refer to and are used interchangeably with the term" and/or "unless the context clearly indicates otherwise. The term "such as" as used herein refers to, and is used interchangeably with, the phrase "such as, but not limited to.
It is also noted that in the apparatus, devices and methods of the present application, the components or steps may be disassembled and/or assembled. Such decomposition and/or recombination should be considered as equivalent aspects of the present application.
The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the application. Thus, the present application is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit embodiments of the application to the form disclosed herein. Although a number of example aspects and embodiments have been discussed above, a person of ordinary skill in the art will recognize certain variations, modifications, alterations, additions, and subcombinations thereof.
Claims (9)
1. A micro service upgrade method applied to a micro service upgrade system, the micro service upgrade system comprising a first micro service, a service center, a management device and a gateway, wherein the service center is used for registering at least one node of the first micro service, and providing information of a callable node in the at least one node to the gateway, the gateway is used for providing calling service of an interface in the callable node to a user client according to the information of the callable node, and the callable node comprises a first node, characterized in that the method comprises:
The management device responds to the operation of suspending the calling of the service of the first node and sends first indication information to the service center, wherein the first indication information is used for indicating stopping calling of the first node;
The management device acquires monitoring information, wherein the monitoring information is used for indicating whether traffic accesses the first node;
if the monitoring information indicates that no traffic accesses the first node, the management device indicates to upgrade the first node;
And if the first node is updated, the management device sends second indication information to the service center, wherein the second indication information is used for indicating the first node to be online.
2. The method of claim 1, wherein the managing means instructs the first node to upgrade if the monitoring information indicates that no traffic is accessing the first node, comprising:
if the monitoring information indicates that no flow accesses the first node, the management device transmits stop indication information to the first node, wherein the stop indication information is used for indicating stopping service operation;
The management device instructs to upgrade the first node.
3. The method according to claim 1 or 2, wherein the sending, by the management device, the second indication information to the service center if the first node is upgraded, includes:
The management device receives information used for indicating that upgrading is finished from the first node;
the management device determines that the first node is upgraded according to the information for indicating that the upgrade is finished, and sends second indication information to the service center.
4. The method according to claim 1 or 2, wherein the first indication information and the second indication information each comprise an address and a port number of the first node.
5. The method according to claim 1 or 2, characterized in that the method further comprises:
the management device acquires a classification identifier of the first micro service, wherein the classification identifier is used for representing an application to which the first micro service belongs;
and the management device determines the corresponding operation area of the first micro-service on the display interface of the management device according to the classification identification of the first micro-service.
6. A micro service upgrade method applied to a micro service upgrade system, the micro service upgrade system comprising a first micro service, a service center, a management device and a gateway, wherein the service center is used for registering at least one node of the first micro service, and providing information of a callable node in the at least one node to the gateway, the gateway is used for providing calling service of an interface in the callable node to a user client according to the information of the callable node, and the callable node comprises a first node, characterized in that the method comprises:
The service center determines a service registration list, wherein the service registration list comprises information of the callable nodes;
The service center receives first indication information, wherein the first indication information is used for indicating to stop calling the first node;
the service center updates the service registration list according to the first indication information;
The service center sends the updated service registration list to the gateway;
the service center receives second indication information, wherein the second indication information is used for indicating the first node to be online;
The service center updates the service registration list again according to the second indication information;
and the service center sends the updated service registration list to the gateway.
7. The method of claim 6, wherein the first indication information and the second indication information each comprise an address and a port number of the first node.
8. A micro service upgrade apparatus applied to a micro service upgrade system, the micro service upgrade system comprising a first micro service, a service center, a management apparatus, and a gateway, wherein the service center is used for registering at least one node of the first micro service, and providing information of a callable node of the at least one node to the gateway, the gateway is used for providing a call service of an interface of the callable node to a user client according to the information of the callable node, the callable node comprises a first node, the apparatus comprising:
The sending module is used for responding to the operation of suspending the calling of the service of the first node, and sending first indication information to the service center by the management device, wherein the first indication information is used for indicating stopping calling of the first node;
the receiving module is used for the management device to acquire monitoring information, and the monitoring information is used for indicating whether the first node is accessed by the traffic;
The processing module is used for the management device to instruct the first node to be updated if the monitoring information indicates that no traffic accesses the first node;
And if the first node is updated, the sending module is further configured to send second indication information to the service center by using the management device, where the second indication information is used to indicate that the first node is online.
9. A micro service upgrade apparatus applied to a micro service upgrade system, the micro service upgrade system comprising a first micro service, a service center, a management apparatus, and a gateway, wherein the service center is used for registering at least one node of the first micro service, and providing information of a callable node of the at least one node to the gateway, the gateway is used for providing a call service of an interface of the callable node to a user client according to the information of the callable node, the callable node comprises a first node, the apparatus comprising:
the processing module is used for determining a service registration list by the service center, wherein the service registration list comprises information of the callable nodes;
The receiving module is used for receiving first indication information by the service center, and the first indication information is used for indicating to stop calling the first node;
The processing module is further used for the service center to update the service registration list according to the first indication information;
The sending module is used for sending the updated service registration list to the gateway by the service center;
The receiving module is further configured to receive second indication information, where the second indication information is used to indicate that the first node is online;
The processing module is also used for the service center to update the service registration list again according to the second indication information;
The sending module is further configured to send the service registration list updated again to the gateway by the service center.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211426477.7A CN118075121A (en) | 2022-11-14 | 2022-11-14 | Micro-service upgrading method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211426477.7A CN118075121A (en) | 2022-11-14 | 2022-11-14 | Micro-service upgrading method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118075121A true CN118075121A (en) | 2024-05-24 |
Family
ID=91094153
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211426477.7A Pending CN118075121A (en) | 2022-11-14 | 2022-11-14 | Micro-service upgrading method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118075121A (en) |
-
2022
- 2022-11-14 CN CN202211426477.7A patent/CN118075121A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106790595B (en) | Docker container active load balancing device and method | |
CN104734931B (en) | Link establishing method and device between a kind of virtual network function | |
TW201944236A (en) | Task processing method, apparatus, and system | |
EP3291499A1 (en) | Method and apparatus for network service capacity expansion | |
CN106888233B (en) | Data updating system and method | |
US20080155245A1 (en) | Network booting apparatus and method | |
US20120297059A1 (en) | Automated creation of monitoring configuration templates for cloud server images | |
CN112632566B (en) | Vulnerability scanning method and device, storage medium and electronic equipment | |
TW201543243A (en) | Capability monitoring in a service oriented architecture | |
CN112035228A (en) | Resource scheduling method and device | |
CN102868736A (en) | Design and implementation method of cloud computing monitoring framework, and cloud computing processing equipment | |
WO2016197346A1 (en) | Method and apparatus for managing life circle of virtualized network function | |
US20230034901A1 (en) | Resource pool management system, resource pool management method and program | |
CN111258627A (en) | Interface document generation method and device | |
US11301284B2 (en) | Method for managing VNF instantiation and device | |
CN114168179B (en) | Micro-service management method, micro-service management device, computer equipment and storage medium | |
US8326913B2 (en) | Method and system for service contract discovery | |
US11863419B2 (en) | Network service management system and network service management method | |
EP4369181A1 (en) | Node for running container group, and management system and method of container group | |
CN115113975A (en) | Cluster management method and device, electronic equipment and storage medium | |
CN112583630A (en) | Device management method, device, system, device and storage medium | |
CN112698930B (en) | Method, device, equipment and medium for obtaining server identification | |
CN113760447A (en) | Service management method, device, equipment, storage medium and program product | |
CN111309474B (en) | Communication method, communication device and distributed service registration center | |
CN114726789A (en) | Method, device, equipment and medium for traffic management and traffic management policy configuration |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |