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

created at 03-31-2022 views: 78

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.

created at:03-31-2022
edited at: 05-30-2022: