CN107343034A - Redis high-availability systems and method based on QConf - Google Patents

Redis high-availability systems and method based on QConf Download PDF

Info

Publication number
CN107343034A
CN107343034A CN201710494505.1A CN201710494505A CN107343034A CN 107343034 A CN107343034 A CN 107343034A CN 201710494505 A CN201710494505 A CN 201710494505A CN 107343034 A CN107343034 A CN 107343034A
Authority
CN
China
Prior art keywords
qconf
redis
sentry
cluster
service
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
CN201710494505.1A
Other languages
Chinese (zh)
Other versions
CN107343034B (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.)
Hangzhou mingshitang Digital Technology Co.,Ltd.
Original Assignee
Hangzhou Ming Shitang Education And Science Development 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 Hangzhou Ming Shitang Education And Science Development Co Ltd filed Critical Hangzhou Ming Shitang Education And Science Development Co Ltd
Priority to CN201710494505.1A priority Critical patent/CN107343034B/en
Publication of CN107343034A publication Critical patent/CN107343034A/en
Application granted granted Critical
Publication of CN107343034B publication Critical patent/CN107343034B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements

Abstract

The invention discloses a kind of Redis high-availability systems and method based on QConf, the system includes QConf management ends, QConf clients, QConf service ends, sentry's clustered node and Redis replica nodes;QConf clients and the interaction of QConf service ends, obtain newest QConf service nodes and the parsing QConf service nodes;QConf management ends dispose QConf monitoring services and QConf administration extensions;Sentry's clustered node to run the server of sentry's cluster, be responsible for monitoring master library and the survival from storehouse in Redis duplication clusters by sentry's cluster;Redis replica nodes replicate the server of cluster for operation Redis;Redis High Availabitities framework proposed by the present invention is both simple and stable, greatly improves the availability of Redis databases, is easy to safeguard and cost is very low, realize that Redis principals and subordinates are automatically switched using sentry's pattern, technology maturation, it is reliable and stable using QConf as intermediate layer.

Description

