CN113746902B - Communication method and device - Google Patents

Communication method and device Download PDF

Info

Publication number
CN113746902B
CN113746902B CN202110889166.3A CN202110889166A CN113746902B CN 113746902 B CN113746902 B CN 113746902B CN 202110889166 A CN202110889166 A CN 202110889166A CN 113746902 B CN113746902 B CN 113746902B
Authority
CN
China
Prior art keywords
codis
agent
agents
backup
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110889166.3A
Other languages
Chinese (zh)
Other versions
CN113746902A (en
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.)
New H3C Big Data Technologies Co Ltd
Original Assignee
New H3C Big Data Technologies 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 New H3C Big Data Technologies Co Ltd filed Critical New H3C Big Data Technologies Co Ltd
Priority to CN202110889166.3A priority Critical patent/CN113746902B/en
Publication of CN113746902A publication Critical patent/CN113746902A/en
Application granted granted Critical
Publication of CN113746902B publication Critical patent/CN113746902B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services

Abstract

The application provides a communication method and device, wherein the method comprises the following steps: when the first communication connection fails, acquiring locally stored proxy information of a plurality of backup Codis proxies, wherein each proxy information comprises an IP address and port information of the Codis proxy; establishing communication connection with each backup Codis agent according to the IP address and port information of each backup Codis agent; when the second communication connection is successfully established with the second Codis agent, the communication connection with other backup Codis agents except the second Codis agent in the plurality of backup Codis agents is stopped, the second Codis agent is used as a main agent, and the first Codis agent and the other backup Codis agents are used as backup Codis agents; and carrying out backup and recovery of the user data with the RMDB through the second Codis agent.

Description

