查看: 1747|回复: 0

[课堂笔记] linux端redis启动报错解决方法汇总


 关闭 18-2-2 17:55:05 | [复制链接]

5

主题

17

帖子

84

积分

大虾

Rank: 2

发表于 18-2-2 17:55:05 | 显示全部楼层 |阅读模式
最近在Ubuntu虚拟机上安装redis,可把我忙坏了,网上很多教程都比较过时了,下面就发一点我这儿有效的启动报错解决方案

警告:
Increased maximum number of open files to 10032 (it was originally set to 1024).
解决办法:
  1. #查看系统限制
  2. [root@Ubuntu01]# ulimit -a

  3. #设置“open files”数量
  4. [root@Ubuntu01]# ulimit -n 10032

  5. #或者设置用户限制
  6. [root@Ubuntu01]# vi /etc/security/limits.conf
复制代码

警告:
WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
解决办法:
  1. [root@Ubuntu01]# echo 511 >/proc/sys/net/core/somaxconn
  2. [root@Ubuntu01]# echo "net.core.somaxconn = 551" > /etc/sysctl.conf
复制代码



警告:
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.
解决办法:
  1. [root@Ubuntu01]# echo 1 > /proc/sys/vm/overcommit_memory
  2. [root@Ubuntu01]# echo "vm.overcommit_memory=1" >> /etc/sysctl.conf
复制代码


警告:
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.
解决办法:
  1. [root@Ubuntu01]# echo never > /sys/kernel/mm/transparent_hugepage/enabled
  2. [root@Ubuntu01]# vi /etc/rc.local
  3. if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
  4.    echo never > /sys/kernel/mm/transparent_hugepage/enabled
  5. fi
  6. if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
  7.    echo never > /sys/kernel/mm/transparent_hugepage/defrag
  8. fi
复制代码


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

订阅|小黑屋|手机版|千锋教育论坛 ( 京ICP备12003911号-3 )

GMT+8, 20-4-7 06:31 , Processed in 0.373653 second(s), 41 queries .

Powered by Discuz! X3.2

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表