redis服务器无法启动或无法连接上

错误信息:Job for redis-server.service failed because the control process exited with error code. See "systemctl status redis-server.service" and "journalctl -xe" for details.

或者客户端去链接时的错误信息:

Could not connect to Redis at 127.0.0.1:6379: Connection refused

Could not connect to Redis at 127.0.0.1:6379: Connection refused


ps -ef|grep redis 查看redis服务器进程

sudo kill -9 pid 杀死redis服务器

sudo redis-server /etc/redis/redis.conf 指定加载的配置文件


把redis的所有显示的都杀掉,包括

python 104924 103363 0 00:08 pts/23 00:00:00 grep --color=auto redis

但是这个是会自动重启的,这就对了。

然后再次 sudo redis-server /etc/redis/redis.conf  启动   

连接redis

redis-cli

就完成了。

你可能感兴趣的:(redis服务器无法启动或无法连接上)