Communication method and device
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a communications method and apparatus.
Background
The broadband remote access server (English: broadband Remote Access Server, BRAS for short) is a product of service evolution of the metropolitan area network, and the user terminal has no authentication and authorization management under the condition that only access equipment and backbone routers exist in the metropolitan area network, which is disadvantageous to operation management and long-term development of the network. After the BRAS is introduced between the access equipment and the backbone router, the BRAS is used as an access gateway of network service to provide broadband access, authentication, authorization and charging, manage user bandwidth, collect user service flow, terminate user PPPOE connection and the like for the user terminal, and provide various service services.
With the development of virtualization, the vbas after the conversion and separation of the BRAS gradually becomes the main stream of operator deployment. The vBRAS system mainly comprises a Control Plane (English: control Plane, abbreviated as CP) and a forwarding Plane (English: user Plane, abbreviated as UP). CP is located as a user control management part, mainly comprising: the system comprises a user control management function module, a user access control function module, a user authentication authorization charging function module, an address management function module and the like; the UP is positioned as a three-layer network edge and user policy executing component, and mainly comprises: forwarding plane functions such as traffic forwarding, qoS, traffic statistics, etc., and pipe control plane functions such as unicast routing protocol, multicast routing protocol, MPLS (LDP/TE), etc.
In the forwarding and control separation networking, user data of user terminals such as PPPoE and IPoE need to be migrated between vbas devices due to device failure, elastic expansion of the devices when users tide, device upgrading and the like. Remote Database (RMDB) is a backup technology applied in forwarding and control separated networking. The method can well solve the problem of user data migration by realizing the backup and recovery of data by means of a remote dictionary service (English: remote Dictionary Server, redis for short) server.
At present, the process of implementing user data migration through RMDB is as follows: the remote database function, i.e., RMDB block, is started in the CP. Configuring IP address and port information of one or more distributed application coordination services (Zookeeper) in the RMDB module; the RMDB block may attempt to establish a connection with one or more Zookeeper, respectively, according to a configured time sequence, until a connection is successfully established with a Zookeeper. The RMDB block obtains proxy information for an available Codis proxy from the Zookeeper, the proxy information including IP address and port information for the Codis proxy. The RMDB module transmits the information such as the IP address and port of the Codis agent to each service module included in the CP.
After each service module receives the information such as the IP address and the port of the Codis agent, the service module actively establishes connection with the Codis agent. Subsequently, each service module is connected with the Codis agent by itself according to the requirement, and the backup and recovery of the user data are carried out.
However, in the foregoing scheme, the following drawbacks also occur: 1) If the connection between each service module and the selected Codis agent fails, each service module needs to wait for the Zookeeper to acquire the available connection information of one Codis agent again and return the connection information to the RMDB module, and the RMDB module can perform backup and recovery operation of the user data after establishing connection with the Codis agent again. In this way, each service module is rendered unusable during connection recovery.
Disclosure of Invention
In view of this, the present application provides a communication method and apparatus for solving the problem that RMDB cannot be used in the connection recovery period between each service module and Codis agent.
In a first aspect, the present application provides a communication method, where the method is applied to a CP, where the CP establishes a first communication connection with a first Codis agent, and the first Codis agent is a master agent, and the method includes:
when the first communication connection fails, acquiring locally stored proxy information of a plurality of backup Codis agents, wherein each proxy information comprises an IP address and port information of the Codis agent;
establishing communication connection with each backup Codis agent according to the IP address and port information of each backup Codis agent;
when the second communication connection is successfully established with the second Codis agent, stopping establishing communication connection with other backup Codis agents except the second Codis agent in the plurality of backup Codis agents, taking the second Codis agent as a main agent, and taking the first Codis agent and the other backup Codis agents as backup Codis agents;
and carrying out backup and recovery of the user data with the RMDB through the second Codis agent.
In a second aspect, the present application provides a communication apparatus, where the apparatus is applied to a CP, where the CP establishes a first communication connection with a first Codis agent, and the first Codis agent is a master agent, and the apparatus includes:
an obtaining unit, configured to obtain locally stored proxy information of a plurality of backup Codis agents when the first communication connection fails, where each proxy information includes an IP address and port information of the Codis agent;
the establishing unit is used for respectively establishing communication connection with each backup Codis agent according to the IP address and the port information of each backup Codis agent;
the processing unit is used for stopping establishing communication connection with other backup Codis agents except the second Codis agent in the plurality of backup Codis agents when the second communication connection is successfully established with the second Codis agent, taking the second Codis agent as a main agent, and taking the first Codis agent and the other backup Codis agents as backup Codis agents;
and the backup recovery unit is used for carrying out backup and recovery of the user data with the RMDB through the second Codis agent.
In a third aspect, the present application provides a network device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor to cause the processor to perform the method provided in the first aspect of the present application.
Therefore, by applying the communication method and the communication device provided by the application, when the first communication connection fails, the CP acquires the locally stored proxy information of a plurality of backup Codis agents, and each proxy information comprises the IP address and the port information of the Codis agent; according to the IP address and port information of each backup Codis agent, the CP establishes communication connection with each backup Codis agent respectively; when the second communication connection is successfully established with the second Codis agent, the CP stops establishing communication connection with other backup Codis agents except the second Codis agent in the plurality of backup Codis agents, the second Codis agent is used as a main agent, and the first Codis agent and the other backup Codis agents are used as backup Codis agents; and the CP and the RMDB perform backup and recovery of the user data through the second Codis agent.
Thus, communication connection is established and maintained between the CP and a plurality of standby Codis agents stored locally, the CP does not depend on a Zookeeper any more, a connection establishment mechanism of the Codis agents is preferentially ensured, and when the communication connection with a certain Codis agent fails, the backup and recovery functions of user data are continuously available by using the RMDB.
Drawings
Fig. 1 is a flowchart of a communication method provided in an embodiment of the present application;
fig. 2 is a schematic diagram of communication between devices according to an embodiment of the present application;
fig. 3 is a structural diagram of a communication device according to an embodiment of the present application;
fig. 4 is a hardware structure of a network device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the accompanying claims.
The terminology used in the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used in this application 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 will also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the corresponding listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first message may also be referred to as a second message, and similarly, a second message may also be referred to as a first message, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
The communication method provided in the embodiment of the present application is described in detail below. Referring to fig. 1, fig. 1 is a flowchart of a communication method provided in an embodiment of the present application. The method is applied to the CP, and the communication method provided by the embodiment of the application can comprise the following steps.
And 110, when the first communication connection fails, acquiring locally stored proxy information of a plurality of backup Codis agents, wherein each proxy information comprises an IP address and port information of the Codis agent.
Specifically, as shown in fig. 2, fig. 2 is a schematic diagram of communication between devices provided in an embodiment of the present application.
The remote database function, i.e., RMDB block, is started in the CP. The IP address and port information of one or more Zookeeper are configured in the RMDB module. For example, the IP address and port information of Zookeeper1, the IP address and port information of Zookeeper2, and the IP address and port information of Zookeeper3 are configured in the RMDB module.
Meanwhile, proxy information of a first number (e.g., three) of Codis proxies is also configured within the RMDB module, the proxy information including IP addresses and port information of the Codis proxies. As shown in table 1.
TABLE 1Codis proxy information
Codis proxy IP address Port information
Codis agent 1 1.1.1.1 1-1-1
Codis agent 2 2.2.2.2 2-2-2
Codis agent 3 3.3.3.3 3-3-3
The RMDB module respectively tries to establish connection with three Zookeeper according to the configured time sequence until the connection is successfully established with one Zookeeper. In the embodiment of the application, the CP successfully establishes connection with the Zookeeper 1.
The Codis cluster management interface (Codis-fe) issues Codis agent deployments to Codis management tools (Codis-dashboards), i.e., several Codis agents are deployed within the current network. The Codis management tool deploys Codis agents within the current network and issues a configuration to each Codis agent. In the present embodiment, three Codis agents are deployed. Such as Codis agent 1, codis agent 2, and Codis agent 3.
It will be appreciated that Zookeeper1 obtains and stores proxy information for each Codis proxy deployed within the current network, including the IP address and port information for the Codis proxy. The process of obtaining proxy information by Zookeeper1 is the prior art and will not be repeated again. For example, by issuing a configuration instruction to the Zookeeper, it is caused to configure the proxy information locally.
After the RMDB block establishes a connection with Zookeeper1, zookeeper1 generates a first notification message that includes proxy information for a second number (e.g., three) of Codis proxies. The first notification message includes proxy information of Codis proxy 1, codis proxy 2, and Codis proxy 3.
The Zookeeper1 sends a first notification message to the RMDB block.
After receiving the first notification message, the RMDB module obtains the proxy information of the Codis proxy 1, codis proxy 2, and Codis proxy 3. The RMDB module compares the acquired proxy information of the plurality of Codis agents with the proxy information of the plurality of Codis agents configured locally to acquire a third number (e.g., three) of intersection Codis agents.
In the present embodiment, the intersection Codis agents are Codis agent 1, codis agent 2, and Codis agent 3.
The RMDB module selects one Codis agent as a master agent from Codis agents 1, 2 and 3, and the remaining Codis agents other than the master agent as backup Codis agents according to the locally configured preference policy. The RMDB module stores agent information per Codis agent per role to the local.
Wherein the preferred policy may be specifically to select the home agent using the size of the IP address. For example, the Codis agent with the largest IP address among the three Codis agents serves as a master agent, and the remaining Codis agents serve as backup Codis agents. In the embodiment of the application, the RMDB module selects Codis agent 1 as a master agent, codis agent 2, codis agent 3 as backup Codis agents.
The RMDB module establishes a first communication connection with Codis agent 1. And carrying out backup and recovery of user data with the RMDB through the first Codis agent. Meanwhile, the RMDB module also transmits proxy information of the Codis proxy 1 to a service module included in the CP. After each service module receives the proxy information of the Codis proxy 1, the service modules actively establish connection with the Codis proxy 1. Subsequently, each service module is connected with the Codis agent 1 by itself according to the requirement, and performs backup and recovery of user data with the RMDB.
When the first communication connection fails, the RMDB module obtains locally-stored proxy information for a plurality of backup Codis proxies. That is, the RMDB module acquires the proxy information of the Codis proxy 2 and Codis proxy 3.
And 120, establishing communication connection with each backup Codis agent according to the IP address and port information of each backup Codis agent.
Specifically, according to the description of step 110, after the RMDB module obtains the proxy information of the plurality of backup Codis agents, communication connection is respectively established with each backup Codis agent according to the proxy information of each backup Codis agent. That is, the RMDB module establishes communication connections with the Codis agent 2 and the Codis agent 3, respectively, according to the agent information of the Codis agent 2 and the Codis agent 3.
And 130, stopping establishing communication connection with other backup Codis agents except the second Codis agent in the plurality of backup Codis agents when the second communication connection is successfully established with the second Codis agent, taking the second Codis agent as a main agent, and taking the first Codis agent and the other backup Codis agents as backup Codis agents.
Specifically, according to the description of step 120, the RMDB module stops establishing the communication connection with the Codis agent 3 when the second communication connection is successfully established with the Codis agent 2 in the process of establishing the communication connection with the Codis agent 2 and the Codis agent 3.
At this time, the RMDB module takes Codis agent 2 as a master agent, and Codis agent 1 and Codis agent 3 as backup Codis agents.
And 140, carrying out backup and recovery of the user data with the RMDB through the second Codis agent.
Specifically, according to the description of step 130, after the RMDB selects the Codis agent 2 as the master agent, backup and restoration of user data with the RMDB is performed through the Codis agent 2.
Therefore, by applying the communication method provided by the application, when the first communication connection fails, the CP acquires locally stored proxy information of a plurality of backup Codis proxies, each proxy information including an IP address and port information of the Codis proxy; according to the IP address and port information of each backup Codis agent, the CP establishes communication connection with each backup Codis agent respectively; when the second communication connection is successfully established with the second Codis agent, the CP stops establishing communication connection with other backup Codis agents except the second Codis agent in the plurality of backup Codis agents, the second Codis agent is used as a main agent, and the first Codis agent and the other backup Codis agents are used as backup Codis agents; and the CP and the RMDB perform backup and recovery of the user data through the second Codis agent.
Thus, communication connection is established and maintained between the CP and a plurality of standby Codis agents stored locally, the CP does not depend on a Zookeeper any more, a connection establishment mechanism of the Codis agents is preferentially ensured, and when the communication connection with a certain Codis agent fails, the backup and recovery functions of user data are continuously available by using the RMDB.
Optionally, in the embodiment of the present application, a procedure of sending a notification message to the connected Zookeeper by the CP and receiving the notification message sent by the connected Zookeeper is further included.
Specifically, the RMDB block generates the second notification message after replacing the home agent. The RMDB module sends a second notification message to the accessed Zookeeper1, so that the Zookeeper1 can determine that the CP where the RMDB module is located has replaced the master agent after receiving the second notification message.
It will be appreciated that the second notification message further includes the proxy information of the pre-replacement master agent and the proxy information of the post-replacement master agent, and that the Zookeeper1 obtains the proxy information of the pre-replacement master agent and the proxy information of the post-replacement master agent from the second notification message. Zookeeper1 locally traverses the Codis agent and judges whether the Codis agent fault exists at present.
In one possible implementation, if the Zookeeper1 determines that the current Codis agent 1 fails and the Codis agent 1 is the master agent before the CP where the RMDB module is located is replaced, the Zookeeper1 generates a third notification message, where the third notification message includes the agent information of the fourth number of Codis agents, and the agent information of the fourth number of Codis agents does not include the agent information of the first Codis agent.
That is, in the embodiment of the present application, the third notification message includes the proxy information of the codi agent 2, the codi agent 3, and does not include the proxy information of the codi agent 1.
The Zookeeper1 sends a third notification message to the RMDB block.
After receiving the third notification message, the RMDB module obtains the proxy information of the Codis proxy 2 and Codis proxy 3 from the third notification message. A fifth number of intersecting Codis agents, namely Codis agent 3, is determined as intersecting Codis agents based on the locally configured agent information of Codis agents and the agent information of Codis agents included in the third notification message.
The RMDB module takes Codis agent 3 indicated by the agent information of the fifth number of Codis agents as a backup Codis agent.
In another possible implementation, if the Zookeeper1 determines that the current Codis agent 1 has not failed and the Codis agent 1 is the master agent before the CP in which the RMDB block is located is replaced, the Zookeeper1 generates a fourth known message, which includes the agent information of the second number of Codis agents.
That is, in the embodiment of the present application, the fourth known message includes proxy information of the Codis proxy 1, codis proxy 2, codis proxy 3.
The Zookeeper1 sends a fourth known message to the RMDB block.
After receiving the fourth notification message, the RMDB module obtains the proxy information of the Codis proxy 1, codis proxy 2, codis proxy 3 from the fourth notification message.
It will be appreciated that by means of the fourth known message, the RMDB module may determine that Codis agent 1 has not failed at Zookeeper 1. At this time, the Codis agent 2 is still a master agent, and the RMDB module may periodically initiate to establish a first communication connection with the Codis agent 1, and use the Codis agent 1 as a backup Codis agent, while the Codis agent 3 that has previously been used as a backup Codis agent is still used as a backup Codis agent.
If the RMDB module successfully establishes the first communication connection with the Codis agent 1 again, the RMDB module may upgrade the Codis agent 1 as a master agent again, and downgrade the Codis agent 2 as a backup Codis agent.
Optionally, in the embodiment of the present application, a process of sending a notification message after determining that the first Codis agent fails to recover by using the Zookeeper of the CP connection is further included.
Specifically, zookeeper1 periodically probes the state of a locally configured Codis agent. If the Zookeeper1 determines that the state of the current Codis agent 1 has recovered from the fault state to the normal state, the Zookeeper1 generates a fifth notification message, which includes the agent information of the second number of Codis agents.
That is, in the embodiment of the present application, the fifth notification message includes the proxy information of the Codis proxy 1, the Codis proxy 2, and the Codis proxy 3.
The Zookeeper1 sends a fifth notification message to the RMDB block.
After receiving the fifth notification message, the RMDB module obtains the proxy information of the Codis proxy 1, codis proxy 2, codis proxy 3 from the fifth notification message.
It will be appreciated that by means of the fifth notification message, the RMDB module may determine that the Codis agent 1 has recovered from the failure state to the normal state at Zookeeper 1. At this time, codis agent 2 remains the master agent, RMDB module takes Codis agent 1 as the backup Codis agent, while Codis agent 3, which has previously been the backup Codis agent, remains as the backup Codis agent.
Based on the same inventive concept, the embodiment of the application also provides a communication device corresponding to the communication method. Referring to fig. 3, fig. 3 is a structural diagram of a communication device according to an embodiment of the present application. The device is applied to a CP, the CP establishes a first communication connection with a first Codis agent, the first Codis agent is a master agent, and the device comprises:
an obtaining unit 310, configured to obtain locally stored proxy information of a plurality of backup Codis agents when the first communication connection fails, where each proxy information includes an IP address and port information of the Codis agent;
an establishing unit 320, configured to establish communication connection with each backup Codis agent according to the IP address and port information of each backup Codis agent;
a processing unit 330, configured to, when a second communication connection is successfully established with a second Codis agent, stop establishing communication connections with other backup Codis agents except the second Codis agent in a plurality of backup Codis agents, take the second Codis agent as a master agent, and take the first Codis agent and the other backup Codis agents as backup Codis agents;
and a backup restoring unit 340, configured to perform backup and restoration of the user data with the RMDB through the second Codis agent.
Optionally, the obtaining unit 310 is further configured to obtain proxy information of a first number of Codis proxies configured locally;
the apparatus further comprises:
a receiving unit (not shown in the figure) for receiving a first notification message sent by the Zookeeper, wherein the first notification message comprises proxy information of a second number of Codis proxies;
a determining unit (not shown in the figure) for determining a third number of intersection Codis agents based on the agent information of the first number of Codis agents and the agent information of the second number of Codis agents;
the processing unit 330 is further configured to take the first Codis agent as a master agent and the remaining Codis agents other than the first Codis agent as backup Codis agents from the third number of intersection Codis agents;
the establishing unit 320 is further configured to establish the first communication connection with the first Codis agent;
the backup restoring unit 340 is further configured to perform backup and restoration of user data with the RMDB through the first Codis agent.
Optionally, the apparatus further comprises:
a transmitting unit (not shown in the figure) for transmitting a second notification message to the Zookeeper, the second notification message being for the Zookeeper to determine the CP replacement master agent;
the determining unit (not shown in the figure) is further configured to determine, when a third notification message sent by the Zookeeper is received and the third notification message includes proxy information of a fourth number of Codis agents, a fifth number of intersection Codis agents according to the proxy information of the first number of Codis agents and the proxy information of the fourth number of Codis agents;
the processing unit 330 is further configured to take, as a backup Codis agent, a Codis agent indicated by the agent information of the fifth number of Codis agents;
the third notification message is sent after the Zookeeper determines that the first Codis agent fails according to the second notification message, and the agent information of the fourth number of Codis agents does not include the agent information of the first Codis agent.
Optionally, the establishing unit 320 is further configured to, when a fourth notification message sent by the Zookeeper is received and the fourth notification message includes proxy information of the second plurality of Codis agents, periodically initiate, from Codis agents indicated by the proxy information of the second plurality of Codis agents, establishment of the first communication connection with the first Codis agent;
the processing unit 330 is further configured to use the first Codis agent as a backup Codis agent;
and the fourth notification message is sent after the Zookeeper determines that the first Codis agent has not failed according to the second notification message.
Optionally, the receiving unit (not shown in the figure) is further configured to receive a fifth notification message sent by the Zookeeper, where the fifth notification message includes proxy information of the second plurality of Codis proxies;
the processing unit 330 is further configured to take the first Codis agent as a backup Codis agent from Codis agents indicated by agent information of the second number of Codis agents;
and the fifth notification message is sent after the Zookeeper determines that the first Codis agent has recovered from faults.
Therefore, by applying the communication device provided by the application, when the first communication connection fails, the CP acquires locally stored proxy information of a plurality of backup Codis proxies, each proxy information including an IP address and port information of the Codis proxy; according to the IP address and port information of each backup Codis agent, the CP establishes communication connection with each backup Codis agent respectively; when the second communication connection is successfully established with the second Codis agent, the CP stops establishing communication connection with other backup Codis agents except the second Codis agent in the plurality of backup Codis agents, the second Codis agent is used as a main agent, and the first Codis agent and the other backup Codis agents are used as backup Codis agents; and the CP and the RMDB perform backup and recovery of the user data through the second Codis agent.
Thus, communication connection is established and maintained between the CP and a plurality of standby Codis agents stored locally, the CP does not depend on a Zookeeper any more, a connection establishment mechanism of the Codis agents is preferentially ensured, and when the communication connection with a certain Codis agent fails, the backup and recovery functions of user data are continuously available by using the RMDB.
Based on the same inventive concept, the present embodiment also provides a network device, as shown in fig. 4, including a processor 410, a transceiver 420, and a machine-readable storage medium 430, where the machine-readable storage medium 430 stores machine-executable instructions capable of being executed by the processor 410, and the processor 410 is caused to perform the communication method provided by the present embodiment by the machine-executable instructions. The communication device shown in fig. 3 may be implemented by using a hardware structure of a network device as shown in fig. 4.
The computer readable storage medium 430 may include a random access Memory (in english: random Access Memory, abbreviated as RAM) or a nonvolatile Memory (in english: non-volatile Memory, abbreviated as NVM), such as at least one magnetic disk Memory. Optionally, the computer readable storage medium 430 may also be at least one storage device located remotely from the aforementioned processor 410.
The processor 410 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; it may also be a digital signal processor (English: digital Signal Processor; DSP; for short), an application specific integrated circuit (English: application Specific Integrated Circuit; ASIC; for short), a Field programmable gate array (English: field-Programmable Gate Array; FPGA; for short), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components.
In this embodiment, processor 410 is enabled by reading machine-executable instructions stored in machine-readable storage medium 430, which cause processor 410 itself to be implemented and transceiver 420 to perform the communication methods described in the embodiments of the present application.
Additionally, embodiments of the present application provide a machine-readable storage medium 430, the machine-readable storage medium 430 storing machine-executable instructions that, when invoked and executed by the processor 410, cause the processor 410 itself and the invoking transceiver 420 to perform the communication methods described in the embodiments of the present application previously.
The implementation process of the functions and roles of each unit in the above device is specifically shown in the implementation process of the corresponding steps in the above method, and will not be described herein again.
For the device embodiments, reference is made to the description of the method embodiments for the relevant points, since they essentially correspond to the method embodiments. The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purposes of the present application. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
For the communication device and the machine-readable storage medium embodiments, since the method content involved is substantially similar to the method embodiments described above, the description is relatively simple, and reference will only be made to part of the description of the method embodiments.
The foregoing description of the preferred embodiments of the present invention is not intended to limit the invention to the precise form disclosed, and any modifications, equivalents, improvements and alternatives falling within the spirit and principles of the present invention are intended to be included within the scope of the present invention.

