redis_failover - Automatic Redis Failover Client/Server
Redis Failoverattempts to provides a full automatic master/slave failover solution for Ruby.Redis does not provide an automatic failover capability when configured formaster/slave replication. When the master node dies, a new master must bemanually brought online and assigned as the slave's new master. This manualswitch-over is not desirable in high traffic sites where Redis is a criticalpart of the overall architecture. The existing standard Redis client for Rubyalso only supports configuration for a single Redis server. When usingmaster/slave replication, it is desirable to have all writes go to the master,and all reads go to one of the N configured slaves.
This gem attempts toaddress both the server and client problems. A redis failover server runs as abackground daemon and monitors all of your configured master/slave nodes. Whenthe server starts up, it automatically discovers who is the master and who arethe slaves. Watchers are setup for each of the redis nodes. As soon as a nodeis detected as being offline, it will be moved to an "unavailable"state. If the node that went offline was the master, then one of the slaveswill be promoted as the new master. All existing slaves will be automaticallyreconfigured to point to the new master for replication. All nodes marked asunavailable will be periodically checked to see if they have been brought backonline. If so, the newly available nodes will be configured as slaves andbrought back into the list of live servers. Note that detection of a node goingdown should be nearly instantaneous, since the mechanism used to keep tabs on anode is via a blocking Redis BLPOP call (no polling). This call fails nearlyimmediately when the node actually goes offline. To avoid false positives(i.e., intermittent flaky network interruption), the server will only mark anode as unavailable if it fails to communicate with it 3 times (this isconfigurable via --max-failures, see configuration options below).
This gem provides aRedisFailover::Client wrapper that is master/slave aware. The client isconfigured with a single host/port pair that points to redis failover server.The client will automatically connect to the server to find out the currentstate of the world (i.e., who's the current master and who are the currentslaves). The client also acts as a load balancer in that it will automaticallydispatch Redis read operations to one of N slaves, and Redis write operationsto the master. If it fails to communicate with any node, it will go back andask the server for the current list of available servers, and then optionallyretry the operation.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/301743/viewspace-731261/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 深入淺出 Redis client/server互動流程RedisclientServer
- Failover 之 Client-Side Connect time Failover、Client-Side TAF、Service-Side TAFAIclientIDE
- How to configure Client Failover after Data Guard Switchover or Failover [ID 316740.1]clientAI
- redis client原理分析Redisclient
- MySQL client server 協議MySqlclientServer協議
- SQL Server Availability Group Failover 測試SQLServerAI
- Redis Sentinel:叢集Failover解決方案RedisAI
- Automatic Manageability Features : Server-Generated Alerts (54)Server
- 使用Virtual Infrastructure Client 管理 VMWare ServerASTStructclientServer
- Introduction to Client/Server Architecture (273)clientServer
- Java 在Client/Server 中應用JavaclientServer
- 《Client-Server Web Apps with JavaScript and Java》選讀:什麼是Client-Server Web App?clientServerWebAPPJavaScript
- Oracle RAC Failove 之一:Client-Side Connect Time FailoverOracleAIclientIDE
- client: c#+protobuf, server: golang+protobufclientC#ServerGolang
- SUSE 11 NFS server/client 安裝配置NFSServerclient
- IIS與oracle client ,還是oracle server ?OracleclientServer
- mysql原碼安裝(server和client)MySqlServerclient
- Oracle client/server architecture's benefits (275)OracleclientServer
- Best Practices for failover during server failures [ID 1323472.1]AIServer
- Client does not support authentication protocol requested by server; consider upgrading MySQL clientclientProtocolServerIDEMySql
- client/server architecture : Distributed processing (274)clientServer
- How To Configure Server Side Transparent Application FailoverServerIDEAPPAI
- Configure Client Failover For Dataguard Connections Using DB Services-1429223.1clientAI
- Win10 + Emacs 25.* 配置Server Client模式Win10MacServerclient模式
- mysql-proxy does not work with server/client authentication pluginsMySqlServerclientPlugin
- 在AIX 5L上配置NFS Server/ClientAINFSServerclient
- Step by Step TimesTen ----- 配置client-server連線clientServer
- SQL Server資料庫映象的FailOver自動連線SQLServer資料庫AI
- 【ASK_ORACLE】手動配置DataGuard的自動化Client Failover(故障轉移)的serviceOracleclientAI
- "vSphere HA virtual machine failed to failover" error in vCenter Server問題分析MacAIErrorServer
- socket.io client + socketio-netty server簡析clientNettyServer
- FAL_CLIENT和FAL_SERVER引數詳解clientServer
- rhel4 mysql5.1_server_client安裝備紀MySqlServerclient
- Java在Client/Server網路中的應用 (轉)JavaclientServer
- Redis客戶端管理軟體:Redis Desktop Client mac中文免費版Redis客戶端clientMac
- 教你寫個簡單的 Redis Client 框架 - .NET CoreRedisclient框架
- Automatic Manageability Features : Automatic Maintenance Tasks (53)AINaN
- Redis主從複製 - 通過Keepalived實現Redis Failover自動故障切換功能RedisAI