您的位置:首页 > 理论基础 > 计算机网络

开启redis-server报错 # Creating Server TCP listening socket *:6379: bind: Address already in use--解决方法

2017-12-11 17:12 691 查看

源问题(1)

在bin目录中开启redis服务器,完整提示如下:

Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
7178:M 11 Dec 00:51:04.350 * Increased maximum number of open files to 10032 (it was originally set to 1024).

解决:

#查看系统限制
[root@centos224]# ulimit -a

#设置“open files”数量
[root@centos224]# ulimit -n 10032

#或者设置用户限制
[root@centos224]# vi /etc/security/limits.conf

源问题(2):

3496:C 25 Apr 00:56:48.717 # Warning: no config file specified, using the default config.   
In order to specify a config file use ./redis-server /path/to/redis.conf  
3496:M 25 Apr 00:56:48.719 * Increased maximum number of open files to 10032 (it was originally set to 1024).  
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)

输入命令:

ps -ef | grep -i redis
root      3086     1  0 Apr24 ?        00:00:07 ./bin/redis-server *:6379
root      3531  3467  0 01:00 pts/0    00:00:00 grep -i redis


进程号为 3086 即为redis服务器

②杀死该进程;

使用kill 命令

输入命令:

kill -9 3086


③然后重新启动redis服务器。

输入命令:

redis-server
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