Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redis HA without clustering

Tags:

redis

I tried to find more info about it online, but cant seem to find a fitting answer.

Our new application uses HA loadbalancers on top to distribute visitors to clustered ampq and clustered mysql and everything works flawlessly.

Now we have decided that we need to store our sessions on REDIS and according to everyone out there.. REDIS seems to be a good choice.

But what I dont understand is, since Redis doesnt support cluster yet in production. How do people achieve HA with Redis? Its all great to setup a Master-Slave REDIS setup, but that means I can only write to the master. What happens if the master die? And even with Redis Sentinel promoting slaves to master.. the replication from master to slave can have a delay and reply me with stale data. How do people prevent that?

But to keep it short, I just dont "see" it. Please enlightenment me! Thank you

like image 340
laapsaap Avatar asked Feb 15 '23 13:02

laapsaap


2 Answers

Have a look at Twemproxy. It was deisnged to partition data amongst multiple redis masters, so there's no single point of failure; currently, it's the recommended approach to partition redis based on this (scroll to bottom).

Bonus Alert: Here's an interesting article on how to use redis slaves and sentinel with twemproxy, so they all play nice.

like image 63
raffian Avatar answered Feb 25 '23 11:02

raffian


try redis-mgr: https://github.com/idning/redis-mgr

redis+twemproxy+sentinel deploy/auto-failover/monitor/migrate/rolling-upgrade

like image 24
ning Avatar answered Feb 25 '23 10:02

ning