CN116915601A - Configuration updating method, system, equipment and storage medium of proxy server - Google Patents

Configuration updating method, system, equipment and storage medium of proxy server Download PDF

Info

Publication number
CN116915601A
CN116915601A CN202310915627.9A CN202310915627A CN116915601A CN 116915601 A CN116915601 A CN 116915601A CN 202310915627 A CN202310915627 A CN 202310915627A CN 116915601 A CN116915601 A CN 116915601A
Authority
CN
China
Prior art keywords
target
node
monitoring
configuration
sub
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310915627.9A
Other languages
Chinese (zh)
Inventor
赖候奇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Lexin Software Technology Co Ltd
Original Assignee
Shenzhen Lexin Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Lexin Software Technology Co Ltd filed Critical Shenzhen Lexin Software Technology Co Ltd
Priority to CN202310915627.9A priority Critical patent/CN116915601A/en
Publication of CN116915601A publication Critical patent/CN116915601A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/0816Configuration setting characterised by the conditions triggering a change of settings the condition being an adaptation, e.g. in response to network events
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Hardware Redundancy (AREA)

Abstract

The embodiment of the application discloses a method, a system, equipment and a storage medium for updating the configuration of a proxy server. The method is applied to a Redis high availability system, wherein the Redis high availability system comprises a Redis cluster, a proxy cluster, a monitoring component and a configuration center, the proxy cluster comprises at least one proxy server, and a configuration updating component is arranged in each proxy server; the method comprises the following steps: when the monitoring component monitors that a target main node in the Redis cluster is a target abnormal node, the monitoring component switches a target slave node corresponding to the target main node in the Redis cluster into a new main node, and updates main node information corresponding to the target main node in the configuration center into main node information of the new main node; each configuration updating component monitors the configuration center in real time, and updates the main node configuration of the corresponding proxy server according to the main node information in the configuration center when the main node information in the configuration center is updated. The configuration updating efficiency of the proxy server can be improved through the embodiment.

Description

