zoukankan      html  css  js  c++  java
  • Redis无法向磁盘写入RBD数据

    2020-12-09 11:52:25|21965|ERROR|storage/DRedisAsyncCallback.cpp:394[cbIncrby]Cmd 'INCRBY' failed, key: T:Gear:0:2019120515244332428:772:9, error: MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on 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不能再root权限下运行,所以要进行降权切成普通用户等操作,刚刚做完切权操作。客户监控发出来项目服务的报错邮件,经过查看发现是Redis问题.

    日志报错大概就是以上内容。大致意思是Redis配置了RDB持久化,但它目前无法在磁盘上持久存储。可以修改数据集的命令被禁用,因为如果RDB快照失败,这个实例被配置为在写期间报告错误(stop-write -on-bgsave-error选项)。看到这里就明白,原来redis没有办法在磁盘上进程持久化存储。

    但是这个问题是如何引发出来的呢?

    当时解决思路:

           1.磁盘是否损坏

           2.磁盘是否饱和

           3.强制关闭Redis快照导致不能持久化

           4.权限问题导致无法写入

    排查了一圈,最终因为强制把redis快照关闭了导致不能持久化的问题

    解决方法很简单:通过stop-writes-on-bgsave-error值设置为no即可避免这种问题。 

    命令方式:

    下次重启redis会失效

    redis-cli  -h xxxxx  -p 7003 -a xxxxxx
    config set stop-writes-on-bgsave-error no

    修改配置文件:

    stop-writes-on-bgsave-error no

  • 相关阅读:
    js类型自动转换以及==对比规则
    js改变作用域链
    cookie简单实例
    js操作cookie
    body设置margin为0
    inline-block和block元素水平居中显示
    执行git clone遇到警告解决办法
    git中各大写字母表示含义
    git命令报错
    linux.txt
  • 原文地址:https://www.cnblogs.com/Dfengshuo/p/14109063.html
Copyright © 2011-2022 走看看