网站登录异常,redis数据不能写!解决方法汇总!

redis---flushdb  ###提示如下错误    ###flushall              清空说有数据,所有库

(error) 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 不能保存快照,数据不能持久化写入到磁盘上!

日志提示:

“WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.”

(警告:过量使用内存设置为0!在低内存环境下,后台保存可能失败。为了修正这个问题,

01、低内存解决

sysctl vm.overcommit_memory=1    ###立即生效

vim /etc/sysctl.conf

vm.overcommit_memory = 1           ###重启生效或者sysctl   -a  内存重新读取/etc/sysctl.conf

 02、异常信息磁盘写停止

# However if you have setup your proper monitoring of the Redis server
# and persistence, you may want to disable this feature so that Redis will
# continue to work as usual even if there are problems with disk,
# permissions, and so forth.
stop-writes-on-bgsave-error yes    ###默认,遇到异常停止写数据

root@ubuntu:/usr/local/redis/bin# ./redis-cli

127.0.0.1:6379> config set stop-writes-on-bgsave-error no   ###临时修改,永久解决修改redis.conf

OK

127.0.0.1:6379> lpush myColour "red"                                       ###测试是否可以写数据

(integer) 1

set test  "hello,OK"

get test

vim  redis.conf

stop-writes-on-bgsave-error no                                                  ###永久性生效


低内存解决方案

free    -m    ###可用内存很小 300MB

  • If you get this error
  • Can't save in background: fork: Cannot allocate memory
  • it means that your current database is bigger than memory you have. To fix the issue enable vm.overcommit_memory:
  • sysctl vm.overcommit_memory=1
  • To have if after reboot add this line to /etc/sysctl.conf:
  • vm.overcommit_memory=1

借鉴:

http://www.cnblogs.com/anny-1980/p/4582674.html

http://www.cnblogs.com/qq78292959/p/3994349.html

redis报错的更多相关文章

  1. mac brew install redis 报错

    mac brew install redis 报错 /usr/local/opt/php55/bin/phpize /usr/local/opt/php55/bin/phpize: line 61: ...

  2. redis报错Windows error 0x70(a large memory)

    redis报错Windows error 0x70 redis 嫌弃你内存不够了,就给你不开第二个实例. The Windows version of Redis allocates a large ...

  3. filebeat output redis 报错 i/o timeout

    filebeat output  redis 报错 i/o timeout 先把报错内容贴出来. ERROR redis/client. go: Failed to RPUSH to redis li ...

  4. window下安装redis报错: creating server tcp listening socket 127.0.0.1:6379: bind No error

    window下安装redis报错: creating server tcp listening socket 127.0.0.1:6379: bind No error 解决: 如果没有配置环境,在安 ...

  5. Redis报错 : (error) NOAUTH Authentication required.

    原文:Redis报错 : (error) NOAUTH Authentication required. 这个错误是因为没有用密码登陆认证 , 先输入密码试试 . 127.0.0.1:6379> ...

  6. Windows安装redis报错处理(转!)

    要谈则谈,要打便打! ---2019.5.9,贸易战 转自:http://www.yayihouse.com/yayishuwu/chapter/1297 安装redis报错信息 [9204] 15 ...

  7. redis报错解决

    1.Connecting to node 127.0.0.17000 [ERR] Sorry, can't connect to node 192.168.1.917000 redis集群:Conne ...

  8. 安装Redis-cluster-gem install redis报错的解决方案

    错误描述: [root@eshop-cache01 local]# gem install redis ERROR: Loading command: install (LoadError) cann ...

  9. docker启动redis报错 oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo

    docker启动redis报错 1:C 17 Jun 08:18:04.613 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo1:C 17 Jun 08 ...

  10. Redis报错 Server started, Redis version 3.2.13 Can't handle RDB format version 9 Fatal error loading the DB: Invalid argument. Exiting.

    在/usr/local/etc 目录下 运行 redis-server 命令重启 redis 服务发现报错,报错信息如下: 如上报错的含义是:当前的redis的版本是3.2.13版本,无法处理 ver ...

随机推荐

  1. android使用微软EWS发送邮件

    通常我们在android使用javamail发送邮件,可是很多时候我们需要连接Exchange服务(很多公司内部邮件服务器采用,并且未开通smtp服务)来发送邮件,这时候我们就要用到微软的 ews-j ...

  2. C语言原码反码补码与位运算.

      目录:     一.机器数和真值     二.原码,反码和补码的基础概念     三.为什么要使用原码,反码和补码     四.原码,补码,反码再深入     五.数据溢出测试     六.位运算 ...

  3. VNC-Server installation on CentOS 7

    参考资料: https://www.howtoforge.com/vnc-server-installation-on-centos-7 https://linux.cn/article-5335-1 ...

  4. ViewPage 大圣归来 原生示例

    VP简介 android-support-v4.jar 是谷歌官方给我们提供的一个兼容低版本安卓设备的软件包,里面包囊了只有在安卓3.0以上可以使用的api.而ViewPage就是其中之一,利用它,我 ...

  5. 03-StreamReader和StreamWriter的案例

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.I ...

  6. HADOOP报错Incompatible namespaceIDs

    出现这个问题的原因是因为namespaceIDs导致的 解决方案1<推荐> 1. 进入链接不上的从机 stop-all.sh关闭hadoop 2. 编辑namespaceID,路径是< ...

  7. iptables阻止服务器被攻击

    下列规则将会阻止来自某一特定IP范围内的数据包,因为该IP地址范围被管理员怀疑有大量恶意攻击者在活动:  # iptables -t filter -A INPUT -s 123.456.789.0/ ...

  8. PL/SQL中的变量

    1.标量: ag1: declare v_ename emp.ename%type;--自己称为单变量 begin select ename into v_ename from emp where e ...

  9. css3动画和jquery动画使用中要注意的问题

    前一阵子写demo的时候遇到这样一个问题,就是给元素添加css3或者jquery动画时,在动画结束前不能准确取到元素的css属性. 1. css3动画讨论 先看代码: html: <div id ...

  10. jquery1.9学习笔记 之选择器(基本元素一)

    所有选择器("*") 描述:选择所有元素 注意:大多数情况下,这个选择器极其的慢,尤其是在作用于自身时. 例子: 查找文档中的每个元素.然后追加一个<script>或& ...