[ies@DCLOUD09 bin]$ ./redis-server
23997:C 23 Sep 09:52:18.038 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
23997:M 23 Sep 09:52:18.040 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
23997:M 23 Sep 09:52:18.040 # Redis can't set maximum open files to 10032 because of OS error: Operation not permitted.
23997:M 23 Sep 09:52:18.040 # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.0.0 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 23997
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
23997:M 23 Sep 09:52:18.042 # Server started, Redis version 3.0.0
23997:M 23 Sep 09:52:18.042 # 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.
23997:M 23 Sep 09:52:18.042 # 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.
23997:M 23 Sep 09:52:18.042 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
23997:M 23 Sep 09:52:18.042 # Can't handle RDB format version 9
23997:M 23 Sep 09:52:18.042 # Fatal error loading the DB: Invalid argument. Exiting.
1、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账号登录 找到/etc/sysctl.conf文件,
增加这句话 vm.overcommit_memory = 1。执行sysctl -p生效配置或执行sysctl vm.overcommit_memory = 1
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.
解决方法:
其实警告信息已经说的很明白了。
临时解决:root用户执行echo never > /sys/kernel/mm/transparent_hugepage/enabled
永久解决:将上面这句话写入到/etc/rc.local文件中。
修改完成后要重启redis。
3、WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
解决方法:将net.core.somaxconn = 1024添加到/etc/sysctl.conf中,然后执行sysctl -p生效配置。