Claims (8)

1. A communication method, wherein the method is applied to a CP, the CP establishes a first communication connection with a first Codis agent, the first Codis agent being a master agent, the method comprising:
when the first communication connection fails, acquiring locally stored proxy information of a plurality of backup Codis agents, wherein each proxy information comprises an IP address and port information of the Codis agent;
establishing communication connection with each backup Codis agent according to the IP address and port information of each backup Codis agent;
when the second communication connection is successfully established with the second Codis agent, stopping establishing communication connection with other backup Codis agents except the second Codis agent in the plurality of backup Codis agents, taking the second Codis agent as a main agent, and taking the first Codis agent and the other backup Codis agents as backup Codis agents;
backup and recovery of user data are carried out with the RMDB through the second Codis agent;
before the obtaining the locally stored plurality of backup Codis proxy information when the first communication connection fails, the method further includes:
acquiring agent information of a first number of Codis agents configured locally;
receiving a first notification message sent by a Zookeeper, wherein the first notification message comprises proxy information of a second number of Codis proxies;
determining a third number of intersection Codis agents according to the agent information of the first number of Codis agents and the agent information of the second number of Codis agents;
from the third number of intersection Codis agents, taking the first Codis agent as a main agent and the rest Codis agents except the first Codis agent as backup Codis agents;
establishing the first communication connection with the first Codis agent;
and carrying out backup and recovery of user data with the RMDB through the first Codis agent.
2. The method according to claim 1, wherein the method further comprises:
sending a second notification message to the Zookeeper, wherein the second notification message is used for enabling the Zookeeper to determine the CP replacement master agent;
when a third notification message sent by the Zookeeper is received and comprises the proxy information of a fourth number of Codis agents, determining a fifth number of intersection Codis agents according to the proxy information of the first number of Codis agents and the proxy information of the fourth number of Codis agents;
taking the Codis agents indicated by the agent information of the fifth number of Codis agents as backup Codis agents;
the third notification message is sent after the Zookeeper determines that the first Codis agent fails according to the second notification message, and the agent information of the fourth number of Codis agents does not include the agent information of the first Codis agent.
3. The method according to claim 2, wherein the method further comprises:
when a fourth known message sent by the Zookeeper is received and comprises the proxy information of the second number of Codis proxies, periodically initiating establishment of the first communication connection with the first Codis proxy from Codis proxies indicated by the proxy information of the second number of Codis proxies;
taking the first Codis agent as a backup Codis agent;
and the fourth notification message is sent after the Zookeeper determines that the first Codis agent has not failed according to the second notification message.
4. The method according to claim 2, wherein the method further comprises:
receiving a fifth notification message sent by the Zookeeper, wherein the fifth notification message comprises proxy information of the second number of Codis proxies;
taking the first Codis agent as a backup Codis agent from Codis agents indicated by agent information of the second number of Codis agents;
and the fifth notification message is sent after the Zookeeper determines that the first Codis agent has recovered from faults.
5. A communication apparatus, the apparatus being applied to a CP, the CP establishing a first communication connection with a first Codis agent, the first Codis agent being a master agent, the apparatus comprising:
an obtaining unit, configured to obtain locally stored proxy information of a plurality of backup Codis agents when the first communication connection fails, where each proxy information includes an IP address and port information of the Codis agent;
the establishing unit is used for respectively establishing communication connection with each backup Codis agent according to the IP address and the port information of each backup Codis agent;
the processing unit is used for stopping establishing communication connection with other backup Codis agents except the second Codis agent in the plurality of backup Codis agents when the second communication connection is successfully established with the second Codis agent, taking the second Codis agent as a main agent, and taking the first Codis agent and the other backup Codis agents as backup Codis agents;
the backup recovery unit is used for carrying out backup and recovery of the user data with the RMDB through the second Codis agent;
the obtaining unit is further used for obtaining the agent information of the first number of Codis agents configured locally;
the apparatus further comprises:
a receiving unit, configured to receive a first notification message sent by a Zookeeper, where the first notification message includes proxy information of a second number of Codis proxies;
a determining unit configured to determine a third number of intersection Codis agents according to the agent information of the first number of Codis agents and the agent information of the second number of Codis agents;
the processing unit is further configured to take the first Codis agent as a master agent and the remaining Codis agents except the first Codis agent as backup Codis agents from the third number of intersection Codis agents;
the establishing unit is further configured to establish the first communication connection with the first Codis agent;
the backup restoring unit is further used for carrying out backup and restoration of the user data with the RMDB through the first Codis agent.
6. The apparatus of claim 5, wherein the apparatus further comprises:
a sending unit, configured to send a second notification message to the Zookeeper, where the second notification message is used to cause the Zookeeper to determine that the CP replaces a master agent;
the determining unit is further configured to determine, when a third notification message sent by the Zookeeper is received and the third notification message includes proxy information of a fourth number of Codis proxies, a fifth number of intersection Codis proxies according to the proxy information of the first number of Codis proxies and the proxy information of the fourth number of Codis proxies;
the processing unit is further configured to take, as a backup Codis agent, a Codis agent indicated by agent information of the fifth number of Codis agents;
the third notification message is sent after the Zookeeper determines that the first Codis agent fails according to the second notification message, and the agent information of the fourth number of Codis agents does not include the agent information of the first Codis agent.
7. The apparatus of claim 6, wherein the establishing unit is further configured to periodically initiate establishment of the first communication connection with the first Codis agent from amongst Codis agents indicated by the proxy information of the second plurality of Codis agents when a fourth notification message sent by the Zookeeper is received and the fourth notification message includes the proxy information of the second plurality of Codis agents;
the processing unit is further configured to use the first Codis agent as a backup Codis agent;
and the fourth notification message is sent after the Zookeeper determines that the first Codis agent has not failed according to the second notification message.
8. The apparatus of claim 6, wherein the receiving unit is further configured to receive a fifth notification message sent by the Zookeeper, the fifth notification message including proxy information for the second number of Codis proxies;
the processing unit is further configured to take the first Codis agent as a backup Codis agent from Codis agents indicated by agent information of the second number of Codis agents;
and the fifth notification message is sent after the Zookeeper determines that the first Codis agent has recovered from faults.
CN202110889166.3A 2021-08-04 2021-08-04 Communication method and device Active CN113746902B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110889166.3A CN113746902B (en) 2021-08-04 2021-08-04 Communication method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110889166.3A CN113746902B (en) 2021-08-04 2021-08-04 Communication method and device

