Skip to content

This is a redis-py connection with failover in the event of a connection error, the connection pool is managed with zookeeper. Inspired by redis_failover, use that if you're using ruby, or this if you're using python.

Notifications You must be signed in to change notification settings

loki42/failover_connection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

failover_connection

This is a redis connection with failover in the event of a connection error, the connection pool is managed with zookeeper.

In the event of an connection error, the first connection gets a write lock and elects a new master. Other connections wait until the write lock is released to get the new master.

This is the inital version and it's probably very broken. A number of things are not yet handled properly.

I orignally wrote this using zc.zk and zktools. The currently don't work with gevent though so i've rewritten it to use kazoo. I've tested it with and without gvent and currently use it with both.

I'll do a write up soon about ZooKeeper on the Gravity Four blog.

About

This is a redis-py connection with failover in the event of a connection error, the connection pool is managed with zookeeper. Inspired by redis_failover, use that if you're using ruby, or this if you're using python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages