当前位置:网站首页>Kept to implement redis autofailover (redisha)

Kept to implement redis autofailover (redisha)

2022-06-26 16:07:00 franket

Preface

Redis It's an open source , BSD Permitted , key-value Caching and storage

About it HA, There are three ways :

Sentinel

Redis Cluster

Keepalived + Redis

The first two are official HA The way , Each of them has its own advantages and disadvantages :

Sentinel Use a daemon for running Redis Instance to monitor and manage , It can effectively realize distributed monitoring and voting , however failover later , new master about client I don't know , Need to ask sentinel, So this mechanism needs client End logic support

Redis Cluster A very complete and efficient construction of a distributed cluster ,Redis Mutual monitoring and voting between instances , Bootstrap and failover , The official recommendation requires at least three nodes , Then it's better to bring one each slave, So the six nodes are the starting price ( Otherwise, the cluster is fragile , It is easy to enter the failure state ), Node to use cluster mode , And build the cluster relationship in advance at the beginning of data distribution , So this mechanism needs to be redeployed , And in order to avoid receiving MOVED Opening and closing caused by steering , Also needed client End logic optimization and support

Keepalived + Redis The implementation of is not official HA programme , In terms of monitoring and failover, it is not more intelligent than the above two ( It is realized by user-defined script , relatively speaking low quite a lot ), It's because it's old enough , So it has a feature that neither of the above two have , It is almost transparent to the client , No modification is necessary , For the currently running redis The instance does not need to be modified .

So let's share that Keepalived + Redis Configuration method of

Tip: current version Redis 3.0.4

原网站

版权声明
本文为[franket]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206261551547248.html