Publications (2)

Publication Number Publication Date
CN113746902A CN113746902A (en) 2021-12-03
CN113746902B true CN113746902B (en) 2023-06-16

Family

ID=78730047

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110889166.3A Active CN113746902B (en) 2021-08-04 2021-08-04 Communication method and device

Country Status (1)

Country Link
CN (1) CN113746902B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108075987A (en) * 2016-11-17 2018-05-25 华为技术有限公司 A kind of multi-path data transmission method and equipment

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004173136A (en) * 2002-11-22 2004-06-17 Fujitsu Ltd Network management device
WO2009089786A1 (en) * 2008-01-07 2009-07-23 Huawei Technologies Co., Ltd. Wireless network system and communication method thereof
WO2012071695A1 (en) * 2010-11-29 2012-06-07 华为技术有限公司 Node fault processing method, system and related device
US9128902B2 (en) * 2013-04-25 2015-09-08 Netapp, Inc. Systems and methods for managing disaster recovery in a storage system
US11283672B2 (en) * 2018-05-25 2022-03-22 Juniper Networks, Inc. Forwarding detection of an aggregated interface
CN109446178A (en) * 2018-11-13 2019-03-08 郑州云海信息技术有限公司 A kind of Hadoop object storage high availability method, system, device and readable storage medium storing program for executing

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108075987A (en) * 2016-11-17 2018-05-25 华为技术有限公司 A kind of multi-path data transmission method and equipment

