報錯解決——# Creating Server TCP listening socket *:6379: bind: Address already in use


  在啟動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

 

 

 

      

 

    


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM