首页 | 本学科首页   官方微博 | 高级检索  
     

基于Bully算法的Redis集群选举方案优化
引用本文:王芬,顾乃杰,黄增士.基于Bully算法的Redis集群选举方案优化[J].计算机科学,2017,44(10):165-170.
作者姓名:王芬  顾乃杰  黄增士
作者单位:中国科学技术大学计算机科学与技术学院 合肥230037 中国科学技术大学先进技术研究院 合肥230037,中国科学技术大学计算机科学与技术学院 合肥230037 中国科学技术大学先进技术研究院 合肥230037,中国科学技术大学计算机科学与技术学院 合肥230037 中国科学技术大学先进技术研究院 合肥230037
基金项目:本文受安徽省自然科学基金(1408085MKL06),高等学校学科创新引智计划项目(B07033),华为创新研究计划资助
摘    要:随着互联网的迅速发展,用户从系统获取的信息越来越多,访问系统的频率也在迅速增加。当大量客户端访问系统时,请求的响应时间也会大幅增加,传统关系型数据库已经无法满足用户的需求,而内存数据库在保证系统稳定的前提下,改善了用户体验,并得到了越来越广泛的应用。作为NoSQL内存数据库,Redis支持很多数据类型,适用于多种情况下的缓存与存储需求。文中主要介绍Redis集群,它是Redis的分布式实现,支持主从复制,也具有一定的容错性和线性可扩展性,当前使用Redis集群的网站有新浪微博、github等。虽然 Redis集群 应用广泛,但目前它在节点下线后会出现恢复时间长的现象,这与现有Redis集群的选举算法有关,即与Raft算法的实现有关。分析了Redis集群的可靠性,并优化了集群的选举算法。测试结果显示,在单个主节点下线50s内,优化后的集群都能成功恢复,比社区版本的集群提高了40%。

关 键 词:Redis集群  选举算法  纪元  节点  下线  恢复
收稿时间:2016/8/30 0:00:00
修稿时间:2017/2/8 0:00:00

Election Scheme Optimization of Redis Cluster Based on Bully Algorithm
WANG Fen,GU Nai-jie and HUANG Zeng-shi.Election Scheme Optimization of Redis Cluster Based on Bully Algorithm[J].Computer Science,2017,44(10):165-170.
Authors:WANG Fen  GU Nai-jie and HUANG Zeng-shi
Affiliation:School of Computer Science and Technology,University of Science and Technology of China,Hefei 230037,China Institute of Advanced Technology,University of Science and Technology of China,Hefei 230037,China,School of Computer Science and Technology,University of Science and Technology of China,Hefei 230037,China Institute of Advanced Technology,University of Science and Technology of China,Hefei 230037,China and School of Computer Science and Technology,University of Science and Technology of China,Hefei 230037,China Institute of Advanced Technology,University of Science and Technology of China,Hefei 230037,China
Abstract:With the rapid development of Internet,users obtain more and more information from the system,and the frequency of accessing to system also grows rapidly.While a large number of clients access to the system,the response time of the request greatly increases,the traditional relational database is unable to meet the demand of the user,but in-memory database guarantees the stability of system,improves the user experience,and obtains more and more application.As a kind of in-memory database of NoSQL,Redis supports many data types,and it is applicable to many cases of requirements in caching and storage.In this paper,we mainly introduced Redis cluster,which is a distributed implementation of the Redis,supports master-slave replication,has a certain degree of fault tolerance and linear scalability,and recently is used by Sina microblog,github and so on.Although it is widely used,current Redis cluster occasionally has the case that long recovery time is needed after node fails,which has something to do with election algorithm of current Redis cluster,that is the implementation of Raft algorithm.In this paper,we analyzed the reliability of Redis cluster,and optimized the election algorithm of cluster.The results in test show that the optimized cluster can successfully recover in 50 seconds while only one master node is offline,and it is 40% higher than that of the cluster of the community version.
Keywords:Redis cluster  Election algorithm  Epoch  Node  Fail  Recovery
点击此处可从《计算机科学》浏览原始摘要信息
点击此处可从《计算机科学》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号