Redis 5.0.3默认配置启动报错解决方法

一、redis默认配置启动报错误信息如下

# /usr/local/redis/bin/redis-server /usr/local/src/redis-5.0.3/redis.conf
5852:C 24 Jan 2019 23:00:07.676 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
5852:C 24 Jan 2019 23:00:07.676 # Redis version=5.0.3, bits=64, commit=00000000, modified=0, pid=5852, just started
5852:C 24 Jan 2019 23:00:07.676 # Configuration loaded
5852:M 24 Jan 2019 23:00:07.676 * Increased maximum number of open files to 10032 (it was originally set to 1024).
                _._
           _.-``__ ‘‘-._
      _.-``    `.  `_.  ‘‘-._           Redis 5.0.3 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ‘‘-._
 (    ‘      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|‘` _.-‘|     Port: 6379
 |    `-._   `._    /     _.-‘    |     PID: 5852
  `-._    `-._  `-./  _.-‘    _.-‘
 |`-._`-._    `-.__.-‘    _.-‘_.-‘|
 |    `-._`-._        _.-‘_.-‘    |           http://redis.io
  `-._    `-._`-.__.-‘_.-‘    _.-‘
 |`-._`-._    `-.__.-‘    _.-‘_.-‘|
 |    `-._`-._        _.-‘_.-‘    |
  `-._    `-._`-.__.-‘_.-‘    _.-‘
      `-._    `-.__.-‘    _.-‘
          `-._        _.-‘
              `-.__.-‘

5852:M 24 Jan 2019 23:00:07.677 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
5852:M 24 Jan 2019 23:00:07.677 # Server initialized
5852:M 24 Jan 2019 23:00:07.677 # 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.
5852:M 24 Jan 2019 23:00:07.677 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command ‘echo never > /sys/kernel/mm/transparent_hugepage/enabled‘ as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
5852:M 24 Jan 2019 23:00:07.677 * Ready to accept connections

二、解决方法

1、WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.

# 对一个高负载的环境来说tcp设置128这个值,太小了。

临时生效
echo 1024 > /proc/sys/net/core/somaxconn

永久生效
vim /etc/sysctl.conf
net.core.somaxconn = 1024
sysctl -p

2、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.

# overcommit_memory参数说明:
设置内存分配策略(可选,根据服务器的实际情况进行设置)
/proc/sys/vm/overcommit_memory
可选值:0、1、2。
0、表示内核将检查是否有足够的可用内存供应用进程使用;如果有足够的可用内存,内存申请允许;否则,内存申请失败,并把错误返回给应用进程。
1、表示内核允许分配所有的物理内存,而不管当前的内存状态如何。
2、表示内核允许分配超过所有物理内存和交换空间总和的内存

临时生效
echo 1 > /proc/sys/vm/overcommit_memory

永久生效
vim /etc/syctl.conf
vm.overcommit_memory = 1
sysctl -p

3、WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command ‘echo never > /sys/kernel/mm/transparent_hugepage/enabled‘ as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.

# 你使用的是透明大页,可能导致redis延迟和内存使用问题。

临时生效
echo never > /sys/kernel/mm/transparent_hugepage/enabled

永久生效
vim /etc/rc.local
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
    echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi

chmod +x /etc/rc.local

三、修改后启动无报错状态

# /usr/local/redis/bin/redis-server /usr/local/src/redis-5.0.3/redis.conf
1228:C 24 Jan 2019 23:26:50.044 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1228:C 24 Jan 2019 23:26:50.044 # Redis version=5.0.3, bits=64, commit=00000000, modified=0, pid=1228, just started
1228:C 24 Jan 2019 23:26:50.044 # Configuration loaded
1228:M 24 Jan 2019 23:26:50.044 * Increased maximum number of open files to 10032 (it was originally set to 1024).
                _._
           _.-``__ ‘‘-._
      _.-``    `.  `_.  ‘‘-._           Redis 5.0.3 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ‘‘-._
 (    ‘      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|‘` _.-‘|     Port: 6379
 |    `-._   `._    /     _.-‘    |     PID: 1228
  `-._    `-._  `-./  _.-‘    _.-‘
 |`-._`-._    `-.__.-‘    _.-‘_.-‘|
 |    `-._`-._        _.-‘_.-‘    |           http://redis.io
  `-._    `-._`-.__.-‘_.-‘    _.-‘
 |`-._`-._    `-.__.-‘    _.-‘_.-‘|
 |    `-._`-._        _.-‘_.-‘    |
  `-._    `-._`-.__.-‘_.-‘    _.-‘
      `-._    `-.__.-‘    _.-‘
          `-._        _.-‘
              `-.__.-‘

1228:M 24 Jan 2019 23:26:50.045 # Server initialized
1228:M 24 Jan 2019 23:26:50.045 * DB loaded from disk: 0.000 seconds
1228:M 24 Jan 2019 23:26:50.045 * Ready to accept connections

原文地址:https://www.cnblogs.com/miclesvic/p/10317589.html

时间: 2024-08-25 07:02:23

Redis 5.0.3默认配置启动报错解决方法的相关文章

centos 7.0运行docker出现内存报错解决方法

目前我这里docker是运行在centos 7.0系统里,使用1.5版本docker,最近一台服务器总是不定期死机,通过查看日志发现属于内核bug导致,报错信息如下 May 11 03:43:08 ip-10-10-29-201 kernel: BUG: soft lockup - CPU#4 stuck for 22s! [handler20:1542] May 11 03:43:08 ip-10-10-29-201 kernel: Modules linked in: iptable_nat

Elasticsearch 6.8.4 启动报错解决方法

运行环境:centos 7,jdk 1.8 问题一: ERROR: bootstrap checks failed max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536] 原因:无法创建本地文件问题,用户最大可创建文件数太小 解决方案:切换到root用户,编辑limits.conf配置文件, 添加类似如下内容: vim /etc/security/limi

ipvsadm启动报错解决方法

Centos7 yum -y install ipvadm 安装后,启动ipvsadm却报错. Redirecting to /bin/systemctl start ipvsadm.service Job for ipvsadm.service failed because the control process exited with error code. See "systemctl status ipvsadm.service" and "journalctl -x

Tomcat启动报错java.net.AbstractPlainSocketImpl(java/net/AbstractPlainSocketImpl.java:178:-1)Struts在网络复杂情况下启动报错解决办法

SSH项目 在网络复杂的情况(具体规律未知)下,Tomcat启动时,报如下错误: [ERROR] 2014-08-12 14:52:58,484 [org.apache.struts2.dispatcher.Dispatcher :27] - Dispatcher initialization failedUnable to load configuration. - Class: java.net.AbstractPlainSocketImplFile: AbstractPlainSocket

zabbix源码安装流程及报错解决方法

zabbix源码安装流程及报错解决方法 一. zabbix的介绍 1) zabbix是什么 zabbix是一款基于web页面的.开源的.企业级的,支持分布式部署的监控软件. 2)2.zabbix的作用 监控windows和Linux主机上的软硬件状态. 监控各网络设备,如路由器.交换机.防火墙.f5.打印机等. 支持邮件短信微信等平台发送告警通知. 通过web页面及图形展示监控数据. 3)zabbix的特性 由zabbix server和agent程序协同工作,还支持分布式监控,这时需要安装za

