REDIS ReadOnlyError("You can't write against a read only replica.")
What caused this error ? I am using redis with a docker with default settings. When I restart redis, it works fine for a few minutes - hour, and then it throws that error.
The thing is, I don't use any replica. Why redis throwing out error about replica. Anyone familiar with how redis works ?
Thanked by (1)Ganonk
Comments
you are likely hacked
https://github.com/docker-library/redis/issues/227
My Personal Blog 🌟🌟 Backups for $1 🔥🚀
I have consider the possibility of that. But the thing is, I don't expose my redis port. It only accessible by other docker container using local ip. Not even the host can acccess the redis.
sentinel cluster and redis on it, when there is change to the master, this issue happen, you cannot solve it 100%, On practice, you need to ensure that redis client is able to tolerate the failure, work on safe mode, on certain exceptions it may retry few attempts before giving up or make it up. To know who is master, ask sentinel, to check master readyness, use HA proxy, https://www.haproxy.com/blog/haproxy-advanced-redis-health-check/