CN113746902A - Communication method and device - Google Patents

Communication method and device Download PDF

Info

Publication number
CN113746902A
CN113746902A CN202110889166.3A CN202110889166A CN113746902A CN 113746902 A CN113746902 A CN 113746902A CN 202110889166 A CN202110889166 A CN 202110889166A CN 113746902 A CN113746902 A CN 113746902A
Authority
CN
China
Prior art keywords
codis
agent
backup
agents
proxy
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.)
Granted
Application number
CN202110889166.3A
Other languages
Chinese (zh)
Other versions
CN113746902B (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 a device, and the method comprises the following steps: when the first communication connection is failed, acquiring locally stored agent information of a plurality of backup Codis agents, wherein each agent 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 the 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 backing up and recovering the user data with the RMDB through a second Codis agent.

Description

Communication method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a communication method and apparatus.
Background
A Broadband Remote Access Server (BRAS) is a product of metropolitan area network service evolution, and a user terminal has no authentication and authorization management under the condition that only an Access device and a backbone router exist in the metropolitan area network, which is not good for network operation management and long-term development. After the BRAS is introduced between the access device and the backbone router, the BRAS serves as an access gateway of network services, provides broadband access, authentication, authorization and charging, manages user bandwidth, converges user service traffic, terminates user PPPOE connection and the like for the user terminal, and provides various service services.
With the development of virtualization, a vbars after the control transfer separation of the BRAS gradually becomes the mainstream of operator deployment. The vbars system mainly includes two parts, namely a Control Plane (CP) and a forwarding Plane (UP). The CP is positioned as a user control management component, and mainly includes: user control management, user access control, user authentication authorization charging, address management and other functional modules; UP is positioned as a three-layer network edge and user policy enforcement component, mainly comprising: forwarding plane functions such as traffic forwarding, QoS, traffic statistics, etc., and pipe-like control plane functions such as unicast routing protocol, multicast routing protocol, MPLS (LDP/TE), etc.
In the forwarding and control separation networking, due to the reasons of equipment failure, equipment elastic expansion and contraction during user tide, equipment upgrading and the like, user data of user terminals such as PPPoE, IPoE and the like need to be migrated between vBRAS equipment. A Remote Database (RMDB) is a backup technology applied in forwarding and control separation networking. The data backup and recovery are realized by a Remote Dictionary service (Redis), and the problem of user data migration can be well solved.
Currently, the process of implementing user data migration through RMDB is as follows: the remote database function, i.e., RMDB module, is turned on within the CP. Configuring IP addresses and port information of one or more distributed application coordination services (Zookeeper) in the RMDB module; and the RMDB module respectively tries to establish connection with one or more Zookeeper according to the configured time sequence until the connection is successfully established with a certain Zookeeper. The RMDB module obtains the proxy information of an available Codis proxy from the Zookeeper, wherein the proxy information comprises the IP address and the port information of the Codis proxy. The RMDB module sends information such as the IP address and port of the Codis proxy to each service module included in the CP.
After receiving information such as IP address and port of the Codis agent, each service module actively establishes connection with the Codis agent. Subsequently, each service module is connected with the Codis agent according to the requirement, and the backup and the 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 connection information of the available Codis agent again and return the connection information to the RMDB module, and the RMDB module can perform backup and recovery operation of user data after establishing connection with the Codis agent again. This results in the service modules not being able to use the RMDB during the connection recovery period.
Disclosure of Invention
In view of the above, the present application provides a communication method and apparatus, so as to solve the problem that the RMDB cannot be used in the connection recovery period between each service module and the Codis proxy in the prior art.
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 proxy, and the first Codis proxy is a master proxy, where the method includes:
when the first communication connection is failed, acquiring locally stored agent information of a plurality of backup Codis agents, wherein each agent 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 the port information of each backup Codis agent;
when a second communication connection is successfully established with a second Codis agent, stopping establishing communication connection with other backup Codis agents except the second Codis agent in a 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 backing up and recovering 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 proxy, and the first Codis proxy is a master proxy, where the apparatus includes:
an obtaining unit, configured to obtain locally stored proxy information of multiple backup Codis agents when the first communication connection fails, where each proxy information includes an IP address and port information of a 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 successfully establishing second communication connection 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 performing backup and recovery on 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, the processor being caused by the machine-executable instructions to perform the method provided by 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 obtains locally stored agent information of a plurality of backup Codis agents, wherein each agent information comprises an IP address and port information of a Codis agent; according to the IP address and the port information of each backup Codis agent, the CP respectively establishes communication connection with each backup Codis agent; 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 backing up and recovering the user data through the second Codis agent, the CP and the RMDB.
Therefore, communication connection is established and maintained between the CP and a plurality of backup Codis agents stored locally, the CP does not depend on Zookeeper, the connection establishment mechanism of the Codis agents is preferentially ensured, and the continuous availability of the backup and recovery functions of user data by utilizing the RMDB is ensured when the communication connection with a certain Codis agent fails.
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 disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent 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 certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the 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 should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the corresponding listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The following describes the communication method provided in the embodiments of the present application in detail. Referring to fig. 1, fig. 1 is a flowchart of a communication method according to an embodiment of the present disclosure. The method is applied to the CP, and the communication method provided by the embodiment of the present application may include the following steps.
Step 110, when the first communication connection is failed, obtaining agent information of a plurality of backup Codis agents stored locally, wherein each agent information comprises an IP address and port information of a Codis agent.
Specifically, as shown in fig. 2, fig. 2 is a schematic diagram of communication between devices according to an embodiment of the present application.
The remote database function, i.e., RMDB module, is turned on within the CP. And configuring the IP addresses and port information of one or more Zookeeper 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 within the RMDB module.
Meanwhile, proxy information of a first number (e.g., three) of Codis proxies is also configured in the RMDB module, and the proxy information includes IP addresses and port information of the Codis proxies. As shown in table 1.
Table 1Codis proxy information
Codis agent 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
And the RMDB module respectively tries to establish connection with three Zookeeper according to the configured time sequence until the connection with a certain Zookeeper is successfully established. In the embodiment of the present application, the CP successfully establishes a connection with Zookeeper 1.
A Codis cluster management interface (Codis-fe) issues a Codis agent deployment to a Codis management tool (Codis-dashboard), that is, several Codis agents are deployed in the current network. The Codis management tool deploys the Codis agents in the current network and issues configuration to each Codis agent. In the embodiment of the present application, three Codis agents are deployed. Such as Codis agent 1, Codis agent 2, and Codis agent 3.
It can be understood that Zookeeper1 obtains and stores proxy information of each Codis proxy deployed in the current network, and the proxy information includes IP address and port information of the Codis proxy. The process of Zookeeper1 obtaining proxy information is prior art and will not be repeated again. For example, the proxy information is configured locally by issuing a configuration instruction to the Zookeeper.
After the RMDB module establishes a connection with Zookeeper1, Zookeeper1 generates a first notification message, where the first notification message includes proxy information of a second number (e.g., three) of Codis proxies. The first notification message includes agent information of the Codis agent 1, the Codis agent 2, and the Codis agent 3.
Zookeeper1 sends a first notification message to the RMDB module.
After receiving the first notification message, the RMDB module obtains the proxy information of the Codis proxy 1, the Codis proxy 2, and the Codis proxy 3. The RMDB module compares the obtained proxy information of the plurality of Codis proxies with the locally configured proxy information of the plurality of Codis proxies, and obtains a third number (e.g., three) of intersecting Codis proxies.
In the embodiment of the present application, the intersection cadis proxy 1, cadis proxy 2, and cadis proxy 3.
The RMDB module selects one Codis proxy as a main proxy from the Codis proxies 1, 2 and 3 according to the preferred strategy of local configuration, and the rest Codis proxies except the main proxy are used as backup Codis proxies. The RMDB module stores the agent information according to each Codis agent to the local by role.
The preferred policy may specifically be to select a master agent by using the size of the IP address. For example, the Codis agent with the largest IP address of the three Codis agents serves as a main agent, and the rest Codis agents serve as backup Codis agents. In the embodiment of the application, the RMDB module selects the Codis agent 1 as the master agent, and the Codis agents 2 and 3 as the backup Codis agents.
The RMDB module establishes a first communication connection with the Codis proxy 1. And backing up and recovering user data with the RMDB through the first Codis agent. Meanwhile, the RMDB module also transmits the proxy information of the Codis proxy 1 to the service module included in the CP. After receiving the agent information of the Codis agent 1, each service module actively establishes connection with the Codis agent 1. Subsequently, each service module is connected with the Codis agent 1 according to the requirement, and the backup and the recovery of the user data are carried out with the RMDB.
When the first communication connection fails, the RMDB module acquires agent information of a plurality of backup Codis agents stored locally. That is, the RMDB module acquires the proxy information of the Codis proxy 2 and the Codis proxy 3.
And step 120, establishing communication connection with each backup Codis agent according to the IP address and the port information of each backup Codis agent.
Specifically, according to the description in step 110, after the RMDB module obtains the agent information of the multiple backup Codis agents, the RMDB module establishes communication connection with each backup Codis agent according to the agent information of each backup Codis agent. That is, according to the proxy information of the Codis proxy 2 and the Codis proxy 3, the RMDB module establishes communication connection with the Codis proxy 2 and the Codis proxy 3, respectively.
Step 130, 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 among 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.
Specifically, according to the description of step 120, when the RMDB successfully establishes the second communication connection with the Codis proxy 2 during the establishment of the communication connection with the Codis proxy 2 and the Codis proxy 3, the RMDB module stops establishing the communication connection with the Codis proxy 3.
In this case, the RMDB module uses the Codis proxy 2 as the master proxy and the Codis proxies 1 and 3 as backup Codis proxies.
And step 140, performing backup and recovery of user data with the RMDB through the second Codis agent.
Specifically, according to the description of step 130, after the RMDB selects the Codis proxy 2 as the master proxy, the Codis proxy 2 performs backup and recovery of user data with the RMDB.
Therefore, by applying the communication method provided by the present application, when the first communication connection fails, the CP obtains locally stored proxy information of a plurality of backup Codis proxies, where each proxy information includes an IP address and port information of a Codis proxy; according to the IP address and the port information of each backup Codis agent, the CP respectively establishes communication connection with each backup Codis agent; 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 backing up and recovering the user data through the second Codis agent, the CP and the RMDB.
Therefore, communication connection is established and maintained between the CP and a plurality of backup Codis agents stored locally, the CP does not depend on Zookeeper, the connection establishment mechanism of the Codis agents is preferentially ensured, and the continuous availability of the backup and recovery functions of user data by utilizing the RMDB is ensured when the communication connection with a certain Codis agent fails.
Optionally, in this embodiment of the present application, a process 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 module generates a second notification message after replacing the master agent. The RMDB module sends a second notification message to the Zookeeper1 that is accessed, so that after receiving the second notification message, the Zookeeper1 determines that the CP in which the RMDB module is located has replaced the master agent.
It is to be understood that the second notification message further includes agent information of the master agent before replacement and agent information of the master agent after replacement, and the Zookeeper1 obtains the agent information of the master agent before replacement and the agent information of the master agent after replacement from the second notification message. And traversing the Codis proxy locally by the Zookeeper1, and judging whether the Codis proxy fault exists currently.
In a possible implementation manner, if the Zookeeper1 determines that the current Codis replaced by a Codis proxy 1, and the Codis proxy 1 is the master proxy before the RMDB module is replaced by the CP, the Zookeeper1 generates a third notification message, where the third notification message includes proxy information of a fourth number of Codis proxies, and the proxy information of the fourth number of Codis proxies does not include proxy information of the first Codis.
That is, in the embodiment of the present application, the third notification message includes the proxy information of the Codis proxy 2 and the Codis proxy 3, and does not include the proxy information of the Codis proxy 1.
Zookeeper1 sends a third notification message to the RMDB module.
And after receiving the third notification message, the RMDB module acquires the proxy information of the Codis proxy 2 and the Codis proxy 3 from the third notification message. And determining a fifth number of intersection Codis agents according to the agent information of the locally configured Codis agents and the agent information of the Codis agents included in the third notification message, wherein the Codis agents 3 are intersection Codis agents.
The RMDB module takes the Codis agent 3 indicated by the agent information of the fifth number of Codis agents as a backup Codis agent.
In another possible implementation manner, if the Zookeeper1 determines that the current Codis proxy 1 does not fail, and the Codis proxy 1 is the master proxy before the RMDB module is replaced with the CP, the Zookeeper1 generates a fourth notification message, where the fourth notification message includes proxy information of a second number of Codis proxies.
That is, in the embodiment of the present application, the fourth notification message includes the proxy information of the Codis proxy 1, the Codis proxy 2, and the Codis proxy 3.
Zookeeper1 sends a fourth notification message to the RMDB module.
And after receiving the fourth notification message, the RMDB module acquires the proxy information of the Codis proxy 1, the Codis proxy 2 and the Codis proxy 3 from the fourth notification message.
It is to be appreciated that through the fourth notification message, the RMDB module may determine that the Codis agent 1 did not fail at Zookeeper 1. At this time, the Codis proxy 2 is still the main proxy, and the RMDB module may periodically initiate establishment of the first communication connection with the Codis proxy 1, and use the Codis proxy 1 as the backup Codis proxy, while the Codis proxy 3, which has previously been the backup Codis proxy, is still the backup Codis proxy.
If the RMDB module successfully establishes the first communication connection with the Codis proxy 1 again, the RMDB module may upgrade the Codis proxy 1 to the primary proxy again, and downgrade the Codis proxy 2 to the backup Codis proxy.
Optionally, in this embodiment of the present application, the method further includes a process in which the Zookeeper connected to the CP sends the notification message after determining that the failure of the first Codis recovered.
Specifically, Zookeeper1 periodically probes the state of locally configured Codis agents. If the Zookeeper1 determines that the state of the current Codis agent 1 has been restored from the failure state to the normal state, the Zookeeper1 generates a fifth notification message, where the fifth notification message includes agent information of a 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.
Zookeeper1 sends a fifth notification message to the RMDB module.
And after receiving the fifth notification message, the RMDB module acquires the proxy information of the Codis proxy 1, the Codis proxy 2, and the Codis proxy 3 from the fifth notification message.
It is to be appreciated that through the fifth notification message, the RMDB module may determine that the Codis agent 1 has recovered from the failed state to the normal state at Zookeeper 1. At this time, the Codis proxy 2 is still the main proxy, and the RMDB module uses the Codis proxy 1 as the backup Codis proxy, while the Codis proxy 3, which has previously been the backup Codis proxy, is still the backup Codis proxy.
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 main agent, and the device comprises:
an obtaining unit 310, configured to obtain locally stored proxy information of multiple backup Codis agents when the first communication connection fails, where each proxy information includes an IP address and port information of a Codis agent;
the establishing unit 320 is configured to respectively establish communication connection with each backup Codis agent according to the IP address and the 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 a communication connection with a backup Codis agent other than the second Codis agent among a plurality of backup Codis agents, use the second Codis agent as a main agent, and use the first Codis agent and the other backup Codis agents as backup Codis agents;
and a backup and recovery unit 340, configured to perform backup and recovery of user data with the RMDB through the second Codis agent.
Optionally, the obtaining unit 310 is further configured to obtain agent information of a first number of locally configured Codis agents;
the device further comprises:
a receiving unit (not shown in the figure), 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 (not shown in the figure), configured to determine a third number of intersecting Codis proxies according to the proxy information of the first number of Codis proxies and the proxy information of the second number of Codis proxies;
the processing unit 330 is further configured to, from among the third number of intersecting Codis proxies, use the first Codis proxy as a main proxy, and use the remaining Codis proxies except for the first Codis proxy as backup Codis proxies;
the establishing unit 320 is further configured to establish the first communication connection with the first Codis agent;
the backup and recovery unit 340 is further configured to perform backup and recovery of user data with the RMDB through the first Codis agent.
Optionally, the apparatus further comprises:
a sending unit (not shown in the figure), configured to send a second notification message to the Zookeeper, where the second notification message is used for the Zookeeper to determine the CP replacement master agent;
the determining unit (not shown in the figure) is further configured to, 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, determine a fifth number of intersecting 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 330 is further configured to use the Codis agent indicated by the agent information of the fifth number of Codis agents as a backup Codis agent;
and the third notification message is sent by the Zookeeper after determining that the first Codis proxied to fail according to the second notification message, and the proxy information of the fourth number of Codis proxied does not include the proxy information of the first Codis proxied.
Optionally, the establishing unit 320 is further configured to, when receiving a fourth notification message sent by the Zookeeper and the fourth notification message includes the proxy information of the second number of Codis proxies, periodically initiate establishment of the first communication connection with the first Codis proxy from the Codis proxies indicated by the proxy information of the second number of Codis proxies;
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 by the Zookeeper after determining that the first Codis agent does not fail 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 number of Codis proxies;
the processing unit 330 is further configured to, from the Codis proxies indicated by the proxy information of the second number of Codis proxies, take the first Codis proxy as a backup Codis proxy;
and the fifth notification message is sent after determining that the first Codis agent has recovered for the Zookeeper.
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, wherein each proxy information comprises an IP address and port information of a Codis proxy; according to the IP address and the port information of each backup Codis agent, the CP respectively establishes communication connection with each backup Codis agent; 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 backing up and recovering the user data through the second Codis agent, the CP and the RMDB.
Therefore, communication connection is established and maintained between the CP and a plurality of backup Codis agents stored locally, the CP does not depend on Zookeeper, the connection establishment mechanism of the Codis agents is preferentially ensured, and the continuous availability of the backup and recovery functions of user data by utilizing the RMDB is ensured when the communication connection with a certain Codis agent fails.
Based on the same inventive concept, the present application further 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 by the machine-executable instructions to perform the communication method provided by the present application. The communication apparatus shown in fig. 3 can be implemented by using the hardware structure of the network device shown in fig. 4.
The computer-readable storage medium 430 may include a Random Access Memory (RAM) or a Non-volatile Memory (NVM), such as at least one disk Memory. Alternatively, the computer-readable storage medium 430 may also be at least one memory device located remotely from the processor 410.
The Processor 410 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; the Integrated Circuit can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In the embodiment of the present application, the processor 410 is caused by machine executable instructions by reading the machine executable instructions stored in the machine readable storage medium 430 to enable the processor 410 itself and the call transceiver 420 to perform the communication method described in the embodiment 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 embodiments of the present application.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
As for the embodiments of the communication apparatus and the machine-readable storage medium, since the contents of the related methods are substantially similar to those of the foregoing embodiments of the methods, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the embodiments of the methods.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (10)

1. A communication method is applied to a CP (provider control point), the CP establishes a first communication connection with a first Codis agent, and the first Codis agent is a main agent, and the method comprises the following steps:
when the first communication connection is failed, acquiring locally stored agent information of a plurality of backup Codis agents, wherein each agent 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 the port information of each backup Codis agent;
when a second communication connection is successfully established with a second Codis agent, stopping establishing communication connection with other backup Codis agents except the second Codis agent in a 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 backing up and recovering the user data with the RMDB through the second Codis agent.
2. The method according to claim 1, wherein before obtaining the locally stored backup Codis agent information when the first communication connection fails, the method further comprises:
acquiring agent information of a first number of locally configured Codis agents;
receiving a first notification message sent by a Zookeeper, wherein the first notification message comprises agent information of a second number of Codis agents;
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 taking the rest Codis agents except the first Codis agent as backup Codis agents;
establishing the first communication connection with the first Codis agent;
and backing up and recovering user data with the RMDB through the first Codis agent.
3. The method of claim 2, further comprising:
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 the third notification message comprises agent information of a fourth number of Codis agents, determining a fifth number of intersection Codis agents according to the agent information of the first number of Codis agents and the agent information of the fourth number of Codis agents;
taking the Codis agents indicated by the agent information of the Codis agents with the fifth number as backup Codis agents;
and the third notification message is sent by the Zookeeper after determining that the first Codis proxied to fail according to the second notification message, and the proxy information of the fourth number of Codis proxied does not include the proxy information of the first Codis proxied.
4. The method of claim 3, further comprising:
when a fourth notification message sent by the Zookeeper is received and the fourth notification message comprises proxy information of the second number of Codis proxies, periodically initiating the establishment of the first communication connection with the first Codis proxy from the 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 by the Zookeeper after determining that the first Codis agent does not fail according to the second notification message.
5. The method of claim 3, further comprising:
receiving a fifth notification message sent by the Zookeeper, wherein the fifth notification message includes proxy information of the second number of Codis proxies;
taking the first Codis agent as a backup Codis agent from the Codis agents indicated by the agent information of the second number of Codis agents;
and the fifth notification message is sent after determining that the first Codis agent has recovered for the Zookeeper.
6. A communications apparatus, applied to a CP, the CP establishing a first communication connection with a first Codis proxy, the first Codis proxy being a master proxy, the apparatus comprising:
an obtaining unit, configured to obtain locally stored proxy information of multiple backup Codis agents when the first communication connection fails, where each proxy information includes an IP address and port information of a 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 successfully establishing second communication connection 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 performing backup and recovery on user data with the RMDB through the second Codis agent.
7. The apparatus according to claim 6, wherein the obtaining unit is further configured to obtain agent information of a first number of locally configured Codis agents;
the device 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;
the determining unit is used for 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;
the processing unit is further configured to, from among the third number of intersecting Codis proxies, take the first Codis proxy as a main proxy, and take the remaining Codis proxies except the first Codis proxy as backup Codis proxies;
the establishing unit is further configured to establish the first communication connection with the first Codis agent;
the backup and recovery unit is further configured to perform backup and recovery of user data with the RMDB through the first Codis agent.
8. The apparatus of claim 7, further comprising:
a sending unit, configured to send a second notification message to the Zookeeper, where the second notification message is used for enabling the Zookeeper to determine the CP replacement master agent;
the determining unit is further configured to, 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, determine a fifth number of intersecting 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 use the Codis agent indicated by the agent information of the fifth number of Codis agents as a backup Codis agent;
and the third notification message is sent by the Zookeeper after determining that the first Codis proxied to fail according to the second notification message, and the proxy information of the fourth number of Codis proxied does not include the proxy information of the first Codis proxied.
9. The apparatus according to claim 8, wherein the establishing unit is further configured to, when receiving a fourth notification message sent by the Zookeeper and the fourth notification message includes the proxy information of the second number of Codis proxies, periodically initiate establishment of the first communication connection with the first Codis proxy from the Codis proxies indicated by the proxy information of the second number of Codis proxies;
the processing unit is further configured to use the first Codis agent as a backup Codis agent;
and the fourth notification message is sent by the Zookeeper after determining that the first Codis agent does not fail according to the second notification message.
10. The apparatus according to claim 8, wherein the receiving unit is further configured to receive a fifth notification message sent by the Zookeeper, where the fifth notification message includes proxy information of the second number of Codis proxies;
the processing unit is further configured to, from the Codis proxies indicated by the proxy information of the second number of Codis proxies, take the first Codis proxy as a backup Codis proxy;
and the fifth notification message is sent after determining that the first Codis agent has recovered for the Zookeeper.
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 true CN113746902A (en) 2021-12-03
CN113746902B 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 (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040103210A1 (en) * 2002-11-22 2004-05-27 Yasuki Fujii Network management apparatus
WO2009089786A1 (en) * 2008-01-07 2009-07-23 Huawei Technologies Co., Ltd. Wireless network system and communication method thereof
CN102714615A (en) * 2010-11-29 2012-10-03 华为技术有限公司 Node fault processing method, system and related device
US20140325256A1 (en) * 2013-04-25 2014-10-30 Netapp, Inc. Systems and methods for managing disaster recovery in a storage system
CN108075987A (en) * 2016-11-17 2018-05-25 华为技术有限公司 A kind of multi-path data transmission method and equipment
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
CN110535760A (en) * 2018-05-25 2019-12-03 丛林网络公司 The forwarding of aggregation interface detects

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040103210A1 (en) * 2002-11-22 2004-05-27 Yasuki Fujii Network management apparatus
WO2009089786A1 (en) * 2008-01-07 2009-07-23 Huawei Technologies Co., Ltd. Wireless network system and communication method thereof
CN102714615A (en) * 2010-11-29 2012-10-03 华为技术有限公司 Node fault processing method, system and related device
US20140325256A1 (en) * 2013-04-25 2014-10-30 Netapp, Inc. Systems and methods for managing disaster recovery in a storage system
CN108075987A (en) * 2016-11-17 2018-05-25 华为技术有限公司 A kind of multi-path data transmission method and equipment
CN110535760A (en) * 2018-05-25 2019-12-03 丛林网络公司 The forwarding of aggregation interface detects
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

Also Published As

Publication number Publication date
CN113746902B (en) 2023-06-16

Similar Documents

Publication Publication Date Title
US11323307B2 (en) Method and system of a dynamic high-availability mode based on current wide area network connectivity
CN112868206A (en) Method, system and computer readable medium for providing service broker functionality in a telecommunications network core using a service based architecture
CN101729426B (en) Method and system for quickly switching between master device and standby device of virtual router redundancy protocol (VRRP)
CN109861867B (en) MEC service processing method and device
CN111447101B (en) Link detection method, device, computer equipment and storage medium
WO2018103665A1 (en) L2tp-based device management method, apparatus and system
CN100563263C (en) In network storage service, realize the method and system of system high-available
CN109412980B (en) BRAS backup method and device
CN108900441B (en) Network switching method, first electronic device and readable storage medium
WO2007146473A2 (en) Method and system for distributing data processing units in a communication network
CN104618148A (en) Firewall device and backup method thereof
CN109379760B (en) MEC bypass system and method
CN113746902A (en) Communication method and device
CN110601989A (en) Network traffic balancing method and device
CN108337118B (en) Message forwarding method and device
CN113301159B (en) Service position obtaining method and device in edge computing system
US20050182763A1 (en) Apparatus and method for on-line upgrade using proxy objects in server nodes
CN108768798B (en) Equipment access method and device
CN109327339B (en) Message processing method and device
CN106559234B (en) Control message sending method and device
CN113821334A (en) Method, device and system for configuring edge side equipment
CN106992878B (en) Multicast detection method and device
CN114095342B (en) Backup realization method and device
CN102025549B (en) Backup transmission method and system for fixed network multi-protocol label switching virtual private network
US20050198022A1 (en) Apparatus and method using proxy objects for application resource management in a communication network

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