Also Published As

Publication number Publication date
CN113746902A (en) 2021-12-03

Similar Documents

Publication Publication Date Title
US11799793B2 (en) Adaptive private network with dynamic conduit process
CN110535676B (en) SMF dynamic disaster tolerance realization method, device, equipment and storage medium
US20050204214A1 (en) Distributed montoring in a telecommunications system
CN106657259B (en) Routing server and routing service method for server cluster
CN111447101B (en) Link detection method, device, computer equipment and storage medium
EP3132567B1 (en) Event processing in a network management system
WO2018103665A1 (en) L2tp-based device management method, apparatus and system
CN111327650A (en) Data transmission method, device, equipment and storage medium
CN102055605B (en) Disaster tolerance system and method applied to AAA (authentication, authorization and accounting) server
CN109412980B (en) BRAS backup method and device
CN113037599A (en) Message processing method, device and storage medium
WO2017000625A1 (en) Dynamic host configuration protocol (dhcp) server management method and apparatus
CN109150711B (en) Protection switching method, device and storage medium for point-to-multipoint two-layer multicast service
CN113746902B (en) Communication method and device
CN104272789A (en) Mobile communication system, call processing node, and communication control method
CN115801642B (en) RDMA communication management module, method, equipment and medium based on state control
CN108337118B (en) Message forwarding method and device
CN113794641B (en) Message processing method and device
CN106559234B (en) Control message sending method and device
US7894459B2 (en) Determining availability of a network service
CN108768798B (en) Equipment access method and device
CN109327339B (en) Message processing method and device
CN113821334A (en) Method, device and system for configuring edge side equipment
CN114095342B (en) Backup realization method and device
CN107959603B (en) Forwarding control method and 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
GR01 Patent grant
GR01 Patent grant