Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Redis universal agent-based implementation method, storage medium and electronic equipment

A general proxy and implementation method technology, applied to the implementation method based on Redis general proxy, storage media and electronic equipment, can solve the problems of operating multiple keys, not being able to guarantee multiple keys, and commands not being able to span multiple Redis instances, etc. Achieve high availability and ensure uniformity

Inactive Publication Date: 2018-05-11
康美健康云服务有限公司
View PDF2 Cites 6 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] In order to overcome the deficiencies of the prior art, one of the purposes of the present invention is to provide an implementation method based on Redis general proxy, which can solve the problem that Redis commands cannot span multiple Redis instances, and the same operation may operate multiple keys. The Redis client cannot guarantee that multiple keys are on the same Redis instance, and the same operation may operate multiple keys
[0005] The second object of the present invention is to provide an electronic device, which can solve the problem that Redis commands cannot span multiple Redis instances, the same operation may operate multiple keys, and the existing Redis client cannot guarantee that multiple keys are in the same On a Redis instance, the same operation may operate multiple keys
[0006] The third object of the present invention is to provide a computer-readable storage medium, which can solve the problem that Redis commands cannot span multiple Redis instances, and the same operation may operate multiple keys. On the same Redis instance, the same operation may operate multiple keys

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Redis universal agent-based implementation method, storage medium and electronic equipment

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0037] Below, the present invention will be further described in conjunction with the accompanying drawings and specific implementation methods. It should be noted that, under the premise of not conflicting, the various embodiments described below or the technical features can be combined arbitrarily to form new embodiments. .

[0038] Such as figure 1 An implementation method based on the Redis general proxy shown includes the following steps:

[0039] When Redis is a general proxy, it first needs to be initialized, including steps 1-3:

[0040] Step 1: Redis general proxy connection configuration, configure the connection information of Redis Sentinel in the cluster;

[0041] Step 2: Connect to Redis Sentinel, obtain the Master instance through the Sentinel Masters command, and record it to the collection Masters;

[0042] Step 3: Connect to Redis Sentinel, traverse the collection Masters and obtain the Slave instance associated with the Master instance through the Sentin...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a Redis universal agent-based implementation method. The method comprises the following steps of configuring the connection of a Redis universal agent, connecting the Redis universal agent with a Redis Sentinel, acquiring a Master instance through a Sentinel Masters command, recording the Master instance into a set Masters, traversing the set Masters to obtain a Slave instance associated with the Master instance through a Sentinel Slaves command, distributing the Master instance and the Slave instance by adopting the consistency hash algorithm, subscribing the switch-master information through a Redis Sentinel PSUBSCRIBE command, calling a Redis proxy interface by a client, creating a proxy connection handle, and executing a Redis command through the connection proxyhandle. According to the invention, the relation between the Master instance and the Slave instance is recorded through the connection configuration of the Redis universal proxy. Meanwhile, the Master instance and the Slave instance are distributed by adopting the consistency hash algorithm. Therefore, the distribution of a key in a cluster can be managed in a consistent hash mode. Moreover, distribution uniformity among all instances can be guaranteed.

Description

technical field [0001] The present invention relates to the field of data processing, in particular to a Redis-based universal proxy implementation method, storage medium and electronic equipment. Background technique [0002] Redis is an open source, high-performance key-value storage (key-value store) system. All key values ​​of Redis are stored in memory, which has high single-machine read and write performance. When operating Redis, it is necessary to communicate with the Redis server according to the Redis protocol specification. Redis has provided the sentinel function since version 2.8. When Redis is configured with master-slave mode, master-slave switching can be performed through sentinel. [0003] In the existing technology, Redis has the following problems: Redis commands cannot span multiple Redis instances, and the same operation may operate multiple keys. The existing Redis client cannot guarantee that multiple keys are on the same Redis instance. Operations...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): H04L29/08G06F9/54
CPCG06F9/547H04L67/1001H04L67/56
Inventor 彭少毅杨左元
Owner 康美健康云服务有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products