Redis 5.05 版本启动警告解决

mac2022-06-30  113

 # Redis启动告警解决办法

[root@resiones bin]# ./redis-server ./redis.conf 22750:C 03 Jun 2019 00:02:49.878 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo 22750:C 03 Jun 2019 00:02:49.878 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=22750, just started 22750:C 03 Jun 2019 00:02:49.878 # Configuration loaded 22750:M 03 Jun 2019 00:02:49.879 * Increased maximum number of open files to 10032 (it was originally set to 1024). _._ _.-``__ ''-._ _.-`` `. `_. ''-._ Redis 5.0.5 (00000000/0) 64 bit .-`` .-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in standalone mode |`-._`-...-` __...-.``-._|'` _.-'| Port: 6379 | `-._ `._ / _.-' | PID: 22750 `-._ `-._ `-./ _.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | http://redis.io `-._ `-._`-.__.-'_.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | `-._ `-._`-.__.-'_.-' _.-' `-._ `-.__.-' _.-' `-._ _.-' `-.__.-' 22750:M 03 Jun 2019 00:02:49.881 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128. 22750:M 03 Jun 2019 00:02:49.881 # Server initialized 22750:M 03 Jun 2019 00:02:49.881 # 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. 22750:M 03 Jun 2019 00:02:49.881 # 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. 22750:M 03 Jun 2019 00:02:49.881 * Ready to accept connections

告警一:

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

解决办法:

[root@resiones]# echo 551 >/proc/sys/net/core/somaxconn [root@resiones]# echo "net.core.somaxconn = 551" > /etc/sysctl.conf 或者修改Redis.conf #修改参数 tcp-backlog 128

警告二:

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.

解决办法:

[root@resines]# echo 1 > /proc/sys/vm/overcommit_memory [root@resines]# echo "vm.overcommit_memory=1" >> /etc/sysctl.conf [root@resines]# sysctl -p

警告三:

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.

解决办法:

[root@resines]# echo never > /sys/kernel/mm/transparent_hugepage/enabled [root@resines]# vi /etc/rc.local if test -f /sys/kernel/mm/transparent_hugepage/enabled; then echo never > /sys/kernel/mm/transparent_hugepage/enabled fi if test -f /sys/kernel/mm/transparent_hugepage/defrag; then echo never > /sys/kernel/mm/transparent_hugepage/defrag fi

警告四:

Increased maximum number of open files to 10032 (it was originally set to 1024).

解决办法:

#查看系统限制 [root@centos224]# ulimit -a #设置“open files”数量 [root@centos224]# ulimit -n 10032 #或者设置用户限制 [root@centos224]# vi /etc/security/limits.conf * soft nofile 10032 #表示任何一个用户可以打开的最大的文件描述符数量 * hard nofile 10032 * soft nproc 10032 #表示任何一个用户可以打开的最大的进程数 * hard nproc 10032

 

 

最新回复(0)