redis error:Waiting for Redis to shutdown ...(无法关闭redis)

Posted TaKe___Easy

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了redis error:Waiting for Redis to shutdown ...(无法关闭redis)相关的知识,希望对你有一定的参考价值。

  • 问题:
    无法关闭redis服务,提示一直等待关闭
[root@localhost init.d]# /etc/init.d/redis_6379 stop
Stopping ...
Could not connect to Redis at 127.0.0.1:6379: Connection refused
Waiting for Redis to shutdown ...
Waiting for Redis to shutdown ...
Waiting for Redis to shutdown ...
Waiting for Redis to shutdown ...
Waiting for Redis to shutdown ...
  • 原因:
    redis启用安全认证,requirepass该配置后,对应也要修改启动和关闭的脚本,在脚本关闭处指定IP和密码参数:-h 192.168.131.10 -a password
  • 修改:
    修改/etc/init.d/redis_6379文件的第43行。指定主机IP和密码参数
[root@localhost ~]# cd /etc/init.d/
[root@localhost init.d]# ls
functions  netconsole  network  README  redis_6379
[root@localhost init.d]# vim redis_6379 
 43             $CLIEXEC -h 192.168.131.10 -p $REDISPORT -a hadoop shutdown

[root@localhost init.d]# /etc/init.d/redis_6379 stop
Stopping ...
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
Waiting for Redis to shutdown ...
Redis stopped
[root@localhost init.d]# /etc/init.d/redis_6379 start 
Starting Redis server...
[root@localhost init.d]# /etc/init.d/redis_6379 status
Redis is running (1813)
  • 或者直接将密码设置为空
[root@localhost ~]# /etc/init.d/redis_6379 restart
Stopping ...
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
(error) NOAUTH Authentication required.
Waiting for Redis to shutdown ...
Waiting for Redis to shutdown ...

[root@localhost ~]# redis-cli -h 192.168.131.10 -p 6379
192.168.131.10:6379> auth 5514
OK
192.168.131.10:6379> CONFIG SET requirepass ''
OK
[root@localhost ~]# /etc/init.d/redis_6379 restart
Stopping ...
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
Waiting for Redis to shutdown ...
Redis stopped
Starting Redis server...

以上是关于redis error:Waiting for Redis to shutdown ...(无法关闭redis)的主要内容,如果未能解决你的问题,请参考以下文章

redis集群 Waiting for the cluster to join 一直等待

redis cluster 一直在等待 Waiting for the cluster to join

Redis集群部署一直卡在Waiting for the cluster to join ......(Redis集群总线配置)

搭建Redis集群遇到的问题:Waiting for the cluster to join...

性能测试案例:redis获取不到连接池,Timeout waiting for idle object

DHCP request error:Timed out waiting for dhcpcd to start