CN111245943A - Method for obtaining accessible IP address by Redis cluster - Google Patents
Method for obtaining accessible IP address by Redis cluster Download PDFInfo
- Publication number
- CN111245943A CN111245943A CN202010037828.XA CN202010037828A CN111245943A CN 111245943 A CN111245943 A CN 111245943A CN 202010037828 A CN202010037828 A CN 202010037828A CN 111245943 A CN111245943 A CN 111245943A
- Authority
- CN
- China
- Prior art keywords
- node
- redis cluster
- address
- client
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
- H04L67/63—Routing a service request depending on the request content or context
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
- H04L45/745—Address table lookup; Address filtering
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a method for a Redis cluster to acquire an accessible IP address, and belongs to the technical field of cloud computing. The method for acquiring the accessible IP address by the Redis cluster has the advantages that the redirection of the Redis cluster is processed by the node where the data is actually located, is not processed by the node receiving the instruction, and comprises a process that the Redis cluster node responds to the client and a process that the Redis cluster node processes and checks a new instruction. The method for acquiring the accessible IP address by the Redis cluster can effectively solve the problem of IP address mapping in a multilayer network without additional development on the client side and correctly redirecting the accessible IP address, and has good popularization and application values.
Description
Technical Field
The invention relates to the technical field of cloud computing, and particularly provides a method for a Redis cluster to acquire an accessible IP address.
Background
With the gradual rise and large-scale use of the Redis, the standalone Redis is already limited by the development of hardware technology from the aspects of storage capacity, computing pressure and bandwidth, and even the highest specification hardware storage and bandwidth in the market cannot meet the application scenes of hundreds of GB and even TB levels, so that the Redis cluster is produced and is the best solution for the large-scale Redis application scenes from the aspects of expansion capacity and data carrying capacity. Although there are many Redis clustering schemes on the market, the official clustering scheme is very excellent in terms of support and design, but the official scheme has a significant redirection problem in an environment with a multi-layer network, and when a node is in a network with more than 2 layers across a gateway or a cluster as a whole, a returned address is sometimes not directly accessible to a client, which requires that the Redis cluster and the client must be deployed on the same network plane, and the client wants to reconnect in the multi-layer network, an IP address to be connectable by pre-stored data, and how to solve these problems becomes a difficult problem in order to provide more general services for users.
Disclosure of Invention
The technical task of the present invention is to provide a method for a Redis cluster to obtain an accessible IP address, which can correctly redirect to the accessible address without additional development on a client, can effectively solve the IP address mapping problem in a multi-layer network, and can quickly respond when a data node address changes.
In order to achieve the purpose, the invention provides the following technical scheme:
a method for obtaining accessible IP address by Redis cluster includes processing redirection of Redis cluster by node where data is actually located, not processing redirection by node receiving instruction, including responding client by Redis cluster node and processing new instruction by Redis cluster node.
Preferably, the process of the Redis cluster node responding to the client specifically includes the following steps:
s1, the Redis cluster node receives the command data and calculates the check code of Key;
s2, judging whether the data is in the current node, if so, executing a step S3, otherwise, executing a step S4;
s3, returning data and executing the step S6;
s4, sending a connection IP address and a connection port of the query client network plane to the actual node;
s5, obtaining a node connection address and returning the node connection address to the client;
and S6, ending.
The Redis cluster node receives the command data, firstly calculates the check code of the key, then calculates which node the data exists in according to the fragmented data of the cluster, if the data just exists in the current node, the result is directly returned, otherwise, the connection IP address and the port of the network plane of the query client side are sent to the actual node, the data are returned to the client side after the node queries the address, and the client side performs further operation.
Preferably, the process of processing the new instruction at the Redis cluster node includes the following steps:
s7, the Redis cluster receives the query address instruction and analyzes the client address;
s8, acquiring a gateway address on the connection path by using route tracking;
s9, traversing the routing tables on all gateways according to the open routing table;
and S10, returning the outlet IP address and the port inquired on the data node to the client sending the instruction.
Preferably, in step S1, the Redis cluster node receives the query or modification command data, and calculates the check code CRC of Key.
Preferably, in step S4, an inquiry node connection command is sent and client information is sent to the node where the data is located.
Preferably, in step S7, the Redis cluster receives the network plane connection instruction of the query-specified client, and resolves the IP address of the client.
Preferably, in step S8, the platform intranet gateways on all paths are queried using route tracing.
Preferably, in step S9, the gateway query route is traversed, the actual network path is filtered, and the data node egress IP address closest to the client is obtained.
Preferably, in step S10, the connection information of the data node is returned to the node receiving and sending the query command.
When receiving a network plane connection instruction for inquiring the appointed client, the Redis analyzes the IP address of the client, acquires all gateway addresses on a connection path by using route tracking, traverses routing tables on all gateways according to an open routing table, filters out a path from a data node to an intranet outlet, returns the IP address and port of the outlet inquired on the data node to the client sending the instruction, and finishes the process.
Compared with the prior art, the method for acquiring the accessible IP address by the Redis cluster has the following outstanding advantages:
the method for acquiring the accessible IP address through the Redis cluster can effectively solve the problem of IP address mapping in a multilayer network without storing IP corresponding data in advance;
(II) when the address of the data node is changed, the response can be quickly carried out;
and (III) the client can be correctly redirected to the accessible address without additional development, so that the method has good popularization and application values.
Drawings
FIG. 1 is a process flow diagram of a Redis cluster node responding to a client according to the method for a Redis cluster to obtain an accessible IP address of the present invention;
fig. 2 is a flowchart of a process for processing a new instruction at a Redis cluster node of the method for acquiring an accessible IP address by a Redis cluster according to the present invention.
Detailed Description
The method for the Redis cluster to obtain the accessible IP address according to the present invention will be described in further detail with reference to the accompanying drawings and embodiments.
Examples
The method for acquiring the accessible IP address by the Redis cluster has the advantages that the redirection of the Redis cluster is processed by the node where the data is actually located, is not processed by the node receiving the instruction, and comprises a process that the Redis cluster node responds to the client and a process that the Redis cluster node processes and checks a new instruction.
As shown in fig. 1, a process of the Redis cluster node responding to the client specifically includes the following steps:
and S1, receiving the command data by the Redis cluster node, and calculating the check code of the Key.
And the Redis cluster node receives the query or modification command data and calculates the check code CRC of the Key.
S2, judging whether the data is at the current node, if yes, executing step S3, otherwise executing step S4.
S3, data is returned, and step S6 is executed.
S4, sending the connection IP address and the port of the query client network plane to the actual node.
And sending a connection instruction of the query node and sending client information to the node where the data is located.
And S5, obtaining the node connection address and returning the node connection address to the client.
And S6, ending.
The Redis cluster node receives the command data, firstly calculates the check code of the key, then calculates which node the data exists in according to the fragmented data of the cluster, if the data just exists in the current node, the result is directly returned, otherwise, the connection IP address and the port of the network plane of the query client side are sent to the actual node, the data are returned to the client side after the node queries the address, and the client side performs further operation.
As shown in fig. 2, the process of processing a new instruction at a Redis cluster node includes the following steps:
and S7, the Redis cluster receives the query address instruction and analyzes the client address.
And the Redis cluster receives a network plane connection instruction for inquiring the designated client and resolves the IP address of the client.
And S8, acquiring the gateway address on the connection path by using the route tracing. And querying the platform intranet gateways on all paths by using route tracking.
And S9, traversing the routing tables on all the gateways according to the open routing table.
And traversing the gateway to inquire the route, filtering out an actual network path and acquiring the IP address of the data node outlet closest to the client.
And S10, returning the outlet IP address and the port inquired on the data node to the client sending the instruction. And returning the connection information of the data node to the node for receiving and sending the query instruction.
When receiving a network plane connection instruction for inquiring the appointed client, the Redis analyzes the IP address of the client, acquires all gateway addresses on a connection path by using route tracking, traverses routing tables on all gateways according to an open routing table, filters out a path from a data node to an intranet outlet, returns the IP address and port of the outlet inquired on the data node to the client sending the instruction, and finishes the process.
The above-described embodiments are merely preferred embodiments of the present invention, and general changes and substitutions by those skilled in the art within the technical scope of the present invention are included in the protection scope of the present invention.
Claims (9)
1. A method for a Redis cluster to obtain an accessible IP address is characterized in that: in the method, the redirection of the Redis cluster is processed by the node where the data is actually located, and is not processed by the node receiving the instruction, and the redirection comprises a process that the Redis cluster node responds to the client and a process that the Redis cluster node processes a new instruction.
2. The method of Redis cluster for obtaining accessible IP addresses of claim 1, wherein: the process of the Redis cluster node responding to the client specifically comprises the following steps:
s1, the Redis cluster node receives the command data and calculates the check code of Key;
s2, judging whether the data is in the current node, if so, executing a step S3, otherwise, executing a step S4;
s3, returning data and executing the step S6;
s4, sending a connection IP address and a connection port of the query client network plane to the actual node;
s5, obtaining a node connection address and returning the node connection address to the client;
and S6, ending.
3. The method of Redis cluster for obtaining accessible IP addresses of claim 2, wherein: the process for processing the new checking instruction at the Redis cluster node comprises the following steps:
s7, the Redis cluster receives the query address instruction and analyzes the client address;
s8, acquiring a gateway address on the connection path by using route tracking;
s9, traversing the routing tables on all gateways according to the open routing table;
and S10, returning the outlet IP address and the port inquired on the data node to the client sending the instruction.
4. The method of Redis cluster for obtaining accessible IP addresses of claim 3, wherein: in step S1, the Redis cluster node receives the query or modification command data, and calculates the check code CRC of the Key.
5. The method of Redis cluster for obtaining accessible IP addresses of claim 4, wherein: in step S4, an inquiry node connection instruction is sent and client information is sent to the node where the data is located.
6. The method of Redis cluster for obtaining accessible IP addresses of claim 5, wherein: in step S7, the Redis cluster receives the network plane connection instruction of the query-specified client, and resolves the IP address of the client.
7. The method of Redis cluster for obtaining accessible IP addresses of claim 6, wherein: in step S8, platform intranet gateways on all paths are queried using route tracking.
8. The method of Redis cluster for obtaining accessible IP addresses of claim 7, wherein: in step S9, the gateway is traversed to query the route, filter out the actual network path, and obtain the data node exit IP address closest to the client.
9. The method of Redis cluster for obtaining accessible IP addresses of claim 8, wherein: in step S10, the connection information of the data node is returned to the node that receives and sends the query instruction.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010037828.XA CN111245943A (en) | 2020-01-14 | 2020-01-14 | Method for obtaining accessible IP address by Redis cluster |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010037828.XA CN111245943A (en) | 2020-01-14 | 2020-01-14 | Method for obtaining accessible IP address by Redis cluster |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111245943A true CN111245943A (en) | 2020-06-05 |
Family
ID=70876503
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010037828.XA Pending CN111245943A (en) | 2020-01-14 | 2020-01-14 | Method for obtaining accessible IP address by Redis cluster |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111245943A (en) |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110191389A1 (en) * | 2005-07-28 | 2011-08-04 | Vmware, Inc. | Distributed data management system |
US20120290719A1 (en) * | 2009-11-23 | 2012-11-15 | Inca Internet Co., Ltd. | Method for searching ip address of routing node in virtual private network environment |
CN103873497A (en) * | 2012-12-11 | 2014-06-18 | 中国电信股份有限公司 | Method, device and system for scheduling information |
CN104050249A (en) * | 2011-12-31 | 2014-09-17 | 北京奇虎科技有限公司 | Distributed query engine system and method and metadata server |
CN104156380A (en) * | 2014-03-04 | 2014-11-19 | 深圳信息职业技术学院 | Distributed memory Hash indexing method and system |
CN105159985A (en) * | 2015-08-31 | 2015-12-16 | 努比亚技术有限公司 | Data query device and method based on redis cluster |
CN107645508A (en) * | 2017-10-16 | 2018-01-30 | 深圳市买买提乐购金融服务有限公司 | A kind of data handling system, method, client and server |
US20180048587A1 (en) * | 2016-05-16 | 2018-02-15 | Yang Bai | Port switch service |
CN108206779A (en) * | 2016-12-16 | 2018-06-26 | 北京金山云网络技术有限公司 | A kind of cluster accesses system, method and device |
CN108416039A (en) * | 2018-03-14 | 2018-08-17 | 北京思特奇信息技术股份有限公司 | A kind of data query method and system |
CN109407980A (en) * | 2018-09-29 | 2019-03-01 | 武汉极意网络科技有限公司 | Data-storage system based on Redis cluster |
CN110048896A (en) * | 2019-04-29 | 2019-07-23 | 广州华多网络科技有限公司 | A kind of company-data acquisition methods, device and equipment |
CN110177007A (en) * | 2019-04-16 | 2019-08-27 | 平安科技(深圳)有限公司 | Realize gateway strange land method, apparatus, computer equipment and storage medium mostly living |
-
2020
- 2020-01-14 CN CN202010037828.XA patent/CN111245943A/en active Pending
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110191389A1 (en) * | 2005-07-28 | 2011-08-04 | Vmware, Inc. | Distributed data management system |
US20120290719A1 (en) * | 2009-11-23 | 2012-11-15 | Inca Internet Co., Ltd. | Method for searching ip address of routing node in virtual private network environment |
CN104050249A (en) * | 2011-12-31 | 2014-09-17 | 北京奇虎科技有限公司 | Distributed query engine system and method and metadata server |
CN103873497A (en) * | 2012-12-11 | 2014-06-18 | 中国电信股份有限公司 | Method, device and system for scheduling information |
CN104156380A (en) * | 2014-03-04 | 2014-11-19 | 深圳信息职业技术学院 | Distributed memory Hash indexing method and system |
CN105159985A (en) * | 2015-08-31 | 2015-12-16 | 努比亚技术有限公司 | Data query device and method based on redis cluster |
US20180048587A1 (en) * | 2016-05-16 | 2018-02-15 | Yang Bai | Port switch service |
CN108206779A (en) * | 2016-12-16 | 2018-06-26 | 北京金山云网络技术有限公司 | A kind of cluster accesses system, method and device |
CN107645508A (en) * | 2017-10-16 | 2018-01-30 | 深圳市买买提乐购金融服务有限公司 | A kind of data handling system, method, client and server |
CN108416039A (en) * | 2018-03-14 | 2018-08-17 | 北京思特奇信息技术股份有限公司 | A kind of data query method and system |
CN109407980A (en) * | 2018-09-29 | 2019-03-01 | 武汉极意网络科技有限公司 | Data-storage system based on Redis cluster |
CN110177007A (en) * | 2019-04-16 | 2019-08-27 | 平安科技(深圳)有限公司 | Realize gateway strange land method, apparatus, computer equipment and storage medium mostly living |
CN110048896A (en) * | 2019-04-29 | 2019-07-23 | 广州华多网络科技有限公司 | A kind of company-data acquisition methods, device and equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20200304563A1 (en) | Method for accessing network by internet of things device, apparatus, and system | |
US11329881B2 (en) | Method and system for network topology enforcement | |
US20150358235A1 (en) | Service Chain Topology Map Construction | |
US7634577B1 (en) | Media gateway proxy | |
WO2020155491A1 (en) | Geographical location-based intelligent domain name resolution method and device | |
JP6425663B2 (en) | Method, system and computer readable medium for using policy information to forward bearer session traffic to a network node as needed | |
JP2004038922A (en) | Technique for enabling a plurality of virtual filers on single filer to participate in a plurality of address spaces with overlapping network addresses | |
US8149840B2 (en) | Method, system and processor for processing network address translation service | |
US7792949B2 (en) | Method and system for video network discovery | |
JP5932841B2 (en) | Site-aware access to distributed file systems from outside the corporate network | |
CN103516550B (en) | A kind of rule conflict detection method and system towards extensive bag classifying rules collection | |
CN102572000B (en) | address monitoring method and device | |
CN105429879B (en) | Flow entry querying method, equipment and system | |
EP3627801B1 (en) | Automatic recovery from duplicate network addresses | |
CN110225150B (en) | Method, system and storage medium for communication between different network protocols | |
EP3499810B1 (en) | Method and apparatus for generating acl | |
CN103200102A (en) | Method, device and system for service routing | |
WO2017032145A1 (en) | Domain name forwarding method and apparatus | |
CN104092576A (en) | Network topology calculation method and device | |
CN109981768A (en) | I/o multipath planning method and equipment in distributed network storage system | |
CN110417777B (en) | Optimized method and device for communication between microservices | |
CN105262851A (en) | DNS forwarding method and system based on multiple strategies | |
CN111245943A (en) | Method for obtaining accessible IP address by Redis cluster | |
CN106789146B (en) | Topology obtaining method and device | |
US10165588B2 (en) | System and methods for mapping a network service path |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200605 |
|
RJ01 | Rejection of invention patent application after publication |