解决开启redis失败:/var/run/redis_6379.pid exists, process is already running or crashed问题

问题1:启动redis失败

[[email protected] ~]# systemctl start redis_6379
[[email protected] ~]# systemctl status redis_6379

解决开启redis失败:/var/run/redis_6379.pid exists, process is already running or crashed问题

[[email protected] ~]# netstat -tnlp

解决开启redis失败:/var/run/redis_6379.pid exists, process is already running or crashed问题
解决方案:

1.根据提示信息删除pid文件

[[email protected] ~]# rm -rf /var/run/redis_6379.pid

2.删除dump.rdb(内存快照)文件

[[email protected] ~]# cd /var/lib/redis/6379
[[email protected] 6379]# ls
dump.rdb
[[email protected] 6379]# rm -f dump.rdb 

测试:

[[email protected] ~]# systemctl restart redis_6379
[[email protected]  ~]# netstat -antlp

解决开启redis失败:/var/run/redis_6379.pid exists, process is already running or crashed问题
问题2:启动redis成功,发现6379端口,但查看状态仍旧是exited

[[email protected] run]# systemctl start redis_6379
[[email protected] run]# systemctl status redis_6379

解决开启redis失败:/var/run/redis_6379.pid exists, process is already running or crashed问题

[[email protected] run]# netstat -antlp

解决开启redis失败:/var/run/redis_6379.pid exists, process is already running or crashed问题
解决方案:

直接用kill发信号杀死redis进程,再重新开启即可

[[email protected] run]# kill -9 2420
[[email protected] run]# netstat -antlp

解决开启redis失败:/var/run/redis_6379.pid exists, process is already running or crashed问题

[[email protected] run]# systemctl start redis_6379

测试:

[[email protected] run]# systemctl status redis_6379

解决开启redis失败:/var/run/redis_6379.pid exists, process is already running or crashed问题