Redis high-availability systems and method based on QConf
Technical field
The invention belongs to field of computer technology, the application scenarios of Redis databases are mainly used in, for being lifted The availability of Redis databases.
Background technology
For Internet firm, Redis databases are more and more wider as caching and high-performance storage scheme, application General, the availability of Redis database services is also more and more important.Existing Redis databases high availability scheme has the disadvantage that: 1) framework is complicated:Redis High Availabitities are realized using the framework of complexity, reduce the availability of Redis databases.2) introduce newly Destabilizing factor:In order to realize Redis database High Availabitities, intermediate layer is introduced, and the problem of availability is low be present in intermediate layer, Cause Redis database availabilities low.3) be inconvenient to safeguard:The High Availabitity framework of use, considerably increases manual maintenance cost, Be inconvenient to safeguard.4) high availability scheme is not sufficiently stable, and can not ensure Redis database availabilities.
The content of the invention
In view of the deficiencies of the prior art, the present invention provides a kind of Redis high-availability systems and method based on QConf, base Application program and Redis databases can be thoroughly decoupled in QConf, no matter Redis databases do any change, and application program is equal Database relevant configuration need not be changed.Meanwhile based on sentry's cluster, it is possible to achieve Redis database failures automatically switch, from And realize the High Availabitity of Redis database services.
The purpose of the present invention is achieved through the following technical solutions:A kind of Redis High Availabitities system based on QConf System, the system include QConf management ends, QConf clients, QConf service ends, sentry's clustered node and Redis replica nodes.
QConf clients:The server of QConf agent service and QConf extensions is run, meanwhile, application program also portion Administration is in QConf clients;Major function is interacted with QConf service ends, obtains newest QConf service nodes and parsing institute State QConf service nodes.
QConf service ends:The zookeeper clusters of QConf service nodes are stored, the zookeeper clusters typically wrap Include odd number member, and number of members at least three.By QConf management ends, registered to QConf service ends or update QConf clothes Business node.
QConf management ends:QConf monitoring services and QConf administration extensions are disposed, are monitored by QConf monitoring services The survival of all QConf service nodes of QConf service ends;By QConf administration extensions, QConf service ends it is newly-increased or Update QConf service nodes;Ordinary circumstance, keeper are responsible for safeguarding QConf management ends.
Sentry's clustered node:The server of sentry's cluster is run, sentry's cluster generally comprises odd number member, and into Member's number at least three;Sentry's cluster is responsible for monitoring master library and the survival from storehouse in Redis duplication clusters, if Redis master libraries Break down, sentry's cluster triggers the switching of Redis master libraries automatically, produces new Redis master libraries;One sentry's cluster can monitor One or more Redis replicates cluster.
Redis replica nodes:The server that Redis replicates cluster is run, the Redis replicates cluster, generally comprises one Individual Redis master libraries, one or more Redis is from storehouse;Each Redis replicates cluster, different using port numbers unique mark Redis replicates cluster, and port numbers are different.
Further, sentry's clustered node includes sentry's cluster management module, and sentry's cluster management module needs The parameter to be passed to:Redis master libraries ip, sentry's cluster ports and redis master library identifiers.
Further, the QConf management ends include QConf service nodes management module and QConf service nodes monitor Module;
The QConf service nodes management module needs incoming parameter:Zookeeper clusters connection string, QConf The ip and port of service node and all members of sentry's cluster;
The QConf service nodes monitoring module needs incoming parameter:Zookeeper cluster connection strings.
Further, the QConf clients include QConf service nodes parsing module, sentry's parsing module and application Routine access module;
The QConf service nodes parsing module needs incoming parameter:QConf service nodes;
Sentry's parsing module needs incoming parameter:Sentinel node ip, sentry's cluster ports and Redis master libraries mark Symbol;
The application program access modules need incoming parameter:The ip of Redis master libraries, Redis replicate the port of cluster And password.
A kind of Redis high availability methods based on QConf, this method include:
(1) sentry's cluster management module is called, replicates cluster in Redis replica nodes deployment Redis, while collect in sentry Group node disposes sentry's cluster, replicates cluster for monitoring Redis, if Redis master libraries break down, sentry's cluster can be certainly Row switching Redis master libraries, realize Redis master library High Availabitities.
(2) QConf service node management modules are called, zookeeper clusters and QConf administration extensions is disposed, passes through PHP Application call QConf administration extensions interfaces, sentry's cluster QConf service nodes corresponding to are registered in QConf service ends. By QConf administration extensions interfaces, it can be increased, updated and be checked newly operation to the QConf service nodes.
(3) QConf service node monitoring modules are called, starts QConf monitoring services in QConf management ends, monitors QConf The viability of sentinel node corresponding to all QConf service nodes in service end, ensure the whistle that application program is got every time Soldier's node is available.
(4) QConf service node parsing modules, after QConf service node management module end of runs, sentry's cluster are called QConf service nodes corresponding to being registered to.Then, application program is called corresponding to QConf according to the QConf service nodes Expansion interface, the ip of one sentinel node of return and port.
If in QConf service ends, the QConf service nodes are updated, zookeeper clusters can be automatically by QConf agent are serviced, and ensure that the sentinel node that application program is got every time is newest.
(5) call sentry's parsing module, according to QConf service nodes parsing module return the sentinel node ip and Port, Redis expansion interfaces corresponding to application call, the ip of return Redis master libraries and port.
(6) call application program access modules, according to call sentry's parsing module return the Redis master libraries ip and Port, Redis expansion interfaces corresponding to application call, Redis connections are established, so as to Redis read-write requests.
The beneficial effects of the invention are as follows:
(1) framework simple and stable:Redis High Availabitities framework proposed by the present invention is both simple and stable, greatly improves The availability of Redis databases..
(2) maintenance cost is low:Because High Availabitity framework proposed by the present invention is simple, it is highly convenient for safeguarding, and cost is very It is low.
(3) technology maturation, reliability are high:Realize that Redis principals and subordinates are automatically switched using sentry's pattern, technology maturation, use QConf is reliable and stable as intermediate layer.
Brief description of the drawings
Fig. 1 is the Redis high-availability system general frame figures of the invention based on QConf;
Fig. 2 is the Redis high-availability system modules flow charts of the invention based on QConf.
Embodiment
The present invention is described in further detail with specific embodiment below in conjunction with the accompanying drawings.
As shown in figure 1, a kind of Redis high-availability systems based on QConf provided by the invention, the system include QConf Five management end, QConf clients, QConf service ends, sentry's clustered node and Redis replica nodes units.
(1) Redis replica nodes
Redis is disposed on multiple servers and replicates cluster, in order to ensure Redis service availabilities, Redis master libraries and Redis is run on different server respectively from storehouse.The port numbers that each Redis replicates all members of cluster are consistent, different Redis replicates cluster, and port numbers are different.After Redis replicates clustered deploy(ment), next interacted with sentry's clustered node, it is real The High Availabitity of existing Redis database services.
(2) sentry's clustered node
Sentry's cluster is run on multiple servers, sentry's cluster member is odd number, at least 3 members, in order to protect Sentry's cluster service availability is demonstrate,proved, same all members of sentry's cluster dispose on a different server, each sentry's cluster All member ports number are consistent, and in order to replicate cluster difference with Redis and keep associating, sentry's cluster ports number=Redis is multiple Cluster ports number+20000 processed, different sentry's clusters, port numbers are different.Each sentry's cluster, can monitor a Redis and answer Cluster processed, multiple Redis can also be monitored and replicate cluster, sentry's cluster distinguishes different Redis by Redis master libraries identifier Replicate cluster.Each member is referred to as sentinel node in sentry's cluster.
(3) QConf service ends
QConf service ends are primarily referred to as storing the zookeeper clusters of QConf service nodes, the zookeeper clusters Run on different servers, also, all member ports number of zookeeper clusters are consistent, and each member is distributed in not On same server, zookeeper cluster members require odd number, at least three.The each member of Zookeeper clusters is referred to as Zookeeper nodes.
(4) QConf management ends
Start QConf monitoring services, it is necessary to which incoming parameter is in QConf management ends:The QConf service ends Zookeeper cluster connection strings
Major function is to manage the survival of sentry corresponding to QConf service nodes and monitoring QConf service nodes, QConf QConf service nodes, monitoring are registered and updated to management end and the interaction of QConf service ends, QConf management ends to QConf service ends The viability of all QConf service nodes of the QConf service ends, so as to ensure that sentry that application program is got every time Service is available, and then ensures Redis database High Availabitities.
(5) QConf clients
Application deployment is in QConf clients, in QConf clients, operation QConf agent services, and, need simultaneously Want Redis extensions corresponding to QConf extensions corresponding to disposing application program and application program.QConf clients and QConf services End interaction, the last look of the QConf service nodes is obtained in real time, ensure that the sentry that application program obtains every time is newest. According to the QConf service nodes, parsing obtains sentinel node, and then, Redis extends according to corresponding to application program, parsing Sentinel node obtains Redis master libraries, and then, application program can be established with Redis master libraries and connected.
As shown in Fig. 2 the module that each unit specifically includes is as follows:
(1) sentry's cluster management module
It is the ip of Redis master libraries, sentry's cluster ports, Redis master library identifiers to need incoming parameter;
Firstly the need of disposing mono- master library of Redis in Redis replica nodes and N number of be more than or equal to 1, Redis masters from storehouse, N Storehouse is different with the ip from storehouse, and port is identical.Then sentry's cluster is disposed on sentry's clustered node, respectively on three servers Sentinel node is disposed, according to incoming parameter, the sentinel node is respectively started.All sentinel nodes in one sentry's cluster Ip is different, and port numbers are identical, also, the relation of the port of sentry's cluster and the port of reids duplication clusters is:
Sentry's cluster ports=Redis replicates cluster ports+20000
If necessary to increase a sentinel node newly, it is only necessary to start one according to incoming parameter on a new server Individual sentinel node.But require that the number of sentinel node must be odd number.
If necessary to migrate a sentinel node, it is necessary on new server start a sentinel node, then again under Line node to be migrated, offline mode are as follows:
A node serve to be migrated) is stopped
Kill node_pid
Node_pid treats sentinel node process pid, and acquisition can be checked by ps-ef.
B) performed in remaining all sentinel node:
SENTINEL sentinels Redis master library identifiers
If necessary to increase a Redis newly from storehouse, it is only necessary to start a Redis node on a new server, Port numbers are consistent with Redis duplications cluster ports, then log in the Redis nodes, perform:
SLAVEOFF Redis master library ip Redis replicate cluster ports
So, sentry's cluster h can be added to new Redis in corresponding sentry's cluster from storehouse automatically.
It is as follows from storehouse, mode if necessary to migrate a Redis:
A Redis to be migrated) is stopped from storehouse
The Redis to be migrated is logged in from storehouse, is performed:
SHUTDOWN
B) performed in all sentinel nodes:
SENTINEL sentinels Redis master library identifiers
Switch if necessary to Redis master libraries, mode is as follows:
Any one sentinel node is logged in, execution is such as issued orders:
SENTINEL failover Redis master library identifiers
So, sentry's cluster is automatically performed Redis master libraries in several seconds and switched online.
(2) QConf service nodes management module
Need incoming parameter:Zookeeper clusters connection string, QConf service nodes and sentry's cluster it is all into The ip of member and port.
A set of zookeeper clusters are disposed in Qconf service ends first, the zookeeper clusters include five Zookeeper nodes, all zookeeper node ports are consistent, are distributed on five servers.Then replicate and save in Redis Point deployment Redis replicates cluster and disposes sentry's cluster in sentry's clustered node, next, disposing QConf in QConf management ends Administration extensions and installation PHP software kits.
Using PHP application program management QConf service nodes, it can increase newly and update QConf service nodes.
A it is as follows that QConf service node modes) are increased newly:
$ qzk=new QConfZK (" zookeeper clusters connection string ");
$ service_path=" QConf service nodes ";
$ services_input=array (" sentinel node 1 "=>QCONF_STATUS_UP, " sentinel node 2 "=> QCONF_STATUS_UP, " sentinel node 3 "=>QCONF_STATUS_UP);
$qzk->servicesSet($service_path,$services_input);
Explanation:Zookeeper cluster connection strings are as follows:
192.168.1.100:2181,192.168.1.101:2181:192.168.1.102:2181: 192.168.1.103:2181,192.168.1.104:2181
QConf service nodes are as follows:/ db/Redis/sn26379, wherein 26379 be the port of sentry's cluster;
B) QConf service nodes are updated, it is necessary to delete and add two operations, it is as follows respectively:
Addition operation:
$ qzk=new QConfZK (" zookeeper clusters connection string ");
$ service_path=" QConf service nodes ";
$qzk->ServiceAdd ($ service_path, " sentinel node 4 ", QCONF_STATUS_UP);
Deletion action:
$ qzk=new QConfZK (" zookeeper clusters connection string ");
$ service_path=" QConf service nodes ";
$qzk->ServiceDelete ($ service_path, " sentinel node 3 ");
C all QConf service nodes information) are checked, the letter of specified QConf service nodes can be checked in the following way Breath:
$ qzk=new QConfZK (" zookeeper clusters connection string ");
$ service_path=" QConf service nodes ";
$ services_output=$ qzk->servicesGet($service_path);
var_dump($services_output);
(3) QConf service nodes monitoring module
Need incoming parameter:Zookeeper cluster connection strings
In QConf management ends, according to incoming parameter, start QConf monitoring services as follows:
bin/monitor-cmd.sh start
Then perform such as to issue orders and check current all QConf service nodes, including reach the standard grade and offline node:
bin/monitor-cmd.sh list
After starting QConf monitoring services, the machine if some service of some QConf service node is delayed, QConf monitoring clothes After business starts, sentinel node viability corresponding to all QConf service nodes of automatic detection, if the sentinel node is delayed Machine, can be automatically offline from QConf service nodes;If sentinel node recovers service, can be reached the standard grade automatically in QConf service nodes; QConf monitoring services ensure that the availability of QConf service nodes.
(4) QConf service nodes parsing module
Need incoming parameter:QConf service nodes
In QConf clients, zookeeper cluster connection strings are passed to, start QConf agent services, while portion QConf extensions corresponding to application program are affixed one's name to, may then pass through following manner parsing QConf service nodes:
$ snserver=QConf::GetHost (" QConf service nodes ");
QConf agent return to the sentinel node of a survival using polling algorithm every time, both ensure that Redis services High Availabitity, load balancing is realized again.
(5) sentry's parsing module
Need incoming parameter:Sentinel node ip, sentry's cluster ports and Redis master library identifiers
In QConf clients, it is necessary to which Redis corresponding to disposing application program extends, in the application, by calling the whistle Soldier's interface, ip, port and the Redis master library identifiers of sentinel node are passed to, if run succeeded, return to the ip of Redis master libraries And port, otherwise, return to the conditional code that reports an error.
(6) application program access modules
Need incoming parameter:Redis master libraries ip, Redis replicate cluster ports and password
After the execution of sentry's parsing module terminates, if return value is the conditional code that reports an error, application program will return to error information, Represent currently without available Redis master libraries;After if sentry's parsing module execution terminates, return value is Redis master libraries Ip and port, then, according to the ip of Redis master libraries and port and encrypted message, the connection of application call Redis extensions Pond API, if there is available Redis connections, then Redis connections are returned to, otherwise, according to the Redis master libraries ip, port And password, the establishment connection relevant interface in Redis extensions is called, creates Redis connections, then, the Redis is returned and connects Connect, if creating Redis connection failures, return to error information, explanation can not create Redis connections.
A kind of Redis high availability methods based on QConf, this method include:
(1) sentry's cluster management module is called, replicates cluster in Redis replica nodes deployment Redis, while collect in sentry Group node disposes sentry's cluster, replicates cluster for monitoring Redis, if Redis master libraries break down, sentry's cluster can be certainly Row switching Redis master libraries, realize Redis master library High Availabitities.
(2) QConf service node management modules are called, zookeeper clusters and QConf administration extensions is disposed, passes through PHP Application call QConf administration extensions interfaces, sentry's cluster QConf service nodes corresponding to are registered in QConf service ends. By QConf administration extensions interfaces, it can be increased, updated and be checked newly operation to the QConf service nodes.
(3) QConf service node monitoring modules are called, starts QConf monitoring services in QConf management ends, monitors QConf The viability of sentinel node corresponding to all QConf service nodes in service end, ensure the whistle that application program is got every time Soldier's node is available.
(4) QConf service node parsing modules, after QConf service node management module end of runs, sentry's cluster are called QConf service nodes corresponding to being registered to.Then, application program is called corresponding to QConf according to the QConf service nodes Extend API, the ip of one sentinel node of return and port.
If in QConf service ends, the QConf service nodes are updated, zookeeper clusters can be automatically by QConf agent are serviced, and ensure that the sentinel node that application program is got every time is newest.
(5) call sentry's parsing module, according to QConf service nodes parsing module return the sentinel node ip and Port, Redis expansion interfaces corresponding to application call, the ip of return Redis master libraries and port.
(6) call application program access modules, according to call sentry's parsing module return the Redis master libraries ip and Port, Redis expansion interfaces corresponding to application call, Redis connections are established, so as to Redis read-write requests.

