1

I have a simple Redis configuration running with 3 Servers and 3 Sentinels (different instances though). This configuration is running almost flawlessly, eventually, my Master fails (common Redis problem where it couldn't finish background saving).

My problem is when that happens whenever I try to save (or delete) something, I get the error:

ResponseError: MISCONF Redis is configured to save RDB snapshots, but
is currently not able to persist on disk. Commands that may modify the
data set are disabled. Please check Redis logs for details about the error.

Is there any way for me to ask Sentinel to call "failover" force electing a new master? By redis-cli is quite easy, but I couldn't find a way of doing it from my Python(2.7) program (using redis.py).

Any ideas?

ademarizu
  • 845
  • 1
  • 8
  • 18

1 Answers1

2

First you are probably running out of disk space, which would cause that error. So address that and it will stop needing to be failed over.

That said, to do it in Python I think you need to use "execute_command" and pass it the sentinel command and the args. So something like:

myclient.execute_command("SENTINEL failover", podname)

where myclient is your connection object and poundage is the name you use for the pod in Sentinel, should do it.

The Real Bill
  • 14,884
  • 8
  • 37
  • 39
  • I don't think I'm running out of space, but I've manage to call failover using your tip! Thanks! =D – ademarizu Sep 21 '15 at 18:37
  • 1
    I'd still check disk space when it happens as something is changing redis' ability to write to the dump file after a while. That said if this answer addressed your issue mark it as accepted so others don't see it as unanswered. Cheers. – The Real Bill Sep 21 '15 at 18:40