開啟redis-server提示 # Creating Server TCP listening socket *:6379: bind: Address already in use--解決方法


 

源問題

 

在bin目錄中開啟redis服務器,完整提示如下:

 

[java]  view plain  copy
  1. 3496:C 25 Apr 00:56:48.717 # Warning: no config file specified, using the default config.   
  2. In order to specify a config file use ./redis-server /path/to/redis.conf  
  3. 3496:M 25 Apr 00:56:48.719 * Increased maximum number of open files to 10032 (it was originally set to 1024).  
  4. 3496:M 25 Apr 00:56:48.733 # Creating Server TCP listening socket *:6379: bind: Address already in use  

 

 

最后一句提示:6379地址已經在使用(6379是redis默認的端口)

 

解決步驟

 

 

需要操作三步 :

 

①找到該進程;

找到redis-server 的進程 (Process Status)

輸入命令:

 

[java]  view plain  copy
  1. ps -ef | grep -i redis  

 

 

[java]  view plain  copy
  1. root      3086     1  0 Apr24 ?        00:00:07 ./bin/redis-server *:6379        
  2. root      3531  3467  01:00 pts/0    00:00:00 grep -i redis  

 

 

進程號為 3086 即為redis服務器

 

②殺死該進程;

使用kill 命令

輸入命令:

 

[java]  view plain  copy
  1. kill -3086  

 

 

③然后重新啟動redis服務器。

輸入命令:

 

[java]  view plain  copy
  1. ./redis-server  

 

redis-server開啟成功后提示如下圖:

 

個人公眾號謝謝各位老鐵支持


免責聲明!

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



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