Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 2.7 从Python调用Sentinel故障转移_Python 2.7_Redis_Redis Sentinel - Fatal编程技术网

Python 2.7 从Python调用Sentinel故障转移

Python 2.7 从Python调用Sentinel故障转移,python-2.7,redis,redis-sentinel,Python 2.7,Redis,Redis Sentinel,我有一个简单的Redis配置,运行3台服务器和3个Sentinel(尽管不同的实例)。这个配置运行得几乎完美无缺,最终,我的主机出现故障(常见的Redis问题,无法完成后台保存) 我的问题是,每当我试图保存(或删除)某些内容时,就会出现以下错误: ResponseError: MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that

我有一个简单的Redis配置,运行3台服务器和3个Sentinel(尽管不同的实例)。这个配置运行得几乎完美无缺,最终,我的主机出现故障(常见的Redis问题,无法完成后台保存)

我的问题是,每当我试图保存(或删除)某些内容时,就会出现以下错误:

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.
我有没有办法让哨兵呼叫“故障转移”部队来选择一个新的主机?使用redis cli非常简单,但我无法从Python(2.7)程序(使用redis.py)中找到实现这一点的方法


有什么想法吗?

首先,您的磁盘空间可能已用完,这将导致该错误。因此,解决这个问题,它将不再需要故障转移

也就是说,要在Python中实现这一点,我认为您需要使用“execute_command”并将sentinel命令和args传递给它。比如:

myclient.execute_command("SENTINEL failover", podname)

其中,
myclient
是您的连接对象,
poundage
是您在Sentinel中用于pod的名称,应该这样做。

我不认为我的空间不够用,但我已经设法使用您的提示调用故障转移!谢谢=当redis在一段时间后写入转储文件的能力发生变化时,DI仍然会检查磁盘空间。也就是说,如果这个答案解决了您的问题,请将其标记为已接受,这样其他人就不会将其视为未回答。干杯