Redis服务停止报错解决方案[NOAUTH Authentication required]
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Redis服务停止报错解决方案[NOAUTH Authentication required]相关的知识,希望对你有一定的参考价值。
Redis服务器设置密码后,使用service redis stop 会出现以下信息:
[[email protected] opt]# service redis stop
Stopping ...
(error) NOAUTH Authentication required.
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 ...
Waiting for Redis to shutdown ...
出现这样的错误信息,redis 这时是没有停止服务的。
可以使用ps -ef | grep redis 查进程号 然后kill 掉,如果在deamon下还需要去删除pid文件,有点繁琐。
解决办法:
修改redis服务脚本,加入如下所示的红色授权信息即可:
vi /etc/init.d/redis
$CLIEXEC -a "youpassword" -p $REDISPORT shutdown
或是自己添加个密码变量,直接引用如下:
vi /etc/init.d/redis #!/bin/sh # chkconfig: 2345 80 90 # # Simple Redis init.d script conceived towork on Linux systems # as it does use of the /proc filesystem. REDISPORT=6389 EXEC=/usr/local/bin/redis-server CLIEXEC=/usr/local/bin/redis-cli RESDISPASSWORD=red29 PIDFILE=/var/run/redis_${REDISPORT}.pid CONF="/etc/redis/${REDISPORT}.conf" case "$1" in start) if [ -f $PIDFILE ] then echo "$PIDFILE exists,process is already running or crashed" else echo "Starting Redisserver..." $EXEC $CONF & fi ;; stop) if [ ! -f $PIDFILE ] then echo "$PIDFILE does notexist, process is not running" else PID=$(cat $PIDFILE) echo "Stopping ..." $CLIEXEC -a $RESDISPASSWORD -p$REDISPORT shutdown while [ -x /proc/${PID} ] do echo "Waiting forRedis to shutdown ..." sleep 1 done echo "Redis stopped" fi ;; *) echo "Please use start or stop as first argument" ;; esac
本文出自 “运维笔录 美玲” 博客,请务必保留此出处http://meiling.blog.51cto.com/6220221/1979896
以上是关于Redis服务停止报错解决方案[NOAUTH Authentication required]的主要内容,如果未能解决你的问题,请参考以下文章
redis修改密码报错(error) NOAUTH Authentication required解决方案
解决Redis报错:Redis客户端在set值时,出现(error) NOAUTH Authentication required.(图文并茂版!!!)
Redis报错-(error) NOAUTH Authentication required.
Spring Boot Starter Data Redis使用Lettuce客户端报错:NOAUTH Authentication required
laravel-echo-server 启动报错 [ioredis] Unhandled error event: ReplyError: NOAUTH Authentication required