Traffic configuration, traffic distribution and service program upgrade method of server cluster
By monitoring and synchronizing the service program version of the server cluster, the problem of client data confusion caused by the mixing of old and new versions when the service program version is upgraded in the server cluster is solved, and intelligent traffic distribution and data consistency are achieved.
Patent Information
- Application Number
- CN202210323799.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-29
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-03-29
AI Technical Summary
In the server cluster, when the service program version is upgraded, the client data is confused due to the mixing of old and new versions.
By monitoring the service program versions of multiple server clusters, configuring traffic status, and synchronizing it to the DNS server to achieve intelligent distribution of traffic, ensure that all servers provide the same version of the service program, thereby avoiding version mixing.
This effectively avoids client data confusion caused by mixing old and new versions when upgrading server cluster service program versions, ensuring data consistency and service stability.
Smart Images

Figure CN114760303B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method for traffic configuration, traffic distribution and service program upgrade of a server cluster. Background Art
[0002] A server cluster is composed of multiple server hosts that have exactly the same functions and are grouped together to manage and provide services.
[0003] At present, with the rapid development of the Internet, its related business traffic has also shown explosive growth. Related technologies generally use reverse proxy servers such as Nginx / Apache / Squid to distribute and control the traffic of server clusters. However, this traffic distribution and control method is prone to user-side data confusion due to the mixing of new and old versions when the service program used by the server cluster is upgraded from an old version to a new version. Summary of the invention
[0004] The present application aims to solve one of the technical problems in the related art at least to some extent.
[0005] The present application proposes a method for traffic configuration, traffic distribution and service program upgrade of a server cluster to solve the traffic distribution and control methods in the related technology. When the service program adopted by the server cluster is upgraded, since the new and old versions of the service program provide services at the same time, it is easy to cause the technical problem of user-side data confusion due to the mixing of the new and old versions.
[0006] The first aspect of the present application proposes a traffic configuration method for a server cluster, which is applied to a diversion configuration server, including: monitoring the versions of service programs adopted by multiple server clusters; configuring the traffic status of the multiple server clusters according to the versions of the service programs adopted by the multiple server clusters; synchronizing the traffic status of the multiple server clusters to a domain name system DNS server, so that the domain name system DNS server distributes traffic to the multiple server clusters according to the updated traffic status.
[0007] The traffic configuration method of the server cluster provided in the present application configures the traffic status of multiple server clusters according to the versions of the service programs adopted by the multiple server clusters, so as to ensure that the versions of the service programs providing services in the multiple server clusters are consistent, thereby avoiding the situation where user-side data confusion occurs due to the mixing of old and new versions when the service programs adopted by the server clusters are upgraded.
[0008] The second aspect of the present application proposes a method for distributing traffic to a server cluster, which is applied to a DNS server, including: receiving a traffic status synchronized by a traffic configuration server using the traffic configuration method of the first aspect; and distributing traffic to multiple server clusters according to the traffic status.
[0009] The traffic distribution method for a server cluster provided in an embodiment of the present application receives the traffic status synchronized by the traffic configuration method of the first embodiment of the diversion configuration server, and distributes traffic to multiple server clusters according to the traffic status, thereby realizing traffic distribution to multiple server clusters according to the traffic status synchronized by the diversion configuration server.
[0010] The third aspect embodiment of the present application proposes a service program upgrade method for a server cluster, which is applied to the server cluster, including: monitoring the traffic allocated by the DNS server to determine the status of the server cluster; wherein the traffic is allocated by the DNS server according to the traffic status synchronized by the traffic configuration method described in the first aspect embodiment according to the diversion configuration server; and performing a version upgrade of the service program according to the status of the server cluster.
[0011] The service program upgrade method of the server cluster provided in the embodiment of the present application monitors the traffic allocated by the DNS server to determine the status of the server cluster, and upgrades the version of the service program according to the status of the server cluster, thereby realizing the version upgrade of the service program of the server cluster and avoiding the situation where user-side data is confused due to the mixing of old and new versions when the service program used by the server cluster is upgraded.
[0012] The fourth aspect embodiment of the present application proposes a diversion configuration server, including: a monitoring module, used to monitor the version of the service program adopted by multiple server clusters; a configuration module, used to configure the traffic status of the multiple server clusters according to the version of the service program adopted by the multiple server clusters; a synchronization module, used to synchronize the traffic status of the multiple server clusters to the domain name system DNS server, so that the domain name system DNS server distributes traffic to the multiple server clusters according to the updated traffic status.
[0013] The diversion configuration server provided in the present application can ensure that the versions of the service programs providing services in multiple server clusters are consistent by configuring the traffic status of multiple server clusters according to the versions of the service programs adopted by the multiple server clusters, thereby avoiding the situation where user-side data is confused due to the mixing of old and new versions when the service programs adopted by the server clusters are upgraded.
[0014] The fifth aspect embodiment of the present application proposes a DNS server, including: a receiving module, used to receive the traffic status synchronized by the diversion configuration server using the traffic configuration method described in the first aspect embodiment above; an allocation module, used to allocate traffic to multiple server clusters according to the traffic status.
[0015] The DNS server provided in the embodiment of the present application receives the traffic status synchronized by the traffic configuration method of the first embodiment of the diversion configuration server, and distributes traffic to multiple server clusters according to the traffic status, thereby realizing traffic distribution to multiple server clusters according to the traffic status synchronized by the diversion configuration server.
[0016] The sixth aspect embodiment of the present application proposes a server cluster, including: a monitoring module, used to monitor the traffic allocated by the DNS server to determine the status of the server cluster; wherein the traffic is allocated by the DNS server according to the traffic status synchronized by the traffic configuration method described in the first aspect embodiment of the present application according to the diversion configuration server; an upgrade module, used to upgrade the version of the service program according to the status of the server cluster.
[0017] The server cluster provided in the embodiment of the present application monitors the traffic allocated by the DNS server to determine the status of the server cluster, and upgrades the version of the service program according to the status of the server cluster, thereby realizing the version upgrade of the service program of the server cluster and avoiding the situation where user-side data is confused due to the mixing of old and new versions when the service program used by the server cluster is upgraded.
[0018] The seventh aspect embodiment of the present application proposes a traffic configuration system for a server cluster, including multiple server clusters for executing the service program upgrade method as described in the third aspect embodiment above; a diversion configuration server for executing the traffic configuration method as described in the first aspect embodiment above to configure the traffic status of multiple server clusters; and a DNS server for executing the traffic distribution method as described in the second aspect embodiment above to distribute traffic to multiple server clusters.
[0019] The eighth aspect embodiment of the present application proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method proposed in the first aspect embodiment, the second aspect embodiment, or the third aspect embodiment of the present application.
[0020] The ninth aspect embodiment of the present application proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the method proposed in the first aspect embodiment, the second aspect embodiment, or the third aspect embodiment of the present application.
[0021] The tenth aspect embodiment of the present application proposes a computer program product, including a computer program, which, when executed by a processor, implements the method proposed in the first aspect embodiment, the second aspect embodiment, or the third aspect embodiment of the present application.
[0022] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0024] Figure 1 A flow chart of a method for configuring traffic flow of a server cluster provided in an embodiment of the present application;
[0025] Figure 2 Another flow chart of the method for configuring the flow of a server cluster provided in an embodiment of the present application;
[0026] Figure 3 Normal traffic distribution diagram of server cluster A and server cluster B provided in the embodiment of the present application;
[0027] Figure 4 Traffic distribution diagram of server cluster A and server cluster B in a first traffic state provided in an embodiment of the present application;
[0028] Figure 5 Another traffic distribution diagram of the server cluster A and the server cluster B provided in the embodiment of the present application under the first traffic state;
[0029] Figure 6 A traffic distribution diagram of server cluster A and server cluster B in a second traffic state provided in an embodiment of the present application;
[0030] Figure 7 Another traffic distribution diagram of the server cluster A and the server cluster B provided in the embodiment of the present application under the second traffic state;
[0031] Figure 8 Another traffic distribution diagram of the server cluster A and the server cluster B provided in the embodiment of the present application under the second traffic state;
[0032] Fig. 9 A flow distribution diagram of server cluster A and server cluster B in a third flow state provided in an embodiment of the present application;
[0033] Fig.10 A flow chart of a method for distributing traffic to a server cluster provided in an embodiment of the present application;
[0034] Fig.11 A flow chart of a service program upgrade method for a server cluster provided in an embodiment of the present application;
[0035] Fig.12 Another flowchart of the service program upgrade method of the server cluster provided in the embodiment of the present application;
[0036] Fig.13 A schematic diagram of the structure of the flow distribution configuration server provided in the embodiment of the present application;
[0037] Fig.14 A schematic diagram of the structure of the DNS server provided in the embodiment of the present application;
[0038] Fig.15 A schematic diagram of the structure of a server cluster provided in an embodiment of the present application;
[0039] Fig.16 A block diagram of an exemplary electronic device suitable for implementing the embodiments of the present application is shown. DETAILED DESCRIPTION
[0040] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0041] At present, with the rapid development of the Internet, its related business traffic has also shown explosive growth. Related technologies generally use reverse proxy servers such as Nginx / Apache / Squid to distribute and control the traffic of server clusters. However, this traffic distribution and control method is prone to user-side data confusion due to the mixing of new and old versions when the service program used by the server cluster is upgraded from an old version to a new version.
[0042] For example, when the service program used by server cluster A is upgraded from an old version to a new version, the new version of the service program of server cluster A provides services, while for server cluster B that has not upgraded the service program version, the old version of the service program provides services. Since the old and new versions of the service programs provide services at the same time, when the user end implements a certain function through the service programs of server cluster A and server cluster B, user-end data confusion is likely to occur.
[0043] The present application mainly addresses the above-mentioned technical problems and proposes a traffic configuration method, a traffic distribution method, a service program upgrade method, a diversion configuration server, a DNS (Domain Name System) server, a server cluster, a traffic configuration system of a server cluster, an electronic device, a storage medium and a computer program product that can avoid the situation where user-side data confusion occurs due to the mixing of old and new versions when the service program used by the server cluster is upgraded.
[0044] The following describes, with reference to the accompanying drawings, a traffic configuration method, a traffic distribution method, a service program upgrade method, a diversion configuration server, a DNS server, a server cluster, a traffic configuration system of a server cluster, an electronic device, a storage medium, and a computer program product of an embodiment of the present application.
[0045] In order to clearly illustrate the technical solution provided by the embodiment of the present application, the diversion configuration server provided by the embodiment of the present application and the terms involved are first explained.
[0046] The traffic diversion configuration server has the following functions: configure each server cluster to be enabled or disabled, and configure the effective version of the service program used by each server cluster. In addition, the traffic diversion configuration server can synchronize the traffic status of multiple configured server clusters to the DNS server, and synchronize the effective version of the service program used by each configured server cluster to the corresponding server cluster.
[0047] Among them, the DNS server is a service provided by the Internet. It is a distributed database that maps domain names and IP (Internet Protocol) addresses to each other, which enables people to access the Internet more conveniently. For example, the DNS server can map the URL http: / / xiaozhi.jd.com to a specific host IP address: 1.2.3.4.
[0048] Referring to Table 1, the traffic diversion configuration server can configure server cluster A and server cluster B to be enabled. In the "IP List" column in Table 1, "1.2.3.4" and "2.3.4.5" respectively represent the IP addresses of different server hosts in server cluster A, and "5.6.7.8" and "9.0.1.2" respectively represent the IP addresses of different server hosts in server cluster B. In the "Cluster ID" column in Table 1, "Jimi1" and "Jimi2" respectively represent the IDs of server cluster A and server cluster B. The ID of the server cluster is used to uniquely identify the server cluster.
[0049] Table 1 Traffic configuration of server cluster
[0050]
[0051] It should be noted that for a server cluster that is in an enabled state, the DNS server will distribute traffic to the server cluster, that is, when the user's client (also referred to as the user end in the embodiment of the present application) accesses a certain URL, the DNS server will return the IP address of the server cluster to the client, so that the server cluster can provide services for the client to access the URL; for a server cluster that is in a disabled state, the DNS server will not distribute traffic to the server cluster, that is, when the user's client accesses a certain URL, the DNS server will not return the IP address of the server cluster to the client, so that the server cluster does not provide services for the client to access the URL. Among them, traffic can be understood as the http (Hyper Text Transfer Protocol) or https (Hyper Text Transfer Protocol over Secure Socket Layer) traffic provided to the user to access the specified domain name address through the browser when the user uses the service program of the server cluster through the browser.
[0052] Referring to Table 2, the diversion configuration server can also configure whether the versions of the service programs used by server cluster A and server cluster B are valid. When a version is valid, the version is called the effective version. In the "Version Number" column in Table 2, "20210619010100" and "20210618010100" respectively represent the version numbers of the service programs used by the server clusters. The version number is used to uniquely identify the version of the service program.
[0053] Table 2 Version configuration of service programs in server cluster
[0054] Cluster ID Cluster name Version Number Is it effective? Jimi1 Cluster A 20210619010100 efficient Jimi1 Cluster A 20210618010100 invalid Jimi2 Cluster B 20210619010100 efficient Jimi2 Cluster B 20210618010100 invalid
[0055] It should be noted that each server cluster uses only one effective version of the service program, and the remaining versions are in a state of waiting to take effect. There can be multiple versions in a state of waiting to take effect, and this application does not impose any restrictions on this. For the effective version of the service program of the server cluster, when the user's client accesses the IP address of the server cluster, the server cluster will return the version number corresponding to the effective version to the client through the web (World Wide Web) homepage through the version acquisition component installed therein, so that the client can load the specific content and services of the effective version from the server cluster through the version number. Among them, the version acquisition component is an SDK (Software Development Kit) in the server cluster, and the version acquisition component SDK runs in each server host in the server cluster. The web homepage is the web page that the user's client enters for the first time when using the functions provided by the server cluster through traffic.
[0056] The following first describes the traffic configuration method of the server cluster provided by the embodiment of the present application. The traffic configuration method of the server cluster provided by the embodiment of the present application is configured to be executed in the traffic distribution configuration server.
[0057] Figure 1 A flow chart of a method for configuring traffic for a server cluster provided in an embodiment of the present application.
[0058] like Figure 1 As shown, the traffic configuration method of the server cluster may include the following steps 101-103.
[0059] Step 101 , monitoring the versions of service programs used by multiple server clusters.
[0060] The service program refers to a specific program in the server cluster that provides services for users when they access specific web pages through a browser. The version of the service program can be updated as needed. After the service program version is updated, the user can refresh the browser to experience the new version and service.
[0061] In an exemplary embodiment, the diversion configuration server can monitor whether the version of the service program used by multiple server clusters needs to be upgraded, whether it has been upgraded from an old version to a new version (in the embodiment of the present application, the old version is referred to as the first version and the new version is referred to as the second version), and which version of the service program in each server cluster is in effect, etc.
[0062] Step 102: configure the traffic status of the multiple server clusters according to the versions of the service programs used by the multiple server clusters.
[0063] In an exemplary embodiment, the traffic distribution configuration server can configure the traffic status of multiple server clusters according to the versions of the service programs used by the multiple server clusters. For example, when the target server cluster in the multiple server clusters needs to be upgraded, the traffic distribution configuration server can configure the target server cluster to be disabled and the remaining server clusters to be enabled.
[0064] Step 103: Synchronize the traffic status of the multiple server clusters to the domain name system DNS server, so that the domain name system DNS server distributes traffic to the multiple server clusters according to the updated traffic status.
[0065] In an exemplary embodiment, after the traffic diversion configuration server configures the traffic status of multiple server clusters, the traffic status of the multiple server clusters can be synchronized to the domain name system DNS server, so that the domain name system DNS server distributes traffic to the multiple server clusters according to the updated traffic status.
[0066] For example, assuming that the traffic status of multiple server clusters configured by the diversion configuration server is: the target server cluster that needs to be upgraded is in a disabled state, and the remaining server clusters in the multiple server clusters are in an enabled state, then after synchronizing the traffic status to the DNS server, the DNS server can distribute the traffic to the remaining server clusters according to the updated traffic status, that is, when the user's client accesses a certain URL, the DNS server will return the IP address of the remaining server clusters corresponding to the URL to the client, and will no longer return the IP address of the target server cluster corresponding to the URL, so that when the target server cluster is upgraded, only the remaining server clusters among the multiple server clusters provide services. Since the versions of the service programs in the remaining server clusters are consistent, the versions of the service programs providing services in the multiple server clusters can be guaranteed to be consistent, avoiding the situation where user-side data is confused due to the mixing of new and old versions when the service programs used by the server clusters are upgraded, and user services will not be interrupted.
[0067] The traffic configuration method of a server cluster provided in the present application monitors the versions of service programs adopted by multiple server clusters, configures the traffic status of multiple server clusters according to the versions of the service programs adopted by the multiple server clusters, and synchronizes the traffic status of multiple server clusters to a DNS server so that the DNS server distributes traffic to the multiple server clusters according to the updated traffic status. Thus, by configuring the traffic status of multiple server clusters according to the versions of the service programs adopted by the multiple server clusters, it is possible to ensure that the versions of the service programs providing services in the multiple server clusters are consistent, thereby avoiding the situation where user-side data confusion occurs due to the mixing of old and new versions when the service programs adopted by the server clusters are upgraded.
[0068] Combine the following Figure 2 , the traffic configuration method of the server cluster in the embodiment of the present application is further explained.
[0069] Figure 2 This is a flow chart of the flow configuration method of the server cluster provided in the embodiment of the present application. Figure 2 As shown, the traffic configuration method of the server cluster includes the following steps 201-205.
[0070] Step 201 , monitoring the versions of service programs used by multiple server clusters.
[0071] The specific implementation process and principle of step 201 may refer to the description of the above embodiment and will not be repeated here.
[0072] It should be noted that the diversion configuration server can continuously monitor or monitor the versions of the service programs used by the multiple server clusters at a preset time interval during the process of upgrading the service programs of the multiple server clusters until the version upgrade of the service programs used by the multiple server clusters is completed. The preset time interval can be set as needed, and the embodiment of the present application does not limit this.
[0073] Step 202, when the service program of the target server cluster among the multiple server clusters needs to be upgraded, the multiple server clusters are configured to a first flow state; wherein, in the first flow state, the target server cluster is disabled, and the remaining server clusters among the multiple server clusters are enabled.
[0074] Among them, the number of target server clusters can be one or more, and this application does not impose any restrictions on this. Among them, the number of target server clusters is related to the version upgrade method of the service program for multiple server clusters. For example, when multiple server clusters need to upgrade the service program version, it can be set to upgrade the service program version for half of the server clusters first. After the service program version of these server clusters is upgraded, the service program version of the remaining half of the server clusters is upgraded. Correspondingly, the number of target server clusters is half the number of multiple server clusters. The subsequent embodiments of this application are explained by taking multiple server clusters including server cluster A and server cluster B as an example.
[0075] In an exemplary embodiment, when the service program of a target server cluster among multiple server clusters needs to be upgraded, after the diversion server configures the multiple server clusters to a first traffic state, the first traffic state can be synchronized to the DNS server so that the DNS server distributes traffic to the multiple server clusters according to the updated traffic state.
[0076] refer to Figure 3 The normal traffic distribution diagram of server cluster A and server cluster B shown in the figure shows that before server cluster A and server cluster B upgrade the service program, server cluster A and server cluster B are both in the enabled state. In this traffic state, the DNS server will distribute the traffic to server cluster A and server cluster B. When the client where the user is located accesses a web page through a browser, the URL can be queried for the server cluster IP address (step 301). The DNS server can poll and return the IP address of server cluster A or server cluster B to the client, so that the client can access the corresponding server cluster A or corresponding server cluster B through the browser (step 302). Taking the example that the DNS server returns the IP address of server cluster A to the client, the version acquisition component SDK in server cluster A can read the version number corresponding to the effective version of server cluster A (step 303), and respond to the homepage of the specified version (the effective version of the service program of server cluster A) (step 304), which contains the version number corresponding to the effective version of the service program of server cluster A, and then the client can automatically load the content and function of the effective version in server cluster A through the version number in the homepage (step 305).
[0077] Assuming that server cluster B is the target server cluster that needs to be upgraded, when the traffic diversion configuration server determines that the service program of server cluster B needs to be upgraded, the traffic diversion configuration server can configure server cluster A and server cluster B to the first traffic state. In the first traffic state, the target server cluster, i.e., server cluster B, is disabled, and the remaining server cluster, i.e., server cluster A, is enabled. In addition, the traffic diversion configuration server can synchronize the traffic states of server cluster A and server cluster B to the DNS server, so that the DNS server distributes the traffic to server cluster A.
[0078] refer to Figure 4The traffic distribution diagram of server cluster A and server cluster B in the first traffic state is shown, at this time, server cluster A is enabled and server cluster B is disabled. In the first traffic state, the DNS server will distribute the traffic to server cluster A. When the client where the user is located accesses a web page through a browser, the URL can be queried for the server cluster IP address (step 401). The DNS server can return the IP address of server cluster A to the client, so that the client can access the corresponding server cluster A through the browser (step 402). The version acquisition component SDK in server cluster A can read the version number corresponding to the effective version of server cluster A (step 403), and respond to the homepage of the specified version (the effective version of the service program of server cluster A) (step 404), which contains the version number corresponding to the effective version of the service program of server cluster A, and then the client can automatically load the content and functions of the effective version in server cluster A through the version number in the homepage (step 405).
[0079] It should be noted that the SDK in each traffic distribution diagram of the embodiment of the present application is a version acquisition component SDK in the server cluster, and the version acquisition component SDK runs in each server host in the server cluster.
[0080] Step 203, when the service program of the target server cluster in a disabled state among multiple server clusters is upgraded from the first version to the second version, and the effective version of the service program is the first version, configure the multiple server clusters to switch from the first traffic state to the second traffic state; wherein, in the second traffic state, the target server cluster is in an enabled state, and the remaining server clusters are in a disabled state.
[0081] In an exemplary embodiment, when multiple server clusters are in the first traffic state, the target server cluster in a disabled state can upgrade the version of the service program from the first version to the second version, and the target server cluster can switch the first version to a valid state according to the configuration of the diversion configuration server for the effective version of the target server cluster.
[0082] refer to Figure 5 The flow distribution diagram of server cluster A and server cluster B in the first flow state is shown, at this time, server cluster A is enabled and server cluster B is disabled. In the first flow state, the process when a client accesses a web page through a browser (steps 501-505) is similar to Figure 4The process shown (steps 401-405) is similar and will not be repeated here. When server cluster A and server cluster B are in the first flow state, server cluster B can upgrade the version of the service program. After the service program of server cluster B is upgraded from the first version corresponding to version number "20210619010100" to the second version corresponding to version number "20210620010100", the first version corresponding to version number "20210619010100" before the upgrade can be switched to a valid state according to the configuration of the effective version of server cluster B by the diversion configuration server.
[0083] When the service program of a target server cluster in a disabled state among multiple server clusters is upgraded from the first version to the second version, and the effective version of the service program is the first version, the diversion configuration server can configure multiple server clusters to switch from the first flow state to the second flow state. In the second flow state, the target server cluster is enabled, and the remaining server clusters are disabled. In addition, the diversion configuration server can synchronize the second flow state to the DNS server so that the DNS server distributes flow to multiple server clusters according to the updated flow state.
[0084] refer to Figure 6 The traffic distribution diagram of server cluster A and server cluster B in the second traffic state is shown, at this time, server cluster A is disabled and server cluster B is enabled. In the second traffic state, the DNS server will distribute the traffic to server cluster B. When the client where the user is located accesses a web page through a browser, the URL can be queried for the server cluster IP address (step 601). The DNS server can return the IP address of server cluster B to the client, so that the client can access the corresponding server cluster B through the browser (step 602). The version acquisition component SDK in server cluster B can read the version number corresponding to the effective version of server cluster B (step 603), and respond to the homepage of the specified version (the effective version of the service program of server cluster B) (step 604). The homepage contains the version number corresponding to the effective version of the service program of server cluster B, and then the client can automatically load the content and functions of the effective version in server cluster B through the version number in the homepage (step 605).
[0085] Through the above analysis, it can be known that after the service program of the target server cluster is upgraded from the first version to the second version, the effective version of the service program can be switched to the first version according to the configuration of the effective version of the target server cluster by the diversion configuration server. Accordingly, before configuring multiple server clusters to switch from the first flow state to the second flow state, the diversion configuration server can also include the following steps:
[0086] Configure the effective version of the service program in the target server cluster to be the first version;
[0087] The first version configuration message is sent to the target server cluster, so that the target server switches the effective version of the service program according to the first version configuration message.
[0088] The first version configuration message is used to indicate that the effective version of the service program in the target server cluster is the first version.
[0089] Step 204, when the effective version of the service program in the target server cluster is switched from the first version to the second version, and the service programs in the remaining server clusters are upgraded from the first version to the second version and the effective version of the service programs in the remaining server clusters is the second version, configure multiple server clusters to switch from the second traffic state to the third traffic state; wherein, in the third traffic state, the target server cluster and the remaining server clusters are in an enabled state.
[0090] In an exemplary embodiment, when multiple server clusters are in the second traffic state, the target server cluster in the enabled state can switch the effective version of the service program of the target server cluster from the first version to the second version according to the configuration of the effective version of the target server cluster by the diversion configuration server, and the remaining server clusters in the disabled state can upgrade the version of the service program from the first version to the second version, and the remaining server clusters can switch the second version to the effective state according to the configuration of the effective version of the remaining server clusters by the diversion configuration server. The switching process of the effective version of the service program of the target server cluster and the version upgrade process and the switching process of the effective version of the service program of the remaining servers can be executed simultaneously or at different times, and this application does not impose any restrictions on this.
[0091] refer to Figure 7 The flow distribution diagram of server cluster A and server cluster B in the second flow state is shown, at this time, server cluster A is disabled and server cluster B is enabled. In the second flow state, the process when a client accesses a web page through a browser (steps 701-705) is similar to Figure 6 The process shown (steps 601-605) is similar and will not be repeated here. When server cluster A and server cluster B are in the second flow state, server cluster B can switch the effective version of the service program of server cluster B from the first version corresponding to version number "20210619010100" to the second version corresponding to version number "20210620010100" according to the configuration of the effective version of server cluster B by the diversion configuration server.
[0092] And, reference Figure 8The traffic distribution diagram of server cluster A and server cluster B shown in the second traffic state. Under the second traffic state, server cluster A can upgrade the version of the service program. After the service program of server cluster A is upgraded from the first version corresponding to version number "20210619010100" to the second version corresponding to version number "20210620010100", the second version corresponding to version number "20210620010100" can be switched to a valid state according to the configuration of the effective version of server cluster A by the diversion configuration server.
[0093] When the effective version of the service program in the target server cluster is switched from the first version to the second version, and the service program in the remaining server clusters is upgraded from the first version to the second version and the effective version of the service program in the remaining server clusters is the second version, the diversion configuration server can configure multiple server clusters to switch from the second flow state to the third flow state; wherein the target server cluster and the remaining server clusters are enabled in the third flow state. In addition, the diversion configuration server can synchronize the third flow state to the DNS server so that the DNS server distributes flow to multiple server clusters according to the updated flow state.
[0094] refer to Fig. 9 The flow distribution diagram of server cluster A and server cluster B in the third flow state is shown in FIG. 1 , where server cluster A and server cluster B are both enabled. In the third flow state, the DNS server distributes the flow to server cluster A and server cluster B. At this time, the process (steps 901-905) when the client accesses a web page through a browser is the same as Figure 3 The process shown (steps 301-305) is similar and will not be repeated here.
[0095] Combination Figure 3-Figure 9It can be seen from the traffic distribution diagrams of server cluster A and server cluster B in the first traffic state, the second traffic state and the third traffic state that when server cluster A and server cluster B are in the first traffic state, only the first version of the service program of server cluster A in server cluster A and server cluster B provides services; when server cluster A and server cluster B are in the second traffic state, and the effective version of the service program of server cluster B is the first version, only the first version of the service program of server cluster B in server cluster A and server cluster B provides services; when server cluster A and server cluster B are in the second traffic state, and the effective version of the service program of server cluster B is the second version, only the second version of the service program of server cluster B in server cluster A and server cluster B provides services; when server cluster A and server cluster B are in the third traffic state, the second version of the service program of server cluster A and the second version of the service program of server cluster B provide services. That is to say, the traffic configuration method of the server cluster provided in the embodiment of the present application can ensure that the versions of the service programs providing services in multiple server clusters are consistent, thereby avoiding the situation where the user-side data is confused due to the mixing of new and old versions when the service program adopted by the server cluster is upgraded.
[0096] Through the above analysis, it can be known that the target server cluster can switch the effective version of the service program from the first version to the second version according to the configuration of the effective version of the target server cluster by the diversion configuration server. Accordingly, in an exemplary embodiment, before configuring multiple server clusters to switch from the second traffic state to the third traffic state, the diversion configuration server can also include the following steps:
[0097] Configuring the effective version of the service program in the target server cluster to be the second version;
[0098] The second version configuration message is sent to the target server cluster, so that the target server switches the effective version of the service program according to the second version configuration message.
[0099] The second version configuration message is used to indicate that the effective version of the service program in the target server cluster is the second version.
[0100] In addition, the remaining server clusters need to switch the effective version of the service program to the second version according to the configuration of the effective version of the remaining server clusters by the diversion configuration server. Accordingly, before configuring multiple server clusters to switch from the second flow state to the third flow state, the diversion configuration server may also include the following steps:
[0101] Configure the effective version of the service program in the remaining server clusters to be the second version;
[0102] The third version configuration message is sent to the remaining server clusters, so that the remaining servers switch the effective version of the service program according to the third version configuration message.
[0103] The third version configuration message is used to indicate that the effective version of the service program in the remaining server clusters is the second version.
[0104] The effective version of the service program in the target server cluster and the effective version of the service program in the remaining server clusters are configured by the diversion configuration server, and a version configuration message is sent to the target server cluster or the remaining server clusters, so that each server cluster can switch the effective version of the service program according to the version configuration message sent by the diversion configuration server.
[0105] Step 205: Synchronize the traffic status of the multiple server clusters to the Domain Name System DNS server, so that the Domain Name System DNS server distributes traffic to the multiple server clusters according to the updated traffic status.
[0106] In an exemplary embodiment, each time the diversion configuration server configures the traffic status of multiple server clusters, the traffic status of the multiple server clusters can be synchronized to the DNS server. For example, after configuring multiple server clusters to a first traffic state, the first traffic state can be synchronized to the DNS server so that the DNS server distributes the traffic to the remaining server clusters according to the updated first traffic state. After configuring multiple server clusters to a second traffic state, the second traffic state can be synchronized to the DNS server so that the DNS server distributes the traffic to the target server cluster according to the updated second traffic state. After configuring multiple server clusters to a third traffic state, the third traffic state can be synchronized to the DNS server so that the DNS server distributes the traffic to the target server cluster and the remaining server clusters according to the updated third traffic state.
[0107] It should be noted that due to the hierarchical and regional cache of the DNS server, after the diversion configuration server synchronizes the traffic status of multiple server clusters to the DNS server, the DNS server may be delayed in distributing the traffic to the multiple server clusters, that is, it may take a period of delay for the traffic of the multiple server clusters to reach the traffic status synchronized by the diversion configuration server. When the traffic of the multiple server clusters reaches the traffic status synchronized by the diversion configuration server, the synchronization of the traffic status of the multiple server clusters is considered to be successful. In the embodiment of the present application, after synchronizing the traffic status of the multiple server clusters to the DNS server, the diversion configuration server can also determine whether the synchronization of the traffic status of the multiple server clusters is successful. That is, after step 205, the following steps can also be included:
[0108] Get the traffic monitored in multiple server clusters respectively;
[0109] According to the traffic of each server cluster, it is determined whether the traffic status synchronization of multiple server clusters is successful.
[0110] In an exemplary embodiment, each server cluster can monitor the traffic of the server cluster through the version acquisition component SDK installed therein, and feed back the monitored traffic of the server cluster to the diversion configuration server, so that the diversion configuration server can obtain the monitored traffic in multiple server clusters, and then determine whether the traffic status synchronization of multiple server clusters is successful based on the traffic of each server cluster.
[0111] For example, after the diversion configuration server synchronizes the first flow state to the DNS server, the flow monitored in multiple server clusters can be obtained. When the diversion configuration server determines that the flow of the target server cluster is 0 and the flow of the remaining server clusters is not 0, it can be determined that the first flow state synchronization is successful; after the diversion configuration server synchronizes the second flow state to the DNS server, the flow monitored in multiple server clusters can be obtained. When the diversion configuration server determines that the flow of the target server cluster is not 0 and the flow of the remaining server clusters is 0, it can be determined that the second flow state synchronization is successful; after the diversion configuration server synchronizes the third flow state to the DNS server, the flow monitored in multiple server clusters can be obtained. When the diversion configuration server determines that the flow of the target server cluster is not 0 and the flow of the remaining server clusters is not 0, it can be determined that the third flow state synchronization is successful.
[0112] In addition, in a possible implementation form of the present application, the diversion configuration server can determine, based on monitoring the versions of the service programs adopted by multiple server clusters, that the service program of the target server cluster among multiple server clusters has been upgraded from the first version to the second version and the effective version of the target server cluster is the first version, or determine that the effective version of the service program in the target server cluster is switched from the first version to the second version, the service programs in the remaining server clusters are upgraded from the first version to the second version, and the effective version of the service programs in the remaining server clusters is the second version.
[0113] Accordingly, step 201 may specifically include:
[0114] Receiving version upgrade messages fed back by multiple server clusters, wherein the version upgrade messages are used to indicate that the server cluster has upgraded the service program from the first version to the second version;
[0115] And / or, receiving version validation messages fed back by multiple server clusters, wherein the version validation messages are used to indicate the valid versions of the service programs of the server clusters.
[0116] By receiving version upgrade messages and / or version effectiveness messages fed back by multiple server clusters, the diversion configuration server can determine the version upgrade status and effective version status of the service programs in the multiple server clusters and other version-related information of the service programs, so that the traffic status of the multiple server clusters can be configured according to the version-related information of the service programs adopted by the multiple server clusters.
[0117] In summary, the traffic configuration method of the server cluster provided in this application can ensure that the versions of the service programs providing services in multiple server clusters are consistent, thereby avoiding the situation where user-side data confusion occurs due to the mixing of old and new versions when the service programs used by the server cluster are upgraded.
[0118] The following is an explanation of the traffic distribution method of the server cluster provided by the embodiment of the present application. The traffic distribution method of the server cluster provided by the embodiment of the present application is configured to be executed in the DNS server.
[0119] Fig.10 A flow chart of a method for distributing traffic to a server cluster provided in an embodiment of the present application.
[0120] like Fig.10 As shown, the traffic distribution method of the server cluster may include the following steps 1001-1002.
[0121] Step 1001: Receive the traffic status synchronized by the traffic diversion configuration server.
[0122] Among them, the traffic state synchronized by the diversion configuration server is obtained by configuring the traffic configuration method of the server cluster in the above-mentioned first aspect embodiment.
[0123] Step 1002, distribute traffic to multiple server clusters according to traffic status.
[0124] In an exemplary embodiment, the diversion configuration server can adopt the traffic configuration method of the server cluster described in the above embodiment to configure the traffic status of multiple server clusters, and synchronize the traffic status of multiple server clusters to the DNS server, so that the DNS server can receive the traffic status synchronized by the diversion configuration server, and then distribute traffic to multiple server clusters according to the traffic status.
[0125] In an exemplary embodiment, when the traffic state synchronized by the diversion configuration server is a first traffic state (the target server cluster among multiple server clusters is in a disabled state, and the remaining server clusters are in an enabled state), the DNS server can distribute traffic to the remaining server clusters that are in an enabled state; when the traffic state synchronized by the diversion configuration server is a second traffic state (the target server cluster among multiple server clusters is in an enabled state, and the remaining server clusters are in a disabled state), the DNS server can distribute traffic to the target server cluster that is in an enabled state; when the traffic state synchronized by the diversion configuration server is a third traffic state (the target server cluster and the remaining server clusters among multiple server clusters are in an enabled state), the DNS server can distribute traffic to the target server cluster that is in an enabled state and the remaining server clusters.
[0126] The traffic distribution method for a server cluster provided in an embodiment of the present application receives the traffic status synchronized by the traffic configuration method of the first embodiment of the diversion configuration server, and distributes traffic to multiple server clusters according to the traffic status, thereby realizing traffic distribution to multiple server clusters according to the traffic status synchronized by the diversion configuration server.
[0127] The following is a description of the service program upgrade method of the server cluster provided in an embodiment of the present application.
[0128] Fig.11 The flowchart of the service program upgrade method of the server cluster provided by the embodiment of the present application is shown in FIG.
[0129] like Fig.11 As shown, the service program upgrade method of the server cluster provided in the embodiment of the present application includes the following steps 1101-1102.
[0130] It should be noted that the server cluster in the embodiment of the present disclosure may be any server cluster among the multiple server clusters in the aforementioned embodiments.
[0131] Step 1101 , monitor the traffic allocated by the DNS server to determine the status of the server cluster.
[0132] Among them, the traffic is allocated by the DNS server according to the traffic status synchronized by the traffic configuration method of the server cluster of the first embodiment adopted by the diversion configuration server.
[0133] The status of the server cluster indicates whether the server cluster is enabled, and the status of the server cluster may include an enabled state and a disabled state.
[0134] In an exemplary embodiment, the traffic distribution configuration server can use the traffic configuration method of the server cluster described in the above embodiment to configure the traffic status of multiple server clusters, and synchronize the traffic status of multiple server clusters to the DNS server, so that the DNS server can receive the traffic status synchronized by the traffic distribution configuration server, and then distribute traffic to multiple server clusters according to the traffic status. Each server cluster in the multiple server clusters can monitor the traffic distributed by the DNS server to determine the status of the server cluster.
[0135] In an exemplary embodiment, for each server cluster, a version acquisition component SDK is installed in the server cluster, and the server cluster can monitor the traffic of the server cluster through the version acquisition component SDK installed therein, and then determine the state of the server cluster according to the traffic of the server cluster. When the traffic of the server cluster is 0, the server cluster can be determined to be in a disabled state; when the traffic of the server cluster is not 0, the server cluster can be determined to be in an enabled state.
[0136] Step 1102: Upgrade the version of the service program according to the status of the server cluster.
[0137] In an exemplary embodiment, when the server cluster is in a disabled state, the service program version can be upgraded, such as from a first version to a second version, and when the server cluster is in an enabled state, the service program version is not upgraded.
[0138] Taking the server cluster in the embodiment of the present application as any one of the target server clusters in the multiple server clusters in the above embodiments as an example, when the multiple server clusters are in the first traffic state, that is, the target server cluster is in a disabled state, the target server cluster can upgrade the service program from the first version to the second version.
[0139] Taking the server cluster in the embodiment of the present application as any one of the remaining server clusters in the multiple server clusters in the above embodiments as an example, when the multiple server clusters are in the second traffic state, that is, the remaining server clusters are in a disabled state, the remaining server clusters can upgrade the service program from the first version to the second version.
[0140] By upgrading the service program version according to the status through the server cluster, the service program version can be upgraded only when the service program of the server cluster is not providing services, thereby ensuring that the versions of the service programs providing services in multiple server clusters are consistent, thereby avoiding the situation where user-side data is confused due to mixing old and new versions when the service program used by the server cluster is upgraded.
[0141] In summary, the service program upgrade method of the server cluster provided in the embodiment of the present application monitors the traffic allocated by the DNS server to determine the status of the server cluster, and upgrades the version of the service program according to the status of the server cluster, thereby realizing the version upgrade of the service program of the server cluster and avoiding the situation where user-side data is confused due to the mixing of old and new versions when the service program used by the server cluster is upgraded.
[0142] Combine the following Fig.12 , the service program upgrade method of the server cluster provided by the embodiment of the present application is further described. Among them, the service program upgrade method of the server cluster provided by the embodiment of the present application is configured to be executed in the server cluster.
[0143] Fig.12 A flow chart of a service program upgrade method for a server cluster provided in an embodiment of the present application.
[0144] like Fig.12 As shown, the service program upgrade method of the server cluster may include the following steps 1201-1203.
[0145] Step 1201, monitor the traffic allocated by the DNS server to determine the status of the server cluster.
[0146] Among them, the traffic is allocated by the DNS server according to the traffic status synchronized by the traffic configuration method of the server cluster of the first embodiment adopted by the diversion configuration server.
[0147] Step 1202: when the server cluster is in a disabled state, upgrade the service program used by the server cluster from a first version to a second version.
[0148] Among them, the specific implementation process and principles of steps 1201-1202 can refer to the description of the above embodiment and will not be repeated here.
[0149] Step 1203: Feedback a version upgrade message to the offload configuration server, wherein the version upgrade message is used to indicate that the server cluster has upgraded the service program from the first version to the second version.
[0150] In an exemplary embodiment, after the server cluster upgrades the service program from the first version to the second version, it can feedback a version upgrade message to the diversion configuration server, so that the diversion configuration server can determine that the server cluster has upgraded the service program from the first version to the second version based on the version upgrade message feedback by the server cluster.
[0151] It is understandable that after the service program of the server cluster is upgraded from the first version to the second version, the effective version of the service program can be either the first version or the second version. In an exemplary embodiment, the server cluster can switch the first version to the effective version or the second version to the effective version according to the configuration of the effective version of the service program of the server cluster by the diversion configuration server. Accordingly, after step 1202, the following may also be included:
[0152] Receive the version configuration message sent by the offload configuration server;
[0153] The effective version of the service program is switched according to the version configuration message.
[0154] The version configuration message is used to indicate the specific effective version of the service program in the server cluster.
[0155] Specifically, the offload configuration server can configure the effective version of the service program in the server cluster as needed, and send a version configuration message to the server cluster. Correspondingly, the server cluster can receive the version configuration message sent by the offload configuration server, and then switch the effective version of the service program according to the version configuration message.
[0156] Furthermore, after the server cluster switches the effective version of the service program according to the configuration of the effective version of the service program of the server cluster by the offload configuration server, it can also send a version effectiveness message to the offload configuration server, so that the offload configuration server determines the effective version of the service program of the server cluster according to the version effectiveness message. The version effectiveness message is used to indicate the current effective version of the service program of the server cluster.
[0157] It is understandable that due to the hierarchical and regional cache of the DNS server, after the traffic diversion configuration server synchronizes the traffic status of multiple server clusters to the DNS server, the DNS server may be delayed in allocating traffic to the multiple server clusters, that is, it may take a period of delay for the traffic of the multiple server clusters to reach the traffic status synchronized by the diversion configuration server. In the embodiment of the present application, the diversion configuration server can determine whether the synchronization of the traffic status of the server cluster is successful.
[0158] In an exemplary embodiment, the server cluster may feed back the monitored traffic allocated by the DNS server to the diversion configuration server, so that the diversion configuration server determines whether the traffic state synchronization of the server cluster is successful based on the monitored traffic. That is, after monitoring the traffic allocated by the DNS server in step 1201, it may also include: feeding back the traffic to the diversion configuration server, so that the diversion configuration server determines whether the traffic state synchronization of the server cluster is successful based on the traffic.
[0159] The service program upgrade method of the server cluster provided in the embodiment of the present application monitors the traffic allocated by the DNS server to determine the status of the server cluster, and when the status of the server cluster is disabled, upgrades the service program used by the server cluster from the first version to the second version, and feeds back a version upgrade message to the diversion configuration server, wherein the version upgrade message is used to indicate that the server cluster has upgraded the service program from the first version to the second version. Thus, the version upgrade of the service program of the server cluster is realized, and the situation of user-side data confusion caused by the mixing of new and old versions when the service program used by the server cluster is upgraded is avoided.
[0160] Fig.13 A schematic diagram of the structure of the diversion configuration server provided in an embodiment of the present application.
[0161] like Fig.13 As shown, the offload configuration server 1300 may include: a monitoring module 1310 , a configuration module 1320 and a synchronization module 1330 .
[0162] The monitoring module 1310 is used to monitor the versions of service programs used by multiple server clusters;
[0163] A configuration module 1320, configured to configure the traffic status of the plurality of server clusters according to the versions of the service programs used by the plurality of server clusters;
[0164] The synchronization module 1330 is used to synchronize the traffic status of the multiple server clusters to the domain name system DNS server, so that the domain name system DNS server distributes the traffic to the multiple server clusters according to the updated traffic status.
[0165] Furthermore, in a possible implementation of the embodiment of the present application, the configuration module 1320 includes:
[0166] A first configuration unit is used to configure the multiple server clusters to a first flow state when a service program of a target server cluster among the multiple server clusters needs to be upgraded; wherein, in the first flow state, the target server cluster is in a disabled state, and the remaining server clusters among the multiple server clusters are in an enabled state;
[0167] A second configuration unit is used to configure the multiple server clusters to switch from the first flow state to the second flow state when the service program of the target server cluster in the disabled state among the multiple server clusters is upgraded from the first version to the second version and the effective version of the service program is the first version; wherein, in the second flow state, the target server cluster is in the enabled state and the other server clusters are in the disabled state;
[0168] The third configuration unit is used to configure multiple server clusters to switch from the second traffic state to the third traffic state when the effective version of the service program in the target server cluster is switched from the first version to the second version, and the service programs in the remaining server clusters are upgraded from the first version to the second version and the effective version of the service programs in the remaining server clusters is the second version; wherein, in the third traffic state, the target server cluster and the remaining server clusters are in an enabled state.
[0169] Furthermore, in a possible implementation of the embodiment of the present application, the configuration module 1320 further includes:
[0170] A fourth configuration unit, configured to configure the effective version of the service program in the target server cluster to be the first version;
[0171] The first sending unit is used to send a first version configuration message to the target server cluster, so that the target server switches the effective version of the service program according to the first version configuration message.
[0172] Furthermore, in a possible implementation of the embodiment of the present application, the configuration module 1320 further includes:
[0173] A fifth configuration unit, used to configure the effective version of the service program in the target server cluster to be the second version;
[0174] The second sending unit is used to send a second version configuration message to the target server cluster, so that the target server switches the effective version of the service program according to the second version configuration message.
[0175] Furthermore, in a possible implementation of the embodiment of the present application, the configuration module 1320 further includes:
[0176] A sixth configuration unit, used to configure the effective version of the service program in the remaining server clusters to be the second version;
[0177] The third sending unit is used to send a third version configuration message to the remaining server clusters, so that the remaining servers switch the effective version of the service program according to the third version configuration message.
[0178] Furthermore, in a possible implementation of the embodiment of the present application, the monitoring module 1310 includes:
[0179] A receiving unit, configured to receive version upgrade messages fed back by multiple server clusters, wherein the version upgrade messages are used to indicate that the server cluster has upgraded the service program from the first version to the second version;
[0180] And / or, receiving version validation messages fed back by multiple server clusters, wherein the version validation messages are used to indicate the valid versions of the service programs of the server clusters.
[0181] Furthermore, in a possible implementation of the embodiment of the present application, the offload configuration server may further include:
[0182] An acquisition module, used to respectively acquire traffic monitored in multiple server clusters;
[0183] The determination module is used to determine whether the flow state synchronization of multiple server clusters is successful according to the flow of each server cluster.
[0184] It should be noted that the explanations in the aforementioned embodiment of the traffic configuration method for a server cluster executed by the diversion configuration server side are also applicable to the diversion configuration server of this embodiment and will not be repeated here.
[0185] The diversion configuration server of the embodiment of the present application can ensure that the versions of the service programs providing services in the multiple server clusters are consistent by configuring the traffic status of the multiple server clusters according to the versions of the service programs adopted by the multiple server clusters, thereby avoiding the situation where user-side data is confused due to the mixing of old and new versions when the service programs adopted by the server clusters are upgraded.
[0186] In order to implement the above embodiment, the embodiment of the present application also provides a DNS server. Fig.14 A schematic diagram of the structure of the DNS server provided in an embodiment of the present application.
[0187] like Fig.14 As shown, the DNS server 1400 may include: a receiving module 1410 and an allocating module 1420 .
[0188] The receiving module 1410 is used to receive the traffic state synchronized by the traffic configuration method of the first embodiment adopted by the traffic distribution configuration server;
[0189] The allocation module 1420 is used to allocate traffic to multiple server clusters according to traffic status.
[0190] It should be noted that the explanations in the aforementioned embodiment of the traffic configuration method for the server cluster executed on the DNS server side are also applicable to the DNS server of this embodiment and will not be repeated here.
[0191] The DNS server of the embodiment of the present application receives the traffic status synchronized by the traffic configuration method of the first embodiment of the diversion configuration server, and distributes traffic to multiple server clusters according to the traffic status, thereby realizing traffic distribution to multiple server clusters according to the traffic status synchronized by the diversion configuration server.
[0192] In order to implement the above embodiment, the embodiment of the present application also provides a server cluster. Fig.15 A schematic diagram of the structure of a server cluster provided in an embodiment of the present application.
[0193] like Fig.15 As shown, the server cluster 1500 may include: a monitoring module 1510 and an upgrading module 1520 .
[0194] The monitoring module 1510 is used to monitor the traffic allocated by the DNS server to determine the state of the server cluster; wherein the traffic is allocated by the DNS server according to the traffic state synchronized by the traffic configuration method of the first embodiment of the diversion configuration server;
[0195] The upgrade module 1520 is used to upgrade the version of the service program according to the status of the server cluster.
[0196] Furthermore, in a possible implementation of the embodiment of the present application, the upgrade module 1520 includes:
[0197] The upgrading unit is used to upgrade the service program used by the server cluster from the first version to the second version when the server cluster is in a disabled state.
[0198] Furthermore, in a possible implementation of the embodiment of the present application, the upgrade module 1520 further includes:
[0199] The first sending unit is used to feed back a version upgrade message to the offload configuration server, wherein the version upgrade message is used to indicate that the server cluster has upgraded the service program from the first version to the second version.
[0200] Furthermore, in a possible implementation of the embodiment of the present application, the upgrade module 1520 further includes:
[0201] A receiving unit, configured to receive a version configuration message sent by a traffic distribution configuration server;
[0202] The switching unit is used to switch the effective version of the service program according to the version configuration message.
[0203] Furthermore, in a possible implementation of the embodiment of the present application, the upgrade module further includes:
[0204] The second sending unit is used to send a version validation message to the offload configuration server, so that the offload configuration server determines the valid version of the service program of the server cluster according to the version validation message.
[0205] Furthermore, in a possible implementation of the embodiment of the present application, the server cluster 1500 may further include:
[0206] The sending module is used to feed back the traffic to the diversion configuration server, so that the diversion configuration server determines whether the traffic state synchronization of the server cluster is successful based on the traffic.
[0207] It should be noted that the explanations in the aforementioned embodiment of the traffic configuration method for the server cluster executed by the server cluster side are also applicable to the server cluster of this embodiment and will not be repeated here.
[0208] The server cluster of the embodiment of the present application monitors the traffic allocated by the DNS server to determine the status of the server cluster, and upgrades the version of the service program according to the status of the server cluster, thereby realizing the version upgrade of the service program of the server cluster and avoiding the situation where user-side data is confused due to the mixing of old and new versions when the service program used by the server cluster is upgraded.
[0209] In order to implement the above embodiment, the present application also proposes a traffic configuration system for a server cluster, including multiple server clusters, a traffic distribution configuration server and a DNS server.
[0210] Wherein, the server cluster is used to execute the service program upgrade method of the aforementioned embodiment;
[0211] A traffic distribution configuration server, used to execute the traffic configuration method of the aforementioned embodiment to configure the traffic status of multiple server clusters;
[0212] The DNS server is used to execute the traffic distribution method of the aforementioned embodiment to distribute traffic to multiple server clusters.
[0213] It should be noted that the description of the server cluster, diversion configuration server and DNS server in the above embodiments is also applicable to the server cluster, diversion configuration server and DNS server in the traffic configuration system of the server cluster in the embodiment of the present application, and will not be repeated here.
[0214] Furthermore, in a possible implementation of the embodiment of the present application, the traffic configuration system of the server cluster may further include a client, wherein the client is used to access the client of the corresponding server cluster according to the traffic allocated by the DNS server.
[0215] Furthermore, after the service program in the server cluster is upgraded from the first version to the second version, in order to avoid the upgraded version being unavailable, thereby causing the server cluster that has upgraded the service program version to be unable to provide services, in a possible implementation method of an embodiment of the present application, the availability of the service program version in the server cluster can also be verified.
[0216] In a possible implementation of the embodiment of the present application, the client can verify through the intranet whether the versions of the service programs used by the multiple server clusters are available. That is, the client can also be used to: verify whether the versions of the service programs used by the multiple server clusters are available.
[0217] Specifically, for a server cluster whose service program version availability needs to be verified, the version to be verified in the service program in the server cluster can be switched to a valid state. When the client accesses a specific URL, the IP address of the server cluster corresponding to the URL can be obtained through IP local mapping. When the client can load the specific content and services of the version to be verified from the server cluster, it can be determined that the version to be verified used by the server cluster is available.
[0218] It should be noted that the verification process of the availability of the service program version used by each server cluster is performed when each server cluster is in a disabled state.
[0219] The traffic configuration system of the server cluster provided in the embodiment of the present application monitors the versions of service programs adopted by multiple server clusters through a diversion configuration server, configures the traffic status of multiple server clusters according to the versions of the service programs adopted by the multiple server clusters, and synchronizes the traffic status of the multiple server clusters to the DNS server. The DNS server configures the traffic of the multiple server clusters according to the traffic status synchronized by the diversion configuration server. Each server cluster monitors the traffic allocated by the DNS server to determine the status of the server cluster, and then upgrades the version of the service program according to the status of the server cluster. This can ensure that the versions of the service programs providing services in multiple server clusters are consistent, thereby avoiding the situation where user-side data is confused due to the mixing of old and new versions when the service programs adopted by the server clusters are upgraded.
[0220] In order to implement the above-mentioned embodiments, the present application also proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the traffic configuration method of the server cluster, the traffic distribution method of the server cluster, or the service program upgrade method of the server cluster proposed in any of the aforementioned embodiments of the present application.
[0221] In order to implement the above embodiments, the present application also proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute a traffic configuration method for a server cluster, a traffic distribution method for a server cluster, or a service program upgrade method for a server cluster as proposed in any of the aforementioned embodiments of the present application.
[0222] In order to implement the above embodiments, the present application also proposes a computer program product, including a computer program, which, when executed by a processor, implements the traffic configuration method of a server cluster, the traffic distribution method of a server cluster, or the service program upgrade method of a server cluster proposed in any of the aforementioned embodiments of the present application.
[0223] Fig.16 A block diagram of an exemplary electronic device suitable for implementing the embodiments of the present application is shown. Fig.16 The electronic device 1600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application. The electronic device may be a traffic distribution configuration server, a DNS server or a server cluster.
[0224] like Fig.16 As shown, the electronic device 1600 is in the form of a general purpose computing device. The components of the electronic device 1600 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 connecting different system components (including the system memory 28 and the processing unit 16).
[0225] The bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnection (PCI) bus.
[0226] The electronic device 1600 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 1600, including volatile and non-volatile media, removable and non-removable media.
[0227] The memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 1600 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Fig.16 not shown, usually called a "hard drive"). Although Fig.16 Not shown, a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a compact disc read only memory (CD-ROM), a digital versatile disc read only memory (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present application.
[0228] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0229] The electronic device 1600 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), one or more devices that enable a user to interact with the electronic device 1600, and / or any device that enables the electronic device 1600 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed through an input / output (I / O) interface 22. Furthermore, the electronic device 1600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 1600 through a bus 18. It should be understood that although Fig.16 Not shown, other hardware and / or software modules may be used in conjunction with electronic device 1600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0230] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the methods mentioned in the above embodiments.
[0231] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0232] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0233] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0234] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0235] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0236] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0237] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0238] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A traffic configuration method for a server cluster, It is characterized in that Applicable to the offload configuration server, including: Monitor the versions of service programs used by multiple server clusters; According to the versions of the service programs used by the multiple server clusters, configuring the traffic states of the multiple server clusters, wherein the traffic states of the multiple server clusters include a first traffic state, a second traffic state, and a third traffic state; In the first traffic state, the target server cluster is in a disabled state, and the remaining server clusters in the multiple server clusters are in an enabled state; In the second traffic state, the target server cluster is in an enabled state, and the remaining server clusters are in a disabled state; In the third traffic state, the target server cluster and the remaining server clusters are in an enabled state; The traffic status of the multiple server clusters is synchronized to a domain name system DNS server, so that the domain name system DNS server distributes traffic to the multiple server clusters according to the updated traffic status.
2. The method according to claim 1, It is characterized in that The configuring the traffic status of the multiple server clusters according to the versions of the service programs adopted by the multiple server clusters includes: When a service program of a target server cluster among the multiple server clusters needs to be upgraded, configuring the multiple server clusters to be in a first flow state; When a service program of a target server cluster in a disabled state among the multiple server clusters is upgraded from a first version to a second version, and the effective version of the service program is the first version, configuring the multiple server clusters to switch from the first traffic state to the second traffic state; When the effective version of the service program in the target server cluster is switched from the first version to the second version, and the service program in the remaining server clusters is upgraded from the first version to the second version and the effective version of the service program in the remaining server clusters is the second version, the multiple server clusters are configured to switch from the second traffic state to the third traffic state.
3. The method according to claim 2, It is characterized in that Before configuring the plurality of server clusters to switch from the first traffic state to the second traffic state, the method further includes: Configuring the effective version of the service program in the target server cluster to be the first version; A first version configuration message is sent to the target server cluster, so that the target server switches the effective version of the service program according to the first version configuration message.
4. The method according to claim 2, It is characterized in that Before configuring the plurality of server clusters to switch from the second traffic state to the third traffic state, the method further includes: Configuring the effective version of the service program in the target server cluster to be the second version; A second version configuration message is sent to the target server cluster, so that the target server switches the effective version of the service program according to the second version configuration message.
5. The method according to claim 2, It is characterized in that Before configuring the plurality of server clusters to switch from the second traffic state to the third traffic state, the method further includes: Configuring the effective version of the service program in the remaining server clusters to be the second version; The third version configuration message is sent to the remaining server clusters, so that the remaining servers switch the effective version of the service program according to the third version configuration message.
6. The method according to claim 2, It is characterized in that The monitoring of the versions of service programs used by the multiple server clusters includes: Receiving version upgrade messages fed back by the plurality of server clusters, wherein the version upgrade messages are used to indicate that the server cluster has upgraded the service program from the first version to the second version; And / or, receiving version validation messages fed back by the plurality of server clusters, wherein the version validation messages are used to indicate the valid versions of the service programs of the server clusters.
7. The method according to any one of claims 1 to 6, It is characterized in that After synchronizing the traffic states of the plurality of server clusters to a domain name system DNS server, the method further includes: Respectively obtain the traffic monitored in the multiple server clusters; According to the traffic of each of the server clusters, it is determined whether the traffic status synchronization of the multiple server clusters is successful.
8. A traffic distribution method for a server cluster, It is characterized in that Applicable to DNS servers, including: Receiving a traffic state synchronized by a traffic configuration method according to any one of claims 1 to 7 by a traffic diversion configuration server; Traffic is distributed to multiple server clusters according to the traffic status.
9. A method for upgrading a service program of a server cluster. It is characterized in that Applicable to server clusters, including: Monitor the traffic allocated by the DNS server to determine the state of the server cluster; wherein the traffic is allocated by the DNS server according to the traffic state synchronized by the traffic configuration method according to any one of claims 1 to 7 adopted by the traffic diversion configuration server; The version of the service program is upgraded according to the status of the server cluster.
10. The method according to claim 9, It is characterized in that The performing a version upgrade of the service program according to the status of the server cluster includes: When the server cluster is in a disabled state, a service program used by the server cluster is upgraded from a first version to a second version.
11. The method according to claim 10, It is characterized in that After the server program adopted by the server cluster is upgraded from the first version to the second version, the method further includes: Feedback a version upgrade message to the offload configuration server, wherein the version upgrade message is used to indicate that the server cluster has upgraded the service program from the first version to the second version.
12. The method according to claim 10, It is characterized in that After the service program adopted by the server cluster is upgraded from the first version to the second version, the method further includes: Receiving a version configuration message sent by the offload configuration server; The effective version of the service program is switched according to the version configuration message.
13. The method according to claim 12, It is characterized in that After switching the effective version of the service program according to the version configuration message, the method further includes: A version validation message is sent to the offload configuration server, so that the offload configuration server determines the valid version of the service program of the server cluster according to the version validation message.
14. The method according to any one of claims 9 to 13, It is characterized in that After monitoring the traffic allocated by the DNS server, the method further includes: The traffic is fed back to the traffic distribution configuration server, so that the traffic distribution configuration server determines whether the traffic state synchronization of the server cluster is successful according to the traffic.
15. A traffic distribution configuration server, include: A monitoring module, used to monitor the versions of service programs used by multiple server clusters; A configuration module, configured to configure the flow states of the multiple server clusters according to the versions of the service programs used by the multiple server clusters, wherein the flow states of the multiple server clusters include a first flow state, a second flow state and a third flow state; In the first traffic state, the target server cluster is in a disabled state, and the remaining server clusters in the multiple server clusters are in an enabled state; In the second traffic state, the target server cluster is in an enabled state, and the remaining server clusters are in a disabled state; In the third traffic state, the target server cluster and the remaining server clusters are in an enabled state; The synchronization module is used to synchronize the traffic status of the multiple server clusters to a domain name system DNS server, so that the domain name system DNS server distributes traffic to the multiple server clusters according to the updated traffic status.
16. A DNS server, include: A receiving module, used to receive the traffic state synchronized by the traffic configuration method according to any one of claims 1 to 7, which is adopted by the traffic configuration server; The allocation module is used to allocate traffic to multiple server clusters according to the traffic status.
17. A server cluster, include: A monitoring module, used to monitor the traffic allocated by the DNS server to determine the state of the server cluster; wherein the traffic is allocated by the DNS server according to the traffic state synchronized by the traffic configuration method according to any one of claims 1 to 7 adopted by the traffic diversion configuration server; The upgrade module is used to upgrade the version of the service program according to the status of the server cluster.
18. A traffic configuration system for a server cluster, It is characterized in that include: A plurality of server clusters for executing the service program upgrade method according to any one of claims 9 to 14; A traffic configuration server for executing the traffic configuration method according to any one of claims 1 to 7 to configure the traffic status of a plurality of server clusters; as well as A DNS server used to execute the traffic distribution method described in claim 8 to distribute traffic to multiple server clusters.
19. The flow configuration system according to claim 18, It is characterized in that Also includes: A client that accesses a corresponding server cluster according to the traffic allocated by the DNS server.
20. The flow configuration system according to claim 19, It is characterized in that The client is also used to: Verify that versions of service programs used by the plurality of server clusters are available.
21. An electronic device, It is characterized in that include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 7, or the method of claim 8, or the method of any one of claims 9 to 14.
22. A non-transitory computer-readable storage medium storing computer instructions, It is characterized in that The computer instructions are used to cause the computer to execute the method of any one of claims 1 to 7, or the method of claim 8, or the method of any one of claims 9 to 14.
