zoukankan      html  css  js  c++  java
  • 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)

    今天运行Redis时发生错误,错误信息如下:

    org.springframework.dao.InvalidDataAccessApiUsageException: 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.; nested exception is redis.clients.jedis.exceptions.JedisDataException: 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被配置为保存数据库快照,但它目前不能持久化到硬盘。用来修改集合数据的命令不能用。请查看Redis日志的详细错误信息。

    原因:

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

    临时解决方案:

    运行config set stop-writes-on-bgsave-error no 命令后,关闭配置项stop-writes-on-bgsave-error解决该问题。

    root@ubuntu:/usr/local/redis/bin# redis-cli
    127.0.0.1:6379> config set stop-writes-on-bgsave-error no
    OK
    127.0.0.1:6379> lpush myColour "red"
    (integer) 1

    但是 重点来了 

      敲黑板啦

    上面的解决办法只能治标,最终还要治本

    一、 首先到linux 查看redis 的日志文件

            1.找到redis 配置文件 redis.conf

           输入    find . -name "redis.conf"   查找配置文件路径

     我的在etc 文件夹下 你的就不一定了

     打开redis.conf 文件全局搜索 logfile 查看日志文件地址

     

      根据地址找到redis.log 打开查找日志打印 我的是这个鬼东西

     

      dir /etc/cron.d   这个文件权限不够导致写入错误  好啦找问题之所在了

      既然权限不够 就赋予他权限 cron.d 是个文件夹 我就将整个文件夹及里面统一赋予权限755 依然是权限不够 只能在高了777 搞定了

       赋予权限的语句是 chmod -R 777 cron.d  权限不懂的话另行百度。

       问题是解决了 ,还有个问题是为什么云服务器重启后忽然权限不够了呢???

  • 相关阅读:
    iView -- TimePicker 自定义修改时间选择器选择时间面板样式
    Go语言--容器:存储和组织数据的方式--数组、切片
    php递归实现一维数组转为指定树状结构 --- 省市区处理
    Go语言--基础语法笔记
    Mongodb 安装错误汇总
    GIt -- git push 远程分支老是需要重新输入公钥密码问题处理?
    GIt -- fatal: refusing to merge unrelated histories 问题处理
    Linux -- Centos6 yum安装相关问题与处理
    Linux -- Xshell ,Xftp远程连接中文乱码怎么解决?
    Laravel 多数据库配置及查询操作
  • 原文地址:https://www.cnblogs.com/memoryXudy/p/9947419.html
Copyright © 2011-2022 走看看