Configuration updating method, system, equipment and storage medium of proxy server
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method, a system, an apparatus, and a storage medium for updating a configuration of a proxy server.
Background
Redis is a Key-Value based storage system, and has higher read-write performance, so that the Redis is more and more widely applied. At present, in order to improve the reliability of the Redis, a Redis high availability scheme needs to be set for the Redis system, and the meaning of the Redis high availability is that functions such as continuous availability of data, data protection, load balancing, expandability and fault recovery are provided, the stability, reliability and availability of the system are ensured, good experience is provided for users, and the continuity of service and the safety of data are protected.
In order to realize high availability of Redis, a scheme of combining a monitoring component (such as Redis Sentinel) with a proxy server (such as Twoproxy) is provided in the prior art, and the combination of the monitoring component (such as Redis Sentinel) and the proxy server can realize high availability and load balancing of Redis.
In the prior art, when a failure occurs in a master node, a monitoring component selects a new master node, but needs to manually modify the master node configuration of a proxy server to switch to the new master node, and because the update of master node information in each proxy server is asynchronous, the problem of data consistency of each proxy server during the master-slave switching can be caused, and the configuration update of the proxy server is performed manually, so that the configuration update efficiency is low.
Disclosure of Invention
The embodiment of the application provides a method, a system, equipment and a storage medium for updating the configuration of a proxy server, which can reduce the problem of data consistency of each proxy server during master-slave switching and improve the configuration updating efficiency of the proxy server.
In a first aspect, an embodiment of the present application provides a method for updating a configuration of a proxy server, where the method is applied to a high availability system of a dis, where the high availability system of the dis includes a dis cluster, a proxy cluster, a monitoring component, and a configuration center, where the proxy cluster includes at least one proxy server, and each proxy server is provided with a configuration updating component, and the configuration center is configured to store master node information of each master node in the dis cluster; the method comprises the following steps:
the monitoring component monitors whether a target main node in the Redis cluster is a target abnormal node or not;
when the monitoring component monitors that the target main node is a target abnormal node, the monitoring component switches a target slave node corresponding to the target main node in the Redis cluster into a new main node, and updates main node information corresponding to the target main node in the configuration center into main node information of the new main node;
For each configuration updating component, the configuration updating component monitors the configuration center in real time, and when the main node information in the configuration center is monitored to be updated, the main node configuration of the corresponding proxy server is updated according to the main node information in the configuration center.
In a second aspect, an embodiment of the present application further provides a Redis high availability system, where the Redis high availability system includes a Redis cluster, a proxy cluster, a monitoring component, and a configuration center, the proxy cluster includes at least one proxy server, and a configuration update component is provided in each proxy server; wherein:
the configuration center is used for storing the master node information of each master node in the Redis cluster;
the monitoring component is used for monitoring whether a target main node in the Redis cluster is a target abnormal node or not; when the target main node is monitored to be a target abnormal node, switching a target slave node corresponding to the target main node in the Redis cluster to be a new main node, and updating main node information corresponding to the target main node in the configuration center to be main node information of the new main node;
Each configuration updating component is used for monitoring the configuration center in real time, and updating the corresponding master node configuration of the proxy server according to the master node information in the configuration center when the master node information in the configuration center is updated.
In a third aspect, an embodiment of the present application further provides a configuration update apparatus of a proxy server, where the apparatus is disposed in a Redis high availability system, where the Redis high availability system includes a Redis cluster, a proxy cluster, a monitoring component, and a configuration center, where the proxy cluster includes at least one proxy server, and each proxy server is provided with a configuration update component, and the configuration center is configured to store master node information of each master node in the Redis cluster, where the configuration update apparatus of a proxy server includes:
the monitoring unit is used for monitoring whether the target main node in the Redis cluster is a target abnormal node or not through the monitoring component;
the switching unit is used for switching a target slave node corresponding to the target master node in the Redis cluster into a new master node through the monitoring component when the monitoring component monitors that the target master node is a target abnormal node, and updating master node information corresponding to the target master node in the configuration center into master node information of the new master node;
The monitoring unit is further used for monitoring the configuration center in real time through each configuration updating component;
and the updating unit is used for updating the corresponding main node configuration of the proxy server according to the main node information in the configuration center through the configuration updating component when the configuration updating component monitors that the main node information in the configuration center is updated.
In a fourth aspect, an embodiment of the present application further provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the method when executing the computer program.
In a fifth aspect, embodiments of the present application also provide a computer readable storage medium storing a computer program comprising program instructions which, when executed by a processor, implement the above-described method.
The embodiment of the application provides a method, a system, equipment and a storage medium for updating the configuration of a proxy server. The method is applied to a Redis high-availability system, wherein the Redis high-availability system comprises a Redis cluster, a proxy cluster, a monitoring component and a configuration center, the proxy cluster comprises at least one proxy server, a configuration updating component is arranged in each proxy server, and the configuration center is used for storing master node information of each master node in the Redis cluster; in the scheme, when a monitoring component monitors that a target master node in a Redis cluster is abnormal, a target slave node corresponding to the target master node is switched to a new master node in time, and master node information corresponding to the target master node in the configuration center is updated to master node information of the new master node; each configuration updating component monitors the configuration center in real time, when the information of the main node in the configuration center changes, the configuration updating component updates the configuration of the main node of the corresponding proxy server according to the information of the main node in the current configuration center, and each proxy server can timely update the configuration of the main node according to the corresponding configuration updating component because each proxy server is provided with the configuration updating component, so that the data consistency problem of each proxy server in the master-slave switching period is reduced, and the configuration of each proxy server is updated through the configuration updating component in the embodiment without manual operation, so that the configuration updating efficiency of the proxy server is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is an application scenario schematic diagram of a configuration updating method of a proxy server according to an embodiment of the present application;
fig. 2 is a flow chart of a configuration updating method of a proxy server according to an embodiment of the present application;
FIG. 3 is a schematic block diagram of a configuration updating apparatus of a proxy server according to an embodiment of the present application;
fig. 4 is a schematic block diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It should be understood that the terms "comprises" and "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
The embodiment of the application provides a method, a system, equipment and a storage medium for updating the configuration of a proxy server.
The execution body of the configuration updating method of the proxy server may be the configuration updating device of the proxy server provided by the embodiment of the present application, or a computer device integrated with the configuration updating device of the proxy server, where the configuration updating device of the proxy server may be implemented in a hardware or software manner, and the computer device may be a terminal or a server.
Referring to fig. 1, fig. 1 is a schematic application scenario diagram of a configuration updating method of a proxy server according to an embodiment of the present application. The configuration updating method of the proxy server is applied to a Redis high availability system in FIG. 1, wherein the Redis high availability system comprises a Redis cluster, a proxy cluster, a monitoring component and a configuration center, the proxy cluster comprises at least one proxy server, and a configuration updating component is arranged in each proxy server, wherein the components of the Redis high availability system in the embodiment are as follows:
configuration center: the configuration center is used for storing the master node information of each master node in the Redis cluster, and the configuration center can be realized through a zookeeper.
Redis cluster: the method comprises the steps that at least one master node is included, each master node is provided with at least one slave node (master-slave architecture) in order to ensure high availability of the Redis cluster, and during operation of the Redis cluster, each slave node starts a master-slave mode, namely each slave node copies data of the corresponding master node, so that data consistency between the slave nodes and the master nodes is ensured as much as possible.
Agent cluster: the proxy server is used for receiving a request of a client and forwarding the request to a Redis cluster of a back end, the proxy server can be Twompproxy, the proxy servers work simultaneously, the proxy servers are isomorphic proxy servers, namely the configuration of the proxy servers is the same, in the embodiment, since the proxy servers have no automatic update function and messages are not exchanged, in order to realize automatic update of the configuration of the proxy servers and maintain consistency of the configuration of the proxy servers, in the embodiment, a configuration update component (Agent) is respectively arranged for each proxy server, each configuration update component detects configuration information (main node information of each main node in the Redis cluster) in real time, and when the configuration information is detected to be updated, the proxy server pulls up the latest configuration and modifies the configuration of the corresponding proxy server.
And (3) a monitoring component: the monitoring module is used for monitoring whether nodes in the Redis cluster are faulty or not, and when an abnormal master node is monitored, the standby slave node of the master node is automatically lifted to be a new master node, and master node information corresponding to the target master node in a configuration center is updated to be master node information of the new master node.
Fig. 2 is a flowchart of a configuration updating method of a proxy server according to an embodiment of the present application. The method is applied to the Redis high availability system shown in FIG. 1, and as shown in FIG. 2, the method includes the following steps S110-S130.
S110, the monitoring component monitors whether a target main node in the Redis cluster is a target abnormal node.
The Redis cluster in this embodiment includes at least one target master node, and the monitoring component needs to monitor each target master node in the Redis cluster, that is, for each target master node, the configuration updating method of the proxy server in this embodiment is used to ensure high availability of nodes in the Redis cluster.
In some embodiments, the monitoring component in this embodiment includes a plurality of sub-monitoring components, and in order to ensure accuracy of the monitoring result, in this embodiment, it is required to determine whether the target host node is an abnormal node in combination with the monitoring result of each sub-monitoring component, specifically, determine whether the target host node is an abnormal node by:
When a target sub-monitoring component in the sub-monitoring components monitors that the target main node is an abnormal node, the target sub-monitoring component acquires monitoring results of other sub-monitoring components aiming at the target main node, wherein the other sub-monitoring components are the sub-monitoring components except the target sub-monitoring component in the sub-monitoring components; and the target sub-monitoring component determines whether the target main node is a target abnormal node according to each monitoring result.
In this embodiment, when the target sub-monitoring component monitors that the target main node is an abnormal node, the monitoring result of other sub-monitoring components on the target main node needs to be queried, where the monitoring result includes an abnormal result and a normal result, the abnormal result indicates that the target main node is an abnormal node, and the normal result indicates that the target main node is a normal node.
That is, when the target sub-monitoring component monitors that the target main node is an abnormal node, the monitoring results of other sub-monitoring components on the target main node are also required to be queried, and whether the target main node is the target abnormal node is determined by combining the monitoring results of other sub-monitoring components.
In some embodiments, the target sub-monitoring component monitors the target master node as an abnormal node by: the target sub-monitoring component sends a detection instruction to the target main node according to a preset time interval; and if the target sub-monitoring component does not receive the feedback instruction returned by the target main node based on the detection instruction within the preset time, the target sub-monitoring component determines that the target main node is an abnormal node.
Specifically, in this embodiment, the preset time interval may be 1s, the preset duration may be 2s, and specific time between the preset time interval and the preset duration may be set as required, which is not limited herein.
When the target master node is judged as an abnormal node, the judgment is subjective judgment, that is, whether the target master node is truly abnormal is not determined yet, and when the target master node is judged as a target abnormal node, the judgment is objective judgment, and at this time, the monitoring component determines that the target master node is abnormal.
Further, the target sub-monitoring component determines whether the target main node is a target abnormal node according to each monitoring result, including: the target sub-monitoring component determines the number of results that the monitoring result is an abnormal result; if the number of the results is greater than or equal to a target threshold, the target sub-monitoring component determines that the target main node is the target abnormal node, and the target threshold is determined according to the number of the sub-monitoring components; and if the number of the results is smaller than the target threshold, the target sub-monitoring component determines that the target main node is not the target abnormal node.
For example, when the number of the sub-monitoring components is N, N is an integer greater than 1, at this time, the target threshold is N/2 (rounded down), at this time, when N is 5, the target threshold is 2, the number of other sub-monitoring components is 4, the corresponding monitoring results are also 4, if 2 or more monitoring results are abnormal results, at this time, the target sub-monitoring components can determine that the target main node is the target abnormal node, or else, determine that the target main node is not the target abnormal node.
The target master node abnormality in this embodiment includes a target master node downtime.
And S120, when the monitoring component monitors that the target main node is a target abnormal node, the monitoring component switches a target slave node corresponding to the target main node in the Redis cluster into a new main node and updates main node information corresponding to the target main node in the configuration center into main node information of the new main node.
In this embodiment, when the monitoring component monitors that the target master node is a target abnormal node, the monitoring component further switches a target slave node corresponding to the target master node to a new master node, specifically, the switching process is that the target slave node is notified to be the new master node, at this time, the target slave node is used as the master node to receive a request forwarded by the proxy server, and other slave nodes of the target master node are notified to perform master-slave replication on the new master node.
In addition, the monitoring component needs to update the master node information corresponding to the target master node in the configuration center to the master node information of the new master node through a publish/subscribe function.
Because the monitoring component includes a plurality of sub-monitoring components, in this embodiment, master-slave switching operation of the target master node needs to be implemented by one sub-monitoring component of the plurality of sub-monitoring components, and at this time, the monitoring component switches a target slave node corresponding to the target master node in the dis cluster to a new master node, including: the monitoring component determines a collar sub-monitoring component from a plurality of sub-monitoring components in an election mode; the head sub-monitoring component determines a target slave node from a slave node set corresponding to the target master node; the lead monitoring component switches the target slave node to the new master node.
Specifically, the election mode includes: each sub-monitoring component finding that the target slave node is abnormal can initiate a voting request to other sub-monitoring components, hope that the other sub-monitoring components cast a vote, and other sub-monitoring components can cast a vote only, generally, cast the sub-monitoring component corresponding to the voting request received first, and after the voting is finished, the monitoring component determines the sub-monitoring component with the highest vote as the leading sub-monitoring component.
In this embodiment, the target master node corresponds to a slave node set, where the slave node set includes at least one slave node, and when performing master-slave switching, the monitoring component first needs to determine the target slave node from the slave node set, and specifically may determine the target slave node by the following two ways:
first kind: the head sub-monitoring component acquires the data synchronization quantity of each slave node in the slave node set and the target master node; and the head sub-monitoring component takes the slave node with the largest data synchronization as the target slave node.
In this embodiment, the target slave node is determined according to the data synchronization amount of each slave node, where the data synchronization amount indicates the data synchronization degree with the target master node, and the larger the data synchronization amount is, the higher the data synchronization degree with the target master node is, and in order to reduce the loss amount of data, the embodiment preferably selects the slave node with the higher synchronization degree as the target slave node.
Second kind: the head sub-monitoring component obtains the priority of each slave node in the slave node set; the lead sub-monitoring component takes the slave node with the highest priority as the target slave node.
In this embodiment, the slave nodes are preferentially determined according to the priority of each slave node, where the priority is determined according to the performance of the corresponding slave node, and the higher the performance of the corresponding slave node is, the higher the corresponding priority is, and in order to increase the processing speed of the data by the node, the embodiment preferentially selects the slave node with the highest priority as the target slave node.
And S130, aiming at each configuration updating component, the configuration updating component monitors the configuration center in real time, and updates the corresponding master node configuration of the proxy server according to the master node information in the configuration center when the update of the master node information in the configuration center is monitored.
In this embodiment, a configuration update component is provided for each proxy server, and each configuration update component monitors a configuration center in real time, and updates the corresponding configuration of a master node of the proxy server according to the master node information in the configuration center when it is detected that the master node information in the configuration center is updated.
Specifically, the configuration updating component in this example determines whether the configuration center has an update by detecting whether the master node information of the configuration center is consistent with the master node information of the local proxy server, if not, it indicates that the configuration center has an update, otherwise, it indicates that the configuration center has no update.
When the fact that the configuration center is inconsistent with the master node information of the local proxy server is detected, the configuration updating component pulls the latest configuration (each master node information) from the configuration center to modify the configuration of the corresponding proxy server, and high-availability switching is achieved.
In summary, the configuration updating method of the seed proxy server provided in the present embodiment is applied to a Redis high availability system, where the Redis high availability system includes a Redis cluster, a proxy cluster, a monitoring component and a configuration center, where the proxy cluster includes at least one proxy server, and each proxy server is provided with a configuration updating component, and the configuration center is configured to store master node information of each master node in the Redis cluster; in the scheme, when a monitoring component monitors that a target master node in a Redis cluster is abnormal, a target slave node corresponding to the target master node is switched to a new master node in time, and master node information corresponding to the target master node in the configuration center is updated to master node information of the new master node; each configuration updating component monitors the configuration center in real time, when the information of the main node in the configuration center changes, the configuration updating component updates the configuration of the main node of the corresponding proxy server according to the information of the main node in the current configuration center, and each proxy server can timely update the configuration of the main node according to the corresponding configuration updating component because each proxy server is provided with the configuration updating component, so that the data consistency problem of each proxy server in the master-slave switching period is reduced, and the configuration of each proxy server is updated through the configuration updating component in the embodiment without manual operation, so that the configuration updating efficiency of the proxy server is improved.
Fig. 3 is a schematic block diagram of a configuration updating apparatus of a proxy server provided in an embodiment of the present application. As shown in fig. 3, the present application also provides a configuration updating apparatus 300 of a proxy server, corresponding to the above configuration updating method of a proxy server. The configuration updating device 300 of the proxy server includes a unit for executing the configuration updating method of the proxy server, where the configuration updating device 300 of the proxy server may be configured in a Redis high availability system, where the Redis high availability system includes a Redis cluster, a proxy cluster, a monitoring component, and a configuration center, where the proxy cluster includes at least one proxy server, and each proxy server is provided with a configuration updating component, and the configuration center is configured to store master node information of each master node in the Redis cluster. Specifically, referring to fig. 3, the configuration updating apparatus 300 of the proxy server includes a monitoring unit 301, a switching unit 302, and a switching unit 302, wherein:
a monitoring unit 301, configured to monitor, by using the monitoring component, whether a target master node in the dis cluster is a target abnormal node;
a switching unit 302, configured to switch, by the monitoring component, a target slave node corresponding to the target master node in the dis cluster to a new master node when the monitoring component monitors that the target master node is a target abnormal node, and update master node information corresponding to the target master node in the configuration center to master node information of the new master node;
The monitoring unit 301 is further configured to monitor the configuration center in real time through each of the configuration updating components;
and the updating unit 303 is configured to update, when it is monitored by the configuration updating component that the master node information in the configuration center is updated, the corresponding master node configuration of the proxy server according to the master node information in the configuration center by the configuration updating component.
In some embodiments, the monitoring component comprises a plurality of sub-monitoring components; the monitoring unit 301 is specifically configured to, when executing the step of monitoring, by the monitoring component, whether the target master node in the dis cluster is a target abnormal node:
when a target sub-monitoring component in the sub-monitoring components monitors that the target main node is an abnormal node, acquiring monitoring results of other sub-monitoring components aiming at the target main node through the target sub-monitoring component, wherein the other sub-monitoring components are the sub-monitoring components except the target sub-monitoring component in the sub-monitoring components; and determining whether the target main node is a target abnormal node or not according to each monitoring result by the target sub-monitoring component.
In some embodiments, the monitoring unit 301 is specifically configured to, when executing the step of determining, by the target sub-monitoring component, whether the target master node is a target abnormal node according to each of the monitoring results:
determining the number of results that the monitoring result is an abnormal result through the target sub-monitoring component; and if the number of the results is greater than or equal to a target threshold, determining that the target main node is the target abnormal node by the target sub-monitoring component, wherein the target threshold is determined according to the number of the sub-monitoring components, and if the number of the results is less than the target threshold, determining that the target main node is not the target abnormal node by the target sub-monitoring component.
In some embodiments, when performing the step of switching, by the monitoring component, the target slave node corresponding to the target master node in the dis cluster to a new master node, the switching unit 302 is specifically configured to:
determining a collar sub-monitoring component from a plurality of sub-monitoring components in an election mode by utilizing the monitoring component; determining a target slave node from a slave node set corresponding to the target master node through the head sub-monitoring component; and switching the target slave node to the new master node through the head sub-monitoring component.
In some embodiments, the switching unit 302 is specifically configured to, when executing the step of determining, by the lead sub-monitoring component, a target slave node from the slave node set corresponding to the target master node:
acquiring the data synchronization quantity of each slave node in the slave node set and the target master node through the head sub-monitoring component; and taking the slave node with the largest data synchronization as the target slave node through the head sub-monitoring component.
In some embodiments, the switching unit 302 is specifically configured to, when executing the step of determining, by the lead sub-monitoring component, a target slave node from the slave node set corresponding to the target master node:
acquiring the priority of each slave node in the slave node set through the head sub-monitoring component; and taking the slave node with the highest priority as the target slave node through the head sub-monitoring component.
In some embodiments, the monitoring unit 301 specifically monitors that the target master node is an abnormal node by:
sending a detection instruction to the target main node according to a preset time interval by the target sub-monitoring component; and if the target sub-monitoring component does not receive the feedback instruction returned by the target main node based on the detection instruction within the preset time, determining that the target main node is an abnormal node by the target sub-monitoring component.
In summary, the configuration updating apparatus 300 of the proxy server provided in this embodiment may be configured in a high availability system of dis, where the high availability system of dis includes a dis cluster, a proxy cluster, a monitoring component, and a configuration center, where the proxy cluster includes at least one proxy server, and each proxy server is provided with a configuration updating component, and the configuration center is configured to store master node information of each master node in the dis cluster; in this scheme, when the monitoring unit 301 monitors that the target master node in the Redis cluster is abnormal through the monitoring component, the switching unit 302 timely switches the target slave node corresponding to the target master node to a new master node, and updates the master node information corresponding to the target master node in the configuration center to the master node information of the new master node; the monitoring unit 301 monitors the configuration center in real time through each configuration updating component, when the master node information in the configuration center changes, the updating unit 303 updates the master node configuration of the corresponding proxy server according to the master node information in the current configuration center through the configuration updating component, and each proxy server can timely update the configuration of the master node according to the corresponding configuration updating component because each proxy server is configured with the configuration updating component, so that the problem of data consistency of each proxy server during the master-slave switching is reduced, and the configuration of each proxy server is updated through the configuration updating component in the embodiment without manual operation, so that the configuration updating efficiency of the proxy server is improved.
It should be noted that, as those skilled in the art can clearly understand, the configuration updating device of the proxy server and the specific implementation process of each unit may refer to the corresponding descriptions in the foregoing method embodiments, and for convenience and brevity of description, the description is omitted here.
The configuration updating means of the above-described proxy server may be implemented in the form of a computer program which can be run on a computer device as shown in fig. 4.
Referring to fig. 4, fig. 4 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 400 may be a terminal or a server.
The computer device 400 is provided with a high availability system of Redis, where the high availability system of Redis includes a Redis cluster, a proxy cluster, a monitoring component and a configuration center, the proxy cluster includes at least one proxy server, each proxy server is provided with a configuration update component, and the configuration center is used to store master node information of each master node in the Redis cluster.
With reference to FIG. 4, the computer device 400 includes a processor 402, a memory, and a network interface 405, which are connected by a system bus 401, wherein the memory may include a non-volatile storage medium 403 and an internal memory 404.
The non-volatile storage medium 403 may store an operating system 4031 and a computer program 4032. The computer program 4032 includes program instructions that, when executed, cause the processor 402 to perform a method of configuration update of a proxy server.
The processor 402 is used to provide computing and control capabilities to support the operation of the overall computer device 400.
The internal memory 404 provides an environment for the execution of a computer program 4032 in the non-volatile storage medium 403, which computer program 4032, when executed by the processor 402, causes the processor 402 to perform a method for updating the configuration of a proxy server.
The network interface 405 is used for network communication with other devices. It will be appreciated by those skilled in the art that the architecture shown in fig. 4 is merely a block diagram of some of the architecture relevant to the present inventive arrangements and is not limiting of the computer device 400 to which the present inventive arrangements may be implemented, and that a particular computer device 400 may include more or less components than those shown, or may be combined with some components, or may have a different arrangement of components.
Wherein the processor 402 is configured to execute a computer program 4032 stored in the memory to implement the steps of:
The monitoring component monitors whether a target main node in the Redis cluster is a target abnormal node or not;
when the monitoring component monitors that the target main node is a target abnormal node, the monitoring component switches a target slave node corresponding to the target main node in the Redis cluster into a new main node, and updates main node information corresponding to the target main node in the configuration center into main node information of the new main node;
for each configuration updating component, the configuration updating component monitors the configuration center in real time, and when the main node information in the configuration center is monitored to be updated, the main node configuration of the corresponding proxy server is updated according to the main node information in the configuration center.
It should be appreciated that in embodiments of the present application, the processor 402 may be a central processing unit (Central Processing Unit, CPU), the processor 402 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSPs), application specific integrated circuits (Application Specific Integrated Circuit, ASICs), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Those skilled in the art will appreciate that all or part of the flow in a method embodying the above described embodiments may be accomplished by computer programs instructing the relevant hardware. The computer program comprises program instructions, and the computer program can be stored in a storage medium, which is a computer readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present application also provides a storage medium. The storage medium may be a computer readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. The program instructions, when executed by the processor, cause the processor to perform the steps of:
the monitoring component monitors whether a target main node in the Redis cluster is a target abnormal node or not;
when the monitoring component monitors that the target main node is a target abnormal node, the monitoring component switches a target slave node corresponding to the target main node in the Redis cluster into a new main node, and updates main node information corresponding to the target main node in the configuration center into main node information of the new main node;
For each configuration updating component, the configuration updating component monitors the configuration center in real time, and when the main node information in the configuration center is monitored to be updated, the main node configuration of the corresponding proxy server is updated according to the main node information in the configuration center.
The storage medium may be a U-disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, or other various computer-readable storage media that can store program codes.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed.
The steps in the method of the embodiment of the application can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the application can be combined, divided and deleted according to actual needs. In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The integrated unit may be stored in a storage medium if implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the present application is essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a terminal, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application.
While the application has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (10)

