Error set: Redis restart service error (Waiting for Redis to shutdown...)

1. An error is reported when the redis service is closed

/etc/init.d/redis_6379 restart
Stopping ...
(error) NOAUTH Authentication required.
Waiting for Redis to shutdown ...
Waiting for Redis to shutdown ...

Insert picture description here
2. Solution
(1) Close the redis database password

[root@localhost ~]#redis-cli  -p 6379
127.0.0.1:6379> AUTH 123456
OK
127.0.0.1:6379> config set requirepass 
(error) ERR Unknown subcommand or wrong number of arguments for 'set'. Try CONFIG HELP.
127.0.0.1:6379> config set requirepass ''   #关键需要改空密码
OK
127.0.0.1:6379> quit
[root@localhost ~]#/etc/init.d/redis_6379 restart
Stopping ...
Redis stopped
Starting Redis server...
[root@localhost ~]#

Insert picture description here

(2) Kil kills the process

  • I first checked whether the service was still running, and then checked the configuration file, there was no problem
    Insert picture description here

  • So I want to kill the redis service by killing it and start it again. It prompts that the /var/run/redis_6379.pid file exists, delete the pid file, restart the service, and it succeeds.
    Insert picture description here

  • You can log in, but the password is gone
    Insert picture description here

(3) Direct rm to delete the pid file, you can log in, the password is still there
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_51326240/article/details/114261345