was服务器修改open files,linux上启动redis服务端错误信息:"Increased maximum number of open files to 10032 (it was ori...

redis-server启动报错

1.刚安装好redis,使用redis-server命令启动服务时,报出如下错误:

$ redis-server # 启动redis服务端

24730:C 06 Apr 2021 08:34:13.802 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo

24730:C 06 Apr 2021 08:34:13.802 # Redis version=5.0.3, bits=64, commit=00000000, modified=0, pid=24730, just started

24730:C 06 Apr 2021 08:34:13.802 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf

24730:M 06 Apr 2021 08:34:13.803 # Could not create server TCP listening socket *:6379: bind: Address already in use

(1)解决错误信息:

# 查看系统限制

$ ulimit -a

3ad6bb4c5b5496816fd654606dbbe160.png

设置“open files”数量

$ ulimit -n 10032

2.再次进入redis服务端,如下错误:

$ redis-server

24156:C 06 Apr 2021 08:25:55.117 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo

24156:C 06 Apr 2021 08:25:55.117 # Redis version=5.0.3, bits=64, commit=00000000, modified=0, pid=24156, just started

24156:C 06 Apr 2021 08:25:55.117 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf

24156:M 06 Apr 2021 08:25:55.118 # Could not create server TCP listening socket *:6379: bind: Address already in use

(2)解决错误信息:

$ ps -ef | grep -i redis --color=always

78ecdefa7776e181cc152938dde5c0b0.png

进程号24151是redis的服务器

2.2、杀死该进程

如果是用apt-get或者yum install安装的redis,可以直接通过下面的命令停止/启动/重启redis

/etc/init.d/redis-server stop

/etc/init.d/redis-server start

/etc/init.d/redis-server restart

如果是通过源码安装的redis,则可以通过redis的客户端程序 redis-cli 的 shutdown 命令来重启redis

redis-cli -h 127.0.0.1 -p 6379 shutdown

如果上述方式都没有成功停止redis,则可以使用终极武器  kill -9

使用"kill -9"命令

kill -9 24151  # 进程24151是redis服务进程的进程号

2.3、重新启动redis服务器

$ redis-server

25128:C 06 Apr 2021 08:38:45.830 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo

25128:C 06 Apr 2021 08:38:45.830 # Redis version=5.0.3, bits=64, commit=00000000, modified=0, pid=25128, just started

25128:C 06 Apr 2021 08:38:45.830 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf

_._

_.-``__ ''-._

_.-`` `. `_. ''-._ Redis 5.0.3 (00000000/0) 64 bit

.-`` .-```. ```\/ _.,_ ''-._

( ' , .-` | `, ) Running in standalone mode

|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379

| `-._ `._ / _.-' | PID: 25128

`-._ `-._ `-./ _.-' _.-'

|`-._`-._ `-.__.-' _.-'_.-'|

| `-._`-._ _.-'_.-' | http://redis.io

`-._ `-._`-.__.-'_.-' _.-'

|`-._`-._ `-.__.-' _.-'_.-'|

| `-._`-._ _.-'_.-' |

`-._ `-._`-.__.-'_.-' _.-'

`-._ `-.__.-' _.-'

`-._ _.-'

`-.__.-'

25128:M 06 Apr 2021 08:38:45.831 # Server initialized

25128:M 06 Apr 2021 08:38:45.831 # 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.

25128:M 06 Apr 2021 08:38:45.831 # 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.

25128:M 06 Apr 2021 08:38:45.831 * Ready to accept connections

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值