redis启动报错

redis版本:3.2.12
安装完redis后发现启动有警告:虽不影响正常使用,但还是要解决。

如下:
redis启动报错_第1张图片

警告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.

解决方案:
在/ietc/sysctl.conf中添加:net.core.somaxconn= 1024,然后执行:sysctl -p

警告2:

 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延迟和使用问题。

解决方案:
在/etc/rc.local文件中添加:

if test -f /sys/kernel/mm/redhat_transparent_hugepage/enabled; then
   echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
fi

你可能感兴趣的