Claims (5)

1. a kind of Redis high-availability systems based on QConf, it is characterised in that the system includes QConf management ends, QConf visitors Family end, QConf service ends, sentry's clustered node and Redis replica nodes;
QConf clients:The server of QConf agent services and QConf extensions is run, meanwhile, application program is also deployed in QConf clients;Major function is interacted with QConf service ends, is obtained described in newest QConf service nodes and parsing QConf service nodes;
QConf service ends:The zookeeper clusters of QConf service nodes are stored, the zookeeper clusters include odd number Member, and number of members at least three;By QConf management ends, registered to QConf service ends or update QConf service nodes;
QConf management ends:QConf monitoring services and QConf administration extensions are disposed, QConf clothes are monitored by QConf monitoring services The survival of all QConf service nodes in business end;By QConf administration extensions, increase newly or update in QConf service ends QConf service nodes;
Sentry's clustered node:The server of sentry's cluster is run, sentry's cluster includes odd number member, and number of members is at least 3;Sentry's cluster is responsible for monitoring master library and the survival from storehouse in Redis duplication clusters, if event occurs for Redis master libraries Barrier, sentry's cluster trigger the switching of Redis master libraries, produce new Redis master libraries automatically;One sentry's cluster can monitor one or The multiple Redis of person replicate cluster;
Redis replica nodes:The server that Redis replicates cluster is run, the Redis replicates cluster, generally comprises one Redis master libraries, one or more Redis is from storehouse;Each Redis replicates cluster, different using port numbers unique mark Redis replicates cluster, and port numbers are different.
A kind of 2. Redis high-availability systems based on QConf according to claim 1, it is characterised in that sentry's collection Group node includes sentry's cluster management module, and sentry's cluster management module needs incoming parameter:Redis master libraries ip, the whistle Soldier's cluster ports and redis master library identifiers;First mono- master library of Redis and N number of big from storehouse, N is disposed in Redis replica nodes In identical equal to 1, Redis master libraries and the ip differences from storehouse, port;Then sentry's cluster is disposed on sentry's clustered node, point Sentinel node is not disposed on a different server, and according to incoming parameter, the sentinel node is respectively started;One sentry's collection The ip of all sentinel nodes is different in group, and port numbers are identical.
A kind of 3. Redis high-availability systems based on QConf according to claim 1, it is characterised in that the QConf Management end includes QConf service nodes management module and QConf service node monitoring modules;
The QConf service nodes management module needs incoming parameter:Zookeeper clusters connection string, QConf services The ip and port of node and all members of sentry's cluster;A set of zookeeper clusters are disposed in Qconf service ends first, it is described Zookeeper clusters include multiple zookeeper nodes, and all zookeeper node ports are consistent, are distributed in different services On device;Then replicate cluster in Redis replica nodes deployment Redis and dispose sentry's cluster in sentry's clustered node, next, In QConf management ends deployment QConf administration extensions and installation PHP software kits;Serviced and saved using PHP application program managements QConf Point, it can increase newly, update, checking QConf service nodes;
The QConf service nodes monitoring module needs incoming parameter:Zookeeper cluster connection strings;Managed in QConf Manage end, QConf monitoring services started according to incoming parameter, check current all QConf service nodes, including reach the standard grade with it is offline Node;After starting QConf monitoring services, the machine if some service of some QConf service node is delayed, QConf monitoring services After startup, sentinel node viability corresponding to all QConf service nodes of automatic detection, the machine if sentinel node is delayed, Automatically it is offline from QConf service nodes;If sentinel node recovers service, reached the standard grade automatically in QConf service nodes.
A kind of 4. Redis high-availability systems based on QConf according to claim 1, it is characterised in that the QConf Client includes QConf service nodes parsing module, sentry's parsing module and application program access modules;
The QConf service nodes parsing module needs incoming parameter:QConf service nodes;Need incoming parameter: QConf service nodes;In QConf clients, zookeeper cluster connection strings are passed to, start QConf agent services, QConf corresponding to disposing application program extends simultaneously, then parses QConf service nodes;QConf agent use polling algorithm The sentinel node of a survival is returned every time;
Sentry's parsing module needs incoming parameter:Sentinel node ip, sentry's cluster ports and Redis master library identifiers; In QConf clients, it is necessary to which Redis corresponding to disposing application program extends, in the application, by calling sentry's interface, Ip, port and the Redis master library identifiers of incoming sentinel node, if run succeeded, ip and the port of Redis master libraries are returned to, Otherwise, the conditional code that reports an error is returned;
The application program access modules need incoming parameter:The ip of Redis master libraries, Redis replicate the port of cluster and close Code;If sentry's parsing module return value is the conditional code that reports an error, application program will return to error information, represent currently without available Redis master libraries;If sentry's parsing module return value is ip and the port of Redis master libraries, then, according to Redis master libraries Ip and port and encrypted message, the connection pool API of application call Redis extensions, connect if there is available Redis Connect, then return to Redis connections, otherwise, according to Redis master libraries ip, port and the password, call the wound in Redis extensions Connection relevant interface is built, Redis connections is created, then, returns to the Redis connections, if creating Redis connection failures, is returned Error information is returned, explanation can not create Redis connections.
5. a kind of high availability method using any one of claim 1-4 system, it is characterised in that this method includes following step Suddenly:
(1) sentry's cluster management module is called, cluster is replicated in Redis replica nodes deployment Redis, while in sentry's cluster section Point deployment sentry's cluster, cluster is replicated for monitoring Redis, if Redis master libraries break down, sentry's cluster can voluntarily be cut Redis master libraries are changed, realize Redis master library High Availabitities;
(2) QConf service node management modules are called, zookeeper clusters and QConf administration extensions is disposed, is applied by PHP Routine call QConf administration extensions interfaces, sentry's cluster QConf service nodes corresponding to are registered in QConf service ends;Pass through QConf administration extensions interfaces, it can be increased, updated and be checked newly operation to the QConf service nodes;
(3) QConf service node monitoring modules are called, start QConf monitoring services, monitoring QConf services in QConf management ends The viability of sentinel node corresponding to all QConf service nodes in end, ensure sentry's section that application program is got every time Point is available;
(4) QConf service node parsing modules are called, after QConf service node management module end of runs, the registration of sentry's cluster To corresponding QConf service nodes;Then, application program is called and extended corresponding to QConf according to the QConf service nodes Interface, the ip of one sentinel node of return and port;
If in QConf service ends, the QConf service nodes are updated, zookeeper clusters can be automatically by QConf agent are serviced, and ensure that the sentinel node that application program is got every time is newest;
(5) sentry's parsing module is called, the ip of the sentinel node returned according to QConf service nodes parsing module and end Mouth, Redis expansion interfaces corresponding to application call, the ip of return Redis master libraries and port;
(6) application program access modules are called, according to the ip for the Redis master libraries for calling the return of sentry's parsing module and end Mouthful, Redis expansion interfaces corresponding to application call, Redis connections are established, so as to Redis read-write requests.
CN201710494505.1A 2017-06-26 2017-06-26 QConf-based Redis high availability system and method Active CN107343034B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710494505.1A CN107343034B (en) 2017-06-26 2017-06-26 QConf-based Redis high availability system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710494505.1A CN107343034B (en) 2017-06-26 2017-06-26 QConf-based Redis high availability system and method

