zoukankan      html  css  js  c++  java
  • redis报Cannot allocate memory错误

    昨天16:27开始将dp的日志使用ELK处理,当时redis使用内存的量不是很大,100M多点,结果今天早上到了一看xshell被关掉了,赶紧将各服务启动起来,elasticsearch启动没有问题,logstash indexer端启动时报错,redis插件连接不到,建议查看下redis的日志:

    1 A plugin had an unrecoverable error. Will restart this plugin.
    2   Plugin: <LogStash::Inputs::Redis host=>"10.132.24.166", type=>"redis-input", data_type=>"list", key=>"logstash", name=>"default">
    3   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. {:level=>:error}

    以为是redis挂掉了,查看端口,6379还在的,查看日志:

    redis 频繁报错日志:

    1 [7409] 12 Mar 09:57:11.069 * 1 changes in 900 seconds. Saving...
    2 [7409] 12 Mar 09:57:11.070 # Can't save in background: fork: Cannot allocate memory
    3 [7409] 12 Mar 09:57:17.086 * 1 changes in 900 seconds. Saving...
    4 [7409] 12 Mar 09:57:17.086 # Can't save in background: fork: Cannot allocate memory
    5 [7409] 12 Mar 09:57:23.100 * 1 changes in 900 seconds. Saving...

    top后显示VIRT:3758M,RES:3.5G

    参考:http://segmentfault.net/blog/koy/1190000000767465

    内核参数调整参考:https://www.kernel.org/doc/Documentation/vm/overcommit-accounting

    https://www.kernel.org/doc/Documentation/sysctl/vm.txt

    http://blog.sina.com.cn/s/blog_7429b9c801012evk.html

  • 相关阅读:
    【林】Ubuntu下安装和设置 OpenSSH Server
    吐吐槽
    【不定时推荐】这些年读过的书第一本--《一个人的朝圣》
    source insight 和keil 编辑对齐
    WeifenLuo DockContent停靠窗口的大小设置
    指针无法保存值
    php 练习基础
    php 写日志
    数据库设计——字段类型设计
    .net用TreeView实现CheckBoxes全选 反选 子节选中 传值
  • 原文地址:https://www.cnblogs.com/iuwai/p/4331795.html
Copyright © 2011-2022 走看看