美文网首页
MISCONF Redis is configured to s

MISCONF Redis is configured to s

作者: 测试探索 | 来源:发表于2022-10-03 16:20 被阅读0次

    一:背景:

    编写django时,代码报错。redis.exceptions.ResponseError: MISCONF Redis is configured to save RDB snapshots, but it's currently unable to persist to disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.
    导致编写项目的验证码展示失败。

    二:原因

    Redis配置为保存RDB快照,但目前无法在磁盘上持久化。可能修改数据集的命令被禁用,因为此实例配置为在RDB快照失败时报告写入期间的错误。

    三:解决方案

    3-1:解决方案1

    设置 stop-writes-on-bgsave-error值为no即可避免这种问题。

    // 登录
    [root@ecs-25376 root]# redis-cli -h 127.0.0.1 -p 6379
    OK
    127.0.0.1:6379> config set stop-writes-on-bgsave-error no
    
    3-2:解决方案2
    直接修改redis.conf配置文件,修改后需要重启redis。
            (1)vim打开redis-server配置的redis.conf文件,
            (2)找到stop-writes-on-bgsave-error字符串所在位置,
            (3)把后面的yes设置为no。
    

    相关文章

      网友评论

          本文标题:MISCONF Redis is configured to s

          本文链接:https://www.haomeiwen.com/subject/zbjeartx.html