Publications (2)

Publication Number Publication Date
CN107343034A true CN107343034A (en) 2017-11-10
CN107343034B CN107343034B (en) 2019-12-27

Family

ID=60221532

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710494505.1A Active CN107343034B (en) 2017-06-26 2017-06-26 QConf-based Redis high availability system and method

Country Status (1)

Country Link
CN (1) CN107343034B (en)

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107968847A (en) * 2017-11-13 2018-04-27 深圳市华阅文化传媒有限公司 High Availabitity ID makers and its ID generation methods and device
CN108804092A (en) * 2018-06-14 2018-11-13 山东浪潮商用系统有限公司 A kind of Redis Connection Pool Setting methods based on Spring Profile
CN109656753A (en) * 2018-12-03 2019-04-19 上海电科智能系统股份有限公司 A kind of Redundant backup system applied to track traffic synthetic monitoring system
WO2019090780A1 (en) * 2017-11-13 2019-05-16 深圳市华阅文化传媒有限公司 High-availability id generator, and id generation method and device thereof
CN110071975A (en) * 2019-04-23 2019-07-30 深圳易帆互动科技有限公司 The asynchronous dynamic state server management system reported
CN110674192A (en) * 2019-10-09 2020-01-10 浪潮云信息技术有限公司 Redis high-availability VIP (very important person) drifting method, terminal and storage medium
CN110673893A (en) * 2019-09-24 2020-01-10 携程计算机技术(上海)有限公司 Configuration method and system of application program, electronic device and storage medium
CN110781039A (en) * 2019-09-30 2020-02-11 新华三信息安全技术有限公司 Sentinel process election method and device
CN111104290A (en) * 2019-12-26 2020-05-05 紫光云(南京)数字技术有限公司 Database instance inspection method and device and computer storage medium
CN111212145A (en) * 2020-01-09 2020-05-29 国网福建省电力有限公司 Redis cluster for power supply service command system
CN112100005A (en) * 2020-08-20 2020-12-18 紫光云(南京)数字技术有限公司 Redis copy set implementation method and device
CN112783694A (en) * 2021-02-01 2021-05-11 紫光云技术有限公司 Long-distance disaster recovery method for high-availability Redis
CN112860379A (en) * 2021-02-24 2021-05-28 紫光云技术有限公司 Method for installing and deploying high availability of redis on cloud platform
CN113238810A (en) * 2021-02-24 2021-08-10 紫光云技术有限公司 Linux-based service redis configuration method
CN114785713A (en) * 2022-03-31 2022-07-22 度小满科技(北京)有限公司 Method and proxy middleware for realizing high availability of Redis cluster
CN114915577A (en) * 2022-04-22 2022-08-16 武汉泰铭恒创信息技术股份有限公司 Equipment communication method based on non-blocking IO model

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104462514A (en) * 2014-12-19 2015-03-25 北京奇虎科技有限公司 Database high availability solution method, connection control device and system
CN104809510A (en) * 2015-05-21 2015-07-29 武汉大学 Building method of ticket pool middleware for providing ticket support, ticket purchasing and ticket locking methods
CN105245603A (en) * 2015-10-15 2016-01-13 北京乐动卓越科技有限公司 Cluster server control method and system
CN105933407A (en) * 2016-04-20 2016-09-07 中国银联股份有限公司 Method and system for achieving high availability of Redis cluster
CN106293954A (en) * 2016-08-08 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of High Availabitity service management based on distributed lock
US20170083386A1 (en) * 2015-09-17 2017-03-23 Salesforce.Com, Inc. PROCESSING EVENTS GENERATED BY INTERNET OF THINGS (IoT)
US20170083368A1 (en) * 2015-09-18 2017-03-23 Salesforce.Com, Inc. Maintaining throughput of a stream processing framework while increasing processing load

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104462514A (en) * 2014-12-19 2015-03-25 北京奇虎科技有限公司 Database high availability solution method, connection control device and system
CN104809510A (en) * 2015-05-21 2015-07-29 武汉大学 Building method of ticket pool middleware for providing ticket support, ticket purchasing and ticket locking methods
US20170083386A1 (en) * 2015-09-17 2017-03-23 Salesforce.Com, Inc. PROCESSING EVENTS GENERATED BY INTERNET OF THINGS (IoT)
US20170083368A1 (en) * 2015-09-18 2017-03-23 Salesforce.Com, Inc. Maintaining throughput of a stream processing framework while increasing processing load
CN105245603A (en) * 2015-10-15 2016-01-13 北京乐动卓越科技有限公司 Cluster server control method and system
CN105933407A (en) * 2016-04-20 2016-09-07 中国银联股份有限公司 Method and system for achieving high availability of Redis cluster
CN106293954A (en) * 2016-08-08 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of High Availabitity service management based on distributed lock

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107968847A (en) * 2017-11-13 2018-04-27 深圳市华阅文化传媒有限公司 High Availabitity ID makers and its ID generation methods and device
WO2019090780A1 (en) * 2017-11-13 2019-05-16 深圳市华阅文化传媒有限公司 High-availability id generator, and id generation method and device thereof
CN108804092A (en) * 2018-06-14 2018-11-13 山东浪潮商用系统有限公司 A kind of Redis Connection Pool Setting methods based on Spring Profile
CN109656753A (en) * 2018-12-03 2019-04-19 上海电科智能系统股份有限公司 A kind of Redundant backup system applied to track traffic synthetic monitoring system
CN109656753B (en) * 2018-12-03 2023-02-28 上海电科智能系统股份有限公司 Redundant hot standby system applied to rail transit comprehensive monitoring system
CN110071975A (en) * 2019-04-23 2019-07-30 深圳易帆互动科技有限公司 The asynchronous dynamic state server management system reported
CN110673893A (en) * 2019-09-24 2020-01-10 携程计算机技术(上海)有限公司 Configuration method and system of application program, electronic device and storage medium
CN110673893B (en) * 2019-09-24 2023-06-09 携程计算机技术(上海)有限公司 Application program configuration method, system, electronic device and storage medium
CN110781039A (en) * 2019-09-30 2020-02-11 新华三信息安全技术有限公司 Sentinel process election method and device
CN110781039B (en) * 2019-09-30 2023-03-10 新华三信息安全技术有限公司 Sentinel process election method and device
CN110674192A (en) * 2019-10-09 2020-01-10 浪潮云信息技术有限公司 Redis high-availability VIP (very important person) drifting method, terminal and storage medium
CN111104290A (en) * 2019-12-26 2020-05-05 紫光云(南京)数字技术有限公司 Database instance inspection method and device and computer storage medium
CN111104290B (en) * 2019-12-26 2022-11-25 紫光云(南京)数字技术有限公司 Database instance inspection method and device and computer storage medium
CN111212145A (en) * 2020-01-09 2020-05-29 国网福建省电力有限公司 Redis cluster for power supply service command system
CN112100005A (en) * 2020-08-20 2020-12-18 紫光云(南京)数字技术有限公司 Redis copy set implementation method and device
CN112100005B (en) * 2020-08-20 2022-11-25 紫光云(南京)数字技术有限公司 Redis copy set implementation method and device
CN112783694A (en) * 2021-02-01 2021-05-11 紫光云技术有限公司 Long-distance disaster recovery method for high-availability Redis
CN113238810A (en) * 2021-02-24 2021-08-10 紫光云技术有限公司 Linux-based service redis configuration method
CN112860379A (en) * 2021-02-24 2021-05-28 紫光云技术有限公司 Method for installing and deploying high availability of redis on cloud platform
CN114785713A (en) * 2022-03-31 2022-07-22 度小满科技(北京)有限公司 Method and proxy middleware for realizing high availability of Redis cluster
CN114785713B (en) * 2022-03-31 2024-02-23 度小满科技(北京)有限公司 Method and proxy middleware for realizing high availability of Redis cluster
CN114915577A (en) * 2022-04-22 2022-08-16 武汉泰铭恒创信息技术股份有限公司 Equipment communication method based on non-blocking IO model

