报错处理——# Creating Server TCP listening socket *:6379: bind: Address already in use

本文介绍了解决Redis启动时因6379端口被占用而引发的错误的方法。通过使用ps和grep命令查找占用端口的进程,并使用kill命令结束该进程,最后重启Redis服务,成功解决了端口冲突问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  在启动redis时报错

 # Creating Server TCP listening socket *:6379: bind: Address already in use

 

错误原因

  6379地址已经在使用(6379是redis默认的端口)

 

解决方法

  •   使用命令找到占用端口号的进程:
ps -ef | grep -i redis

得到类似如下的信息

  501  2267     1   0  3 119  ??         8:17.40 redis-server *:6379
  501 48677 48662   0  3:17下午 ttys002    0:00.00 grep -i redis
  •   kill该进程
kill -9 2267
  •   重启redis
redis-server

大功告成

48678:C 24 Jan 15:18:20.870 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
48678:C 24 Jan 15:18:20.871 # Redis version=4.0.11, bits=64, commit=00000000, modified=0, pid=48678, just started
48678:C 24 Jan 15:18:20.871 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
48678:M 24 Jan 15:18:20.873 * Increased maximum number of open files to 10032 (it was originally set to 256).
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 4.0.11 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 48678
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

48678:M 24 Jan 15:18:20.889 # Server initialized
48678:M 24 Jan 15:18:31.003 * DB loaded from disk: 10.114 seconds
48678:M 24 Jan 15:18:31.003 * Ready to accept connections

 

 

 

      

 

    

转载于:https://www.cnblogs.com/zhuminghui/p/10314714.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值