Disclosure of Invention
The embodiment of the application provides a service updating method, a service updating device, a management server and a storage medium, in the service updating process of a target service server, all service servers do not need to be stopped, the access weights of the target service server and other service servers which provide the same service with the target service server are updated in a mode of adjusting the access weights, so that a reverse proxy server can not issue an access request to the target service server, but can deliver the access request to other service servers which provide the same service for processing based on the corresponding access weights, and the normal response to the access request in the service updating process is favorably ensured.
In one aspect, an embodiment of the present application provides a service updating method, which is performed by a management server in a service deployment system, where the service deployment system further includes a reverse proxy server, at least one service server deployed with a service, and a client corresponding to the management server, where the management server is configured to manage service configuration data representing an access weight of each service server, and issue the service configuration data to the reverse proxy server, and the reverse proxy server is configured to control, based on the service configuration data, a forwarding amount for forwarding an access request to each service server, where the method includes:
receiving a service deployment updating request from the client, wherein the service deployment updating request carries identification information of a service server;
determining a target service server matched with the identification information from the started service servers;
acquiring a pre-configured access weight of the target service server, and adjusting the pre-configured access weight to zero to obtain a new access weight corresponding to the target service server;
determining other service servers which have the same service as the target service server and are deployed in the started service servers, and adjusting the pre-configured access weights of the other servers according to a preset adjustment rule to obtain new access weights corresponding to the other service servers;
generating new service configuration data based on the new access weights corresponding to the target service server and the other servers respectively;
sending the new service configuration data to the reverse proxy server, and returning update confirmation indication information for the target service server to the client, where the new service configuration data is used to indicate that the reverse proxy server controls forwarding amounts of access requests to the target service server and the other servers based on new access weights corresponding to the target service server and the other servers, and the update confirmation indication information is used to prompt a user corresponding to the client to update a service deployed by the target service server;
and if the new access weight corresponding to the target service server is zero, the forwarding amount corresponding to the target service server is zero.
In another aspect, an embodiment of the present application provides a service updating apparatus, where the apparatus is configured in a management server, the management server is deployed in a service deployment system, the service deployment system further includes a reverse proxy server, at least one service server deployed with a service, and a client corresponding to the management server, the management server is configured to manage service configuration data representing an access weight of each service server, and issue the service configuration data to the reverse proxy server, and the reverse proxy server is configured to control, based on the service configuration data, a forwarding amount for forwarding an access request to each service server, where the apparatus includes:
the communication module is used for receiving a service deployment updating request from the client, wherein the service deployment updating request carries identification information of a service server;
the processing module is used for determining a target service server matched with the identification information from the started service servers;
the processing module is further configured to obtain a preconfigured access weight of the target service server, adjust the preconfigured access weight to zero, obtain a new access weight corresponding to the target service server, determine, from the started service servers, other service servers with the same service as the target service server, and adjust the preconfigured access weight of the other servers according to a preset adjustment rule, so as to obtain a new access weight corresponding to the other service servers;
the processing module is further configured to generate new service configuration data based on the new access weights corresponding to the target service server and the other servers, respectively;
the communication module is further configured to send the new service configuration data to the reverse proxy server, and return update confirmation indication information for the target service server to the client, where the new service configuration data is used to indicate that the reverse proxy server controls forwarding amounts of an access request to be forwarded to the target service server and the other servers based on new access weights corresponding to the target service server and the other servers, and the update confirmation indication information is used to prompt a user corresponding to the client to update a service deployed by the target service server;
and if the new access weight corresponding to the target service server is zero, the forwarding amount corresponding to the target service server is zero.
In another aspect, an embodiment of the present application provides a management server, including a processor, a storage device, and a communication interface, where the processor, the storage device, and the communication interface are connected to each other, where the storage device is used to store a computer program that supports a terminal to execute the foregoing method, the computer program includes program instructions, and the processor is configured to call the program instructions, and perform the following steps:
receiving a service deployment updating request from the client, wherein the service deployment updating request carries identification information of a service server;
determining a target service server matched with the identification information from the started service servers;
acquiring a pre-configured access weight of the target service server, and adjusting the pre-configured access weight to zero to obtain a new access weight corresponding to the target service server;
determining other service servers which have the same service as the target service server and are deployed in the started service servers, and adjusting the pre-configured access weights of the other servers according to a preset adjustment rule to obtain new access weights corresponding to the other service servers;
generating new service configuration data based on the new access weights corresponding to the target service server and the other servers respectively;
sending the new service configuration data to the reverse proxy server, and returning update confirmation indication information for the target service server to the client, where the new service configuration data is used to indicate that the reverse proxy server controls forwarding amounts of access requests to the target service server and the other servers based on new access weights corresponding to the target service server and the other servers, and the update confirmation indication information is used to prompt a user corresponding to the client to update a service deployed by the target service server;
and if the new access weight corresponding to the target service server is zero, the forwarding amount corresponding to the target service server is zero.
According to the embodiment of the application, the access weights of the target service server and other service servers providing the same service with the target service server can be updated in a mode of adjusting the access weights, and subsequently, in the service updating process of the target service server, the reverse proxy server can not issue the access request to the target service server, but can deliver the access request to other service servers providing the same service to process the access request based on the corresponding access weights, so that the normal response to the access request in the service updating process can be ensured. Compared with the traditional service deployment, the method has the advantages that part or all of the servers do not need to be stopped, and then the services are updated.
Detailed Description
The Nginx (engine x) is a high-performance HTTP and reverse proxy web server, and can be used as an HTTP server to perform website publishing processing, and can be used as a reverse proxy to perform load balancing. In the embodiment of the present application, mainly, the negative proxy server is Nginx. Regarding the way of dealing with reverse proxy, taking a certain X website as an example, the number of visitors who are connected to the website at the same time every day is already exploded, and a single server is far from meeting the increasing purchasing desire of people, and at this time, a well-understood term appears: distributed deployment; namely, the problem of limitation of the number of visitors is solved by deploying a plurality of servers.
Most functions in an X website are also implemented by directly using a reverse proxy by using a Nginx, and a specific deployment manner may be as shown in fig. 1. As can be seen from fig. 1, the reverse proxy process performed by Nginx is as follows: after receiving the request sent by the plurality of clients to the Nginx server, the Nginx server distributes the request to the service processing server at the back end according to a certain rule for processing. At this time, the source of the request, that is, the user terminal, is clear, but it is not clear which server the request is specifically processed by, the role played by nginn is a reverse proxy role, the client is unaware of the existence of the proxy, the reverse proxy is transparent to the outside, and the visitor does not know that the visitor accesses the proxy. As the user terminal does not need any configuration to be accessible. Wherein, the reverse proxy has the following functions: the safety of the intranet is guaranteed, the reverse proxy is generally used as a public network access address, and the Web server is the intranet. And load balancing, namely optimizing the load of the website through a reverse proxy server.
Taking Nginx as a reverse proxy server, please refer to fig. 2, an embodiment of the present application provides a service deployment system, which includes amanagement server 20, aclient 21 corresponding to the management server, areverse proxy server 22, at least oneservice server 23, and at least oneuser terminal 24. Eachservice server 23 may deploy one or more services, themanagement server 20 is configured to manage service configuration data representing access weights of the service servers, and send the service configuration data to thereverse proxy server 22, and thereverse proxy server 22 is configured to control forwarding amounts for forwarding access requests from theuser terminal 24 to the service servers based on the service configuration data. The management server, the service server and the reverse proxy server may be independent physical servers, or may be a server cluster or a distributed system formed by a plurality of physical servers.
The services referred to in the embodiments of the present application may refer to, for example, login services, payment services, and the like provided for a user, and each service may correspond to a plurality of business servers. Taking the login service as an example, the service server 1 corresponding to the service may be used to provide a username-password login service, and the service server 2 corresponding to the service may be used to provide a code scanning login service.
The service deployment system further includes a reverse proxy server, at least one service server deployed with a service, and a client corresponding to the management server, where the management server is configured to manage service configuration data representing access weights of the service servers, and issue the service configuration data to the reverse proxy server, and the reverse proxy server is configured to control forwarding amounts for forwarding access requests to the service servers based on the service configuration data. Referring to fig. 3, the method of the embodiment of the present application includes the following steps.
S301: and receiving a service deployment updating request from the client, wherein the service deployment updating request carries the identification information of the service server. The identification information of the service server may refer to a number for uniquely identifying the service server, and the like.
In a specific implementation, when a user wants to update a service deployed by a target service server, the target service server may be selected from a service server list displayed by a client, and a service deployment update operation may be input for the target service server (for example, after the target service server is selected, a service update button of a currently displayed page is clicked and pressed). After detecting the operation of the service deployment update, the client can acquire the identification information of the target service server and send a service deployment update request carrying the identification information of the target service server to the management server.
S302: and determining a target service server matched with the identification information from the started service servers.
In a specific implementation, the management server may detect an operation state of each service server in the service deployment system, and determine a started service server based on the operation state. Further, the target service server corresponding to the identification information can be queried from the started service server through the identification information.
S303: and acquiring a pre-configured access weight of the target service server, and adjusting the pre-configured access weight to zero to obtain a new access weight corresponding to the target service server.
In an embodiment, a service configuration page may be displayed through a client in advance, a user may configure an access weight (that is, a preconfigured access weight) of each service server in the service configuration page, after the configuration is completed, service configuration data for each service server may be generated and uploaded to a management server, the management server may store the service configuration data and issue the service configuration data to a reverse proxy server, and the reverse proxy server may control a forwarding amount of forwarding an access request to each service server based on the access weight of each service server indicated by the service configuration data.
Specifically, the size of the access weight corresponding to each service server is in a direct proportion to the forwarding amount of the reverse proxy server forwarding the access request to each service server. It can be understood that, the higher the access weight of any service server is, the greater the number of access requests that characterize the reverse proxy server to forward to the any service server is, that is, the greater the corresponding forwarding amount is, and conversely, the smaller the forwarding amount is. If the access weight of any service server is 0, the number of the access requests forwarded to any service server by the reverse proxy server is represented to be 0, that is, the corresponding forwarding amount is 0.
S304: and determining other service servers which have the same service as the target service server and are deployed in the started service servers, and adjusting the pre-configured access weights of the other servers according to a preset adjustment rule to obtain new access weights corresponding to the other service servers.
The services may refer to, for example, a login service, a payment service, and the like provided for a user, and each service may correspond to a plurality of service servers. Exemplarily, it is assumed that the service deployment system includes a service server 1, a service server 2, a service server 3, a service server 4, and a service server 5, where the service server 1 and the service server 2 are both configured to provide a login service, and the service server 3, the service server 4, and the service server 5 are all configured to provide a payment service. Then, when the target service server is the service server 3, the service server 4 and the service server 5 may be determined as other service servers having the same service as that deployed by the service server 3.
The preset adjustment rule is that, for example, the service provided by the target service server is a login service, the provided login service further includes a service server 1 and a service server 2, and the preconfigured access weights of the target service server, the service server 1 and the service server 3 are 0.4, 0.2 and 0.4, respectively, so that the preset adjustment rule may be that the preconfigured access weights of the target service server are averagely allocated to other servers providing the same service. In this case, after the access weight corresponding to the target service server is modified to 0, the access weight of the service server 1 may be updated to 0.4, and the access weight of the service server 2 may be updated to 0.6.
S305: and generating new service configuration data based on the new access weights corresponding to the target service server and other servers respectively.
In an embodiment, service configuration data before updating of the access weight corresponding to the current target service server and the other servers may be obtained (for example, the service configuration data obtained by configuring the access weight of each service server through the service configuration page). Further, the access weight parts corresponding to the target service server and other servers in the service configuration data can be updated through the new access weights corresponding to the target service server and other servers, so that new service configuration data can be obtained.
S306: and sending the new service configuration data to the reverse proxy server, and returning the update confirmation indication information aiming at the target service server to the client.
The new service configuration data is used for indicating the reverse proxy server to control the forwarding amount of the access request to the target service server and other servers based on the new access weight corresponding to the target service server and other servers respectively. And if the new access weight corresponding to the target service server is zero, the forwarding amount corresponding to the target service server is zero.
And the update confirmation indication information is used for prompting the client to update the service deployed by the target service server corresponding to the user. That is, when the user corresponding to the client checks the update confirmation indication information through the client, it can be known that the preparation work for updating the service deployed by the target service server is completed ((that is, the access weight is updated)), and the user can perform the subsequent operation of service update on the target service server. By adopting the mode, in the subsequent process of updating the corresponding service of the target service server, the reverse proxy server can be ensured not to issue the access request to the target service server, but to deliver the access request to other servers providing the same service for processing based on the corresponding access weight. Compared with the traditional service deployment, the method has the advantages that part or all of the servers do not need to be stopped, and then the services are updated.
In the embodiment of the application, the access weights of the target service server and other service servers providing the same service as the target service server can be updated by adjusting the access weights, and subsequently, in the service updating process of the target service server, the reverse proxy server can not issue the access request to the target service server, but can deliver the access request to other service servers providing the same service to process the access request based on the corresponding access weights, so that the normal response to the access request in the service updating process is ensured. Compared with the traditional service deployment, the method has the advantages that part or all of the servers do not need to be stopped, and then the services are updated.
Referring to fig. 4, the present application provides another service updating method, which may be executed by a management server in a service deployment system, where the service deployment system further includes a reverse proxy server, at least one service server deployed with a service, and a client corresponding to the management server, where the management server is configured to manage service configuration data representing access weights of the service servers, and send the service configuration data to the reverse proxy server, and the reverse proxy server is configured to control forwarding amounts of forwarding access requests to the service servers based on the service configuration data. Referring to fig. 4, the method of the embodiment of the present application includes the following steps.
S401: acquiring service information of each service server, wherein the service information comprises any one or more of the following: internet protocol, port information, location information, identification information, and service description information of the corresponding service provided. The service description information characterizes what service the corresponding service server is used for providing, such as user password login service, code scanning login service, and the like.
As a feasible implementation manner, the SDK of the monitoring program may be integrated into each service server in advance, and the SDK may collect service information of each service server after each service server is started, and report the collected service information to the management server.
S402: and determining a pre-configured access weight corresponding to each business server, and generating and storing service configuration data aiming at each business server based on the service information and the pre-configured access weight of each business server. Wherein the service configuration data comprises preconfigured access weights and service information of the respective service servers.
In one embodiment, the service information includes location information, and after the management server performs step S402, the management server may further perform statistics on access requests received by the reverse proxy server, determine an access request amount of each region within a preset time period according to a statistical result, extract location information of each service server from the service configuration data, and determine a region where each service server is located based on the location information. Further, the preconfigured access weights of the service servers in different regions in the service configuration data can be adjusted according to the access request amount of each region in a preset time period.
In the above process of adjusting the preconfigured access weights of the service servers in different regions in the service configuration data according to the access request amount of each region in the preset time period, the adjustment may be performed based on a principle that the larger the access request amount is, the larger the corresponding access weight is. Exemplarily, assuming that the access request volume in the beijing area is relatively high within a preset time period, the access weight of the service server deployed in beijing may be correspondingly adjusted, the resources may be dynamically adjusted, and the response speed to the access request may be improved.
In an embodiment, after the service configuration data for each service server is generated and stored, the operation condition of each service server may also be detected, and if an operation failure of a first service server in each service server is detected, the preconfigured access weight of the first service server is adjusted to zero, so as to obtain a new access weight corresponding to the first service server, where the first service server is any one or more service servers in each service server. Further, a second service server with the same service as the first service server deployed may be determined from the started service servers, the preconfigured access weight of the second service server is adjusted according to a preset adjustment rule, a new access weight corresponding to the second service server is obtained, the service configuration data is updated based on the new access weights corresponding to the first service server and the second service server, and the updated service configuration data is sent to the reverse proxy server. So that the reverse proxy server can forward the access request based on the updated service configuration data.
S403: and receiving a service deployment updating request from the client, wherein the service deployment updating request carries the identification information of the service server.
S404: and determining a target service server matched with the identification information from the started service servers.
S405: and acquiring a pre-configured access weight of the target service server, and adjusting the pre-configured access weight to zero to obtain a new access weight corresponding to the target service server.
S406: and determining other service servers which have the same service as the target service server and are deployed in the started service servers, and adjusting the pre-configured access weights of the other servers according to a preset adjustment rule to obtain new access weights corresponding to the other service servers.
S407: and generating new service configuration data based on the new access weights corresponding to the target service server and other servers respectively.
S408: and sending the new service configuration data to the reverse proxy server, and returning the update confirmation indication information aiming at the target service server to the client. For specific implementation of steps S403 to S408, refer to the description related to steps S301 to S306 in the foregoing embodiment, and details are not repeated here.
In an embodiment, after the update confirmation indication information for the target service server is returned to the client, if it is detected that the service deployed for the target service server is updated, the access weights corresponding to the target service server and the other servers are restored based on the pre-recorded access weight before the target service server is updated and the pre-updated access weight of the other servers. Further, the new service configuration data may be updated based on the respective access weights corresponding to the restored target service server and other servers, and the updated service configuration data may be sent to the reverse proxy server.
Or, updating the service configuration data based on the restored access weight also requires occupying a certain resource. In order to improve the speed of restoration, the service configuration data before updating can be recorded directly before updating the access weights of the target service server and the other servers, if the completion of service updating deployed for the target service server is detected, the service configuration data before updating of the access weights corresponding to the target service server and the other servers which are recorded in advance are obtained, and the service configuration data before updating is issued to the reverse proxy server, so that the reverse proxy server controls the forwarding amount of forwarding the access request to each service server based on the service configuration data before updating.
In the embodiment of the application, the access weights of the target service server and other service servers providing the same service as the target service server can be updated by adjusting the access weights, and subsequently, in the service updating process of the target service server, the reverse proxy server can not issue the access request to the target service server, but can deliver the access request to other service servers providing the same service to process the access request based on the corresponding access weights, so that the normal response to the access request in the service updating process is ensured. Compared with the traditional service deployment, the method has the advantages that part or all of the servers do not need to be stopped, and then the services are updated.
The embodiment of the present application further provides a computer storage medium, in which program instructions are stored, and when the program instructions are executed, the computer storage medium is used for implementing the corresponding method described in the above embodiment.
Fig. 5 is a schematic structural diagram of a service update apparatus according to an embodiment of the present application.
In an implementation manner of the apparatus in the embodiment of the present application, the apparatus is configured in a management server, the management server is deployed in a service deployment system, the service deployment system further includes a reverse proxy server, at least one service server deployed with a service, and a client corresponding to the management server, the management server is configured to manage service configuration data representing an access weight of each service server, and issue the service configuration data to the reverse proxy server, and the reverse proxy server is configured to control, based on the service configuration data, a forwarding amount for forwarding an access request to each service server, including:
acommunication module 50, configured to receive a service deployment update request from the client, where the service deployment update request carries identification information of a service server;
aprocessing module 51, configured to determine, from the started service servers, a target service server that matches the identification information;
theprocessing module 51 is further configured to obtain a preconfigured access weight of the target service server, adjust the preconfigured access weight to zero to obtain a new access weight corresponding to the target service server, determine, from the started service servers, other service servers deployed with the same service as the target service server, and adjust the preconfigured access weight of the other servers according to a preset adjustment rule to obtain a new access weight corresponding to the other service servers;
theprocessing module 51 is further configured to generate new service configuration data based on new access weights corresponding to the target service server and the other servers, respectively;
thecommunication module 50 is further configured to send the new service configuration data to the reverse proxy server, and return update confirmation indication information for the target service server to the client, where the new service configuration data is used to indicate that the reverse proxy server controls forwarding amounts of forwarding an access request to the target service server and the other servers based on new access weights corresponding to the target service server and the other servers, and the update confirmation indication information is used to prompt a user corresponding to the client to update a service deployed by the target service server;
and if the new access weight corresponding to the target service server is zero, the forwarding amount corresponding to the target service server is zero.
In an embodiment, theprocessing module 51 is further configured to, if it is detected that the service deployed for the target service server is updated, restore the access weights corresponding to the target service server and the other servers based on the pre-recorded access weight before the target service server is updated and the pre-recorded access weight before the other servers are updated; and updating the new service configuration data based on the restored access weights corresponding to the target service server and the other servers respectively, and sending the updated service configuration data to the reverse proxy server.
In an embodiment, theprocessing module 51 is further configured to, if it is detected that the service deployed for the target service server is updated, obtain pre-recorded service configuration data before updating of the access weights corresponding to the target service server and the other servers, and send the pre-updated service configuration data to the reverse proxy server through thecommunication module 50.
In an embodiment, theprocessing module 51 is further configured to obtain service information of each service server, where the service information includes any one or more of the following: an internetworking protocol, port information, location information and identification information; determining a pre-configured access weight corresponding to each service server; and generating and storing service configuration data aiming at each service server based on the service information of each service server and the pre-configured access weight.
In an embodiment, the service information includes the location information, and theprocessing module 51 is further configured to count the access requests received by the reverse proxy server; determining the access request quantity of each region in a preset time period according to the statistical result; extracting the position information of each business server from the service configuration data; determining the region where each service server is located based on the position information; and adjusting the pre-configured access weight of each service server in different areas in the service configuration data according to the access request quantity of each area in the preset time period.
In an embodiment, theprocessing module 51 is further configured to detect an operation condition of each service server, and if it is detected that a first service server in each service server has an operation failure, adjust a preconfigured access weight of the first service server to zero to obtain a new access weight corresponding to the first service server, where the first service server is any one or more service servers in each service server; determining a second service server deployed with the same service as the first service server from the started service servers, and adjusting the pre-configured access weight of the second service server according to a preset adjustment rule to obtain a new access weight corresponding to the second service server; updating the service configuration data based on the new access weight corresponding to each of the first service server and the second service server; the updated service configuration data is sent to the reverse proxy server through thecommunication module 50.
In one embodiment, the size of the access weight corresponding to each service server is in a direct proportion to the forwarding amount of the reverse proxy server forwarding the access request to each service server.
In the embodiment of the application, the service updating device can update the access weights of the target service server and other service servers which provide the same service with the target service server by adjusting the access weights, and subsequently in the service updating process of the target service server, the reverse proxy server can not issue the access request to the target service server, but can deliver the access request to other service servers which provide the same service for processing based on the corresponding access weights, so that the normal response to the access request in the service updating process can be ensured. Compared with the traditional service deployment, the method has the advantages that part or all of the servers do not need to be stopped, and then the services are updated.
Referring to fig. 6 again, it is a schematic structural diagram of a management server according to an embodiment of the present application, where the management server according to the embodiment of the present application includes a power supply module and the like, and includes aprocessor 601, astorage device 602, and acommunication interface 603. Theprocessor 601, thestorage device 602 and thecommunication interface 603 may exchange data with each other, and theprocessor 601 implements a corresponding service update function. The management server is deployed in a service deployment system, the service deployment system further comprises a reverse proxy server, at least one service server with services deployed and a client corresponding to the management server, the management server is used for managing service configuration data representing access weights of the service servers and sending the service configuration data to the reverse proxy server, and the reverse proxy server is used for controlling forwarding amount of access requests forwarded to the service servers based on the service configuration data.
Thestorage device 602 may include a volatile memory (volatile memory), such as a random-access memory (RAM); thestorage device 602 may also include a non-volatile memory (non-volatile memory), such as a flash memory (flash memory), a solid-state drive (SSD), etc.; the storage means 602 may also comprise a combination of memories of the kind described above.
Theprocessor 601 may be a Central Processing Unit (CPU) 601. In one embodiment, theprocessor 601 may also be a Graphics Processing Unit (GPU) 601. Theprocessor 601 may also be a combination of a CPU and a GPU. In the server, a plurality of CPUs and GPUs can be included as needed to perform corresponding service updating. In one embodiment, thestorage device 602 is used to store program instructions. Theprocessor 601 may invoke the program instructions to implement the various methods as described above in the embodiments of the present application.
In a first possible implementation manner, the processor 601 of the server calls a program instruction stored in the storage device 602, and is configured to receive a service deployment update request from the client through a communication interface 603, where the service deployment update request carries identification information of a service server; determining a target service server matched with the identification information from the started service servers; acquiring a pre-configured access weight of the target service server, and adjusting the pre-configured access weight to zero to obtain a new access weight corresponding to the target service server; determining other service servers which have the same service as the target service server and are deployed in the started service servers, and adjusting the pre-configured access weights of the other servers according to a preset adjustment rule to obtain new access weights corresponding to the other service servers; generating new service configuration data based on the new access weights corresponding to the target service server and the other servers respectively; sending the new service configuration data to the reverse proxy server, and returning update confirmation indication information for the target service server to the client, where the new service configuration data is used to indicate that the reverse proxy server controls forwarding amounts of access requests to the target service server and the other servers based on new access weights corresponding to the target service server and the other servers, and the update confirmation indication information is used to prompt a user corresponding to the client to update a service deployed by the target service server;
and if the new access weight corresponding to the target service server is zero, the forwarding amount corresponding to the target service server is zero.
In an embodiment, theprocessor 601 is further configured to restore, if it is detected that the service deployed for the target service server is updated, the access weights corresponding to the target service server and the other servers based on the pre-recorded access weight before the target service server is updated and the pre-updated access weight before the other servers are updated; and updating the new service configuration data based on the restored access weights corresponding to the target service server and the other servers respectively, and sending the updated service configuration data to the reverse proxy server.
In an embodiment, theprocessor 601 is further configured to, if it is detected that the service deployed for the target service server is updated, obtain pre-recorded service configuration data before updating of access weights corresponding to the target service server and the other servers, and send the pre-updated service configuration data to the reverse proxy server through thecommunication interface 603.
In an embodiment, theprocessor 601 is further configured to obtain service information of each service server, where the service information includes any one or more of the following: an internetworking protocol, port information, location information and identification information; determining a pre-configured access weight corresponding to each service server; and generating and storing service configuration data aiming at each service server based on the service information of each service server and the pre-configured access weight.
In one embodiment, the service information includes the location information, and theprocessor 601 is further configured to count access requests received by the reverse proxy server; determining the access request quantity of each region in a preset time period according to the statistical result; extracting the position information of each business server from the service configuration data; determining the region where each service server is located based on the position information; and adjusting the pre-configured access weight of each service server in different areas in the service configuration data according to the access request quantity of each area in the preset time period.
In an embodiment, theprocessor 601 is further configured to detect an operation condition of each service server, and if it is detected that a first service server in each service server has an operation failure, adjust a preconfigured access weight of the first service server to zero to obtain a new access weight corresponding to the first service server, where the first service server is any one or more service servers in each service server; determining a second service server deployed with the same service as the first service server from the started service servers, and adjusting the pre-configured access weight of the second service server according to a preset adjustment rule to obtain a new access weight corresponding to the second service server; updating the service configuration data based on the new access weight corresponding to each of the first service server and the second service server; the updated service configuration data is sent to the reverse proxy server through thecommunication interface 603.
In one embodiment, the size of the access weight corresponding to each service server is in a direct proportion to the forwarding amount of the reverse proxy server forwarding the access request to each service server.
Theprocessor 601, thestorage device 602 and thecommunication interface 603 can be implemented as described in the embodiments corresponding to the previous figures.
In the embodiment of the application, the management server can update the access weights of the target service server and other service servers which provide the same service with the target service server by adjusting the access weights, and subsequently, in the service updating process of the target service server, the reverse proxy server can not issue the access request to the target service server, but can deliver the access request to other service servers which provide the same service for processing based on the corresponding access weights, so that the normal response to the access request in the service updating process is ensured. Compared with the traditional service deployment, the method has the advantages that part or all of the servers do not need to be stopped, and then the services are updated.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
While the invention has been described with reference to a number of embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.