redis-server 提示 Address already in use

报错信息

xxx@xxx ~ % redis-server
1637:C 29 Feb 2020 13:09:01.898 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1637:C 29 Feb 2020 13:09:01.898 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=1637, just started
1637:C 29 Feb 2020 13:09:01.898 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1637:M 29 Feb 2020 13:09:01.899 * Increased maximum number of open files to 10032 (it was originally set to 256).
1637:M 29 Feb 2020 13:09:01.900 # Could not create server TCP listening socket *:6379: bind: Address already in use

listening socket *:6379: bind: Address already in use
表示6379端口已经在使用(6379是redis默认的端口)

解决方法

  1. 查找redis-server 的进程 (Process Status)
ps -ef | grep -i redis

结果如下:

xxx@xxx ~ % ps -ef | grep -i redis
  501  1496     1   0  1:02下午 ??         0:00.37 redis-server *:6379
  501  1697  1654   0  1:10下午 ttys001    0:00.00 grep -i redis

进程结果

  1. 杀死6379对应的进程
kill -9 1496 #每个人对应的会不一样
  1. 重启redis-server
redis-server

结果如下:
redis-server 提示 Address already in use_第1张图片

你可能感兴趣的:(redis-server 提示 Address already in use)