putty生成密钥SSH远程登录注意步骤及报错解决方法

putty生成密钥SSH远程登录注意步骤及报错解决方法 报"Putty server refused our key"(解决)排查步骤: 1..ssh文件夹权限和authorized_keys文件权限 1-1创建.SSH目录及authorized_keys文件 mkdir –p /root/.ssh touch authorized_keys 1-2 修改目录及文件权限 Chmod 700 .ssh Chmod 600 authorized_keys 2. Selinux安全机制和Ip

报错解决方法Error: Can't connect to local MySQL server through socket

Error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)Errno.: 2002解决方法一:因为你还没有启动mysql,当你启动mysql后,mysql.sock就会自动的生成../bin/safe_mysqld   --user=root   &(这是默认的).如果还没有,就是MYSQL权限没给,或其它原因还有就是 你的mysql是否启动了      启动后一般很难出现这个

PS win7_无法打开提示MSVCP120.dll报错解决方法

PS win7_无打开提示MSVCP120.dll报错解决方法 1.PS软件安装后无法打开,并提示MSVCP120.dll"ps无法启动此程序此 因为计算机中丢失msvcp120.dll" 报错提示: 问题解决方法: 下载DirectX Repair工具-安装并运行即可,会自动检测是否丢失msvcp120.dll等一系列套件. 提示图片: 下载链接:http://www.pc6.com/softview/SoftView_57945.html 注:根据自己本身使用系统版本,下载Dire

c# winform 引用sqlite.dll 运行报错解决方法

错误信息 :  未能加载文件或程序集“System.Data.SQLite, Version=1.0.81.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139”或它的某一个依赖项.试图加载格式不正确的程序. 原因是 此sqlite.dll 是32位的. 解决方法 ,将项目的 目标平台改为 x86 如图 c# winform 引用sqlite.dll 运行报错解决方法