Also Published As

Publication number Publication date
CN107343034B (en) 2019-12-27

Similar Documents

Publication Publication Date Title
CN107343034A (en) Redis high-availability systems and method based on QConf
CN106341454B (en) Across computer room distributed data base management system (DDBMS) mostly living and method
CN105245373B (en) A kind of container cloud platform system is built and operation method
CN107256178B (en) Container management platform
CN105610987B (en) Method, application and the system of management server cluster
CN112600891B (en) Information physical fusion-based edge cloud cooperative system and working method
CN102640108B (en) The monitoring of replicated data
CN104506625B (en) A kind of method for lifting cloud database metadata node reliability
CN102656565B (en) Failover and recovery for replicated data instances
CA2488044C (en) System and method for synchronizing the configuration of distributed network management applications
CN112100262A (en) Method and system for quickly building and dynamically expanding multi-tenant software as a service (SaaS) platform
CN105630589A (en) Distributed process scheduling system and process scheduling and execution method
CN104811476B (en) A kind of High Availabitity deployment implementation method of application-oriented service
US8566437B2 (en) Systems and methods for improved multisite management of converged communication systems and computer systems
US20090049054A1 (en) Method and apparatus for sequencing transactions globally in distributed database cluster
JP2002528966A (en) Method and apparatus for deploying service modules in service nodes distributed to an intelligent network
CN106407030A (en) Failure processing method and system for storage cluster system
US6493715B1 (en) Delivery of configuration change in a group
WO2021103499A1 (en) Multi-active data center-based traffic switching method and device
CN113778985A (en) Microservice architecture monitoring method, microservice architecture monitoring device, computer equipment and storage medium
CN107315641A (en) Message queue high-availability system and method based on Qconf
US20110078296A1 (en) Systems and methods for improved multisite management and reporting of converged communication systems and computer systems
CN101300779A (en) Network configuration
CN103973725A (en) Distributed collaboration method and collaboration device
CN108092936A (en) A kind of Host Supervision System based on plug-in architecture

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
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Gu Weitao

Inventor after: Xie Jianjun

Inventor after: Wang Tianshun

Inventor before: Gu Weitao

GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220714

Address after: 310000 room 801, 8th floor, building 1, No. 108 Xiangyuan Road, Gongshu District, Hangzhou City, Zhejiang Province

Patentee after: Hangzhou mingshitang Digital Technology Co.,Ltd.

Address before: 310019 room 507, floor 5, building A15, No. 9, Jiusheng Road, Jianggan District, Hangzhou, Zhejiang Province

Patentee before: HANGZHOU MISTONG EDUCATION SCIENCE & TECHNOLOGY DEVELOPMENT CO.,LTD.