redis启动报错(TCP backlog setting of 511/overcommit_memory is set to 0/THP)
-
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 vim /etc/sysctl.conf
2
3 ```
4 # 添加内容
5 net.core.somaxconn = 1024
6 vm.overcommit_memory = 1
7 ```
8
9 /sbin/sysctl -p
-
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.
加入上一个问题的代码就可以解决
-
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.
追加代码到 /etc/rc.local 配置中
1 if test -f /sys/kernel/mm/redhat_transparent_hugepage/enabled; then
2 echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
3 fi