flyerhzm / redis-sentinel

another redis automatic master/slave failover solution for ruby by using built-in redis sentinel (deprecated)
MIT License
188 stars 67 forks source link

Resque: Redis Timeout Error ... #8

Open JohnBat26 opened 11 years ago

JohnBat26 commented 11 years ago

Hi all. I have used resque with redis-sentinel. All works OK, except after long unicorn idle time, resque console begin to raise Redis Timeout error. If I do service unicorn reload, then Resque console opens correctly. My redis init configuration:

  Resque.redis = Redis.new(master_name: 'redis-master',
                               sentinels: [
                                   {:host => 'server1', :port => 26379},
                                   {:host => 'server2', :port => 26379}
                               ],
                               failover_reconnect_timeout: 30)

my redis-sentinel.conf

sentinel monitor redis-master 172.21.78.138 6379 2
sentinel down-after-milliseconds redis-master 5000
sentinel failover-timeout redis-master 900000
sentinel can-failover redis-master yes
sentinel parallel-syncs redis-master 1

taf2 commented 9 years ago

You probably need to set tcp keepalive