1. The method is applied to a Redis high availability system, wherein the Redis high availability system comprises a Redis cluster, a proxy cluster, a monitoring component and a configuration center, the proxy cluster comprises at least one proxy server, the proxy servers are provided with configuration updating components, and the configuration center is used for storing master node information of each master node in the Redis cluster; the method comprises the following steps:
the monitoring component monitors whether a target main node in the Redis cluster is a target abnormal node or not;
when the monitoring component monitors that the target main node is a target abnormal node, the monitoring component switches a target slave node corresponding to the target main node in the Redis cluster into a new main node, and updates main node information corresponding to the target main node in the configuration center into main node information of the new main node;
For each configuration updating component, the configuration updating component monitors the configuration center in real time, and when the main node information in the configuration center is monitored to be updated, the main node configuration of the corresponding proxy server is updated according to the main node information in the configuration center.
2. The method of claim 1, wherein the monitoring component comprises a plurality of sub-monitoring components; the monitoring component monitors whether a target main node in the Redis cluster is a target abnormal node, and comprises the following steps:
when a target sub-monitoring component in the sub-monitoring components monitors that the target main node is an abnormal node, the target sub-monitoring component acquires monitoring results of other sub-monitoring components aiming at the target main node, wherein the other sub-monitoring components are the sub-monitoring components except the target sub-monitoring component in the sub-monitoring components;
and the target sub-monitoring component determines whether the target main node is a target abnormal node according to each monitoring result.
3. The method of claim 2, wherein the target sub-monitoring component determining whether the target master node is a target abnormal node based on each of the monitoring results comprises:
The target sub-monitoring component determines the number of results that the monitoring result is an abnormal result;
if the number of the results is greater than or equal to a target threshold, the target sub-monitoring component determines that the target main node is the target abnormal node, and the target threshold is determined according to the number of the sub-monitoring components;
and if the number of the results is smaller than the target threshold, the target sub-monitoring component determines that the target main node is not the target abnormal node.
4. The method of claim 2, wherein the monitoring component switches a target slave node in the dis cluster corresponding to the target master node to a new master node, comprising:
the monitoring component determines a collar sub-monitoring component from a plurality of sub-monitoring components in an election mode;
the head sub-monitoring component determines a target slave node from a slave node set corresponding to the target master node;
the lead monitoring component switches the target slave node to the new master node.
5. The method of claim 4, wherein the lead monitoring component determines a target slave node from a set of slave nodes corresponding to the target master node, comprising:
The head sub-monitoring component acquires the data synchronization quantity of each slave node in the slave node set and the target master node;
and the head sub-monitoring component takes the slave node with the largest data synchronization as the target slave node.
6. The method of claim 4, wherein the lead monitoring component determines a target slave node from a set of slave nodes corresponding to the target master node, comprising:
the head sub-monitoring component obtains the priority of each slave node in the slave node set;
the lead sub-monitoring component takes the slave node with the highest priority as the target slave node.
7. The method of any one of claims 2 to 6, wherein the target sub-monitoring component monitors the target master node as an anomalous node by:
the target sub-monitoring component sends a detection instruction to the target main node according to a preset time interval;
and if the target sub-monitoring component does not receive the feedback instruction returned by the target main node based on the detection instruction within the preset time, the target sub-monitoring component determines that the target main node is an abnormal node.
8. The Redis high availability system is characterized by comprising a Redis cluster, a proxy cluster, a monitoring component and a configuration center, wherein the proxy cluster comprises at least one proxy server, and a configuration updating component is arranged in each proxy server; wherein:
the configuration center is used for storing the master node information of each master node in the Redis cluster;
the monitoring component is used for monitoring whether a target main node in the Redis cluster is a target abnormal node or not; when the target main node is monitored to be a target abnormal node, switching a target slave node corresponding to the target main node in the Redis cluster to be a new main node, and updating main node information corresponding to the target main node in the configuration center to be main node information of the new main node;
each configuration updating component is used for monitoring the configuration center in real time, and updating the corresponding master node configuration of the proxy server according to the master node information in the configuration center when the master node information in the configuration center is updated.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method for configuration updating of a proxy server as claimed in any one of claims 1-7 when executing the computer program.
10. A storage medium storing a computer program comprising program instructions which, when executed by a processor, cause the processor to perform the method of updating the configuration of a proxy server as claimed in any one of claims 1 to 7.
CN202310915627.9A 2023-07-21 2023-07-21 Configuration updating method, system, equipment and storage medium of proxy server Pending CN116915601A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310915627.9A CN116915601A (en) 2023-07-21 2023-07-21 Configuration updating method, system, equipment and storage medium of proxy server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310915627.9A CN116915601A (en) 2023-07-21 2023-07-21 Configuration updating method, system, equipment and storage medium of proxy server

