redis start error: /var/run/redis_6379.pid exists, process is already running or crashed

created at 03-31-2022 views: 9

problem

Execute the self-start command:

/etc/init.d/redis_6379 start

An error occurred:

/var/run/redis_6379.pid exists, process is already running or crashed

solution

1.View the /var/run/redis_6379.pid file

vi /var/run/redis_6379.pid

2.Compare the current redis process

ps -ef | grep redis

Check whether the pid in the current process is inconsistent with /var/run/redis_6379.pid. The above situation is mostly caused by the inconsistency of the process id (in my environment, the process id is inconsistent due to restarting the system. )

3.The key step:

Delete the wrong process and restart redis

rm -rf /var/run/redis_6379.pid

reboot

/etc/init.d/redis_6379 start

The above are the steps I took to solve the above redis error for your reference.

Please log in to leave a comment.