Publications (1)

Publication Number Publication Date
CN116915601A true CN116915601A (en) 2023-10-20

Family

ID=88367782

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310915627.9A Pending CN116915601A (en) 2023-07-21 2023-07-21 Configuration updating method, system, equipment and storage medium of proxy server

Country Status (1)

Country Link
CN (1) CN116915601A (en)

Similar Documents

Publication Publication Date Title
US10560315B2 (en) Method and device for processing failure in at least one distributed cluster, and system
CN110830283B (en) Fault detection method, device, equipment and system
EP4068099A1 (en) State management method, master and backup application server switching method, and electronic device
US20080288812A1 (en) Cluster system and an error recovery method thereof
CN111585835B (en) Control method and device for out-of-band management system and storage medium
CN112653734A (en) Server cluster real-time master-slave control and data synchronization system and method
CN111752488B (en) Management method and device of storage cluster, management node and storage medium
CN114265753A (en) Management method and management system of message queue and electronic equipment
CN114138732A (en) Data processing method and device
CN108512753B (en) Method and device for transmitting messages in cluster file system
CN109189854B (en) Method and node equipment for providing continuous service
CN111342986A (en) Distributed node management method and device, distributed system and storage medium
CN110351122B (en) Disaster recovery method, device, system and electronic equipment
CN116915601A (en) Configuration updating method, system, equipment and storage medium of proxy server
CN110661599B (en) HA implementation method, device and storage medium between main node and standby node
CN113596195B (en) Public IP address management method, device, main node and storage medium
JP2013025765A (en) Master/slave system, control device, master/slave switching method and master/slave switching program
JP2003345620A (en) Process monitoring method for multi-node cluster system
CN110912837B (en) VSM system-based main/standby switching method and device
CN112367386A (en) Ignite-based automatic operation and maintenance method, apparatus and computer equipment
CN109753292B (en) Method and device for deploying multiple applications in multiple single instance database service
US11010269B2 (en) Distributed processing system and method for management of distributed processing system
CN115145782A (en) Server switching method, mooseFS system and storage medium
CN109218206B (en) Method and device for limiting link state advertisement quantity
CN112769889B (en) Service data pushing method and device, storage medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination