redis shutdown (error) ERR Errors trying to SHUTDOWN. Check logs.

来源:互联网 发布:apk优化 编辑:程序博客网 时间:2024/05/21 06:01

    1.打开配置文件redis.conf  我的在/usr/local/redis 下

    2.修改log路径(此步奏是为了查看使用 shutdown 指令 出错在哪)

      sudo vi redis.conf

     找到 logfile ""  

     修改为: logfile /usr/local/redis/redis_log/redis_log.log
     如果/usr/local/redis 下面没有相应的文件夹和文件对应创建且 赋予读写权限

    使用指令: sudo chmod 777 redis_log.log

  3.将dir /. 修改为dir/usr/local/redis/redis_dbfile/

# The working directory.
#
# The DB will be written inside this directory, with the filename specified
# above using the 'dbfilename' configuration directive.
#
# The Append Only File will also be created inside this directory.
#
# Note that you must specify a directory here, not a file name.
dir /usr/local/redis/redis_dbfile/

     4.若使用shutdown 还是显示(error) ERR Errors trying to SHUTDOWN. Check logs.  则可以查看redis_log.log文件

我出现  文件夹没有足够权限 和 打开文件过多的情况 只要对应 赋予权限 kill 掉文件夹进程即可  

     解决后即可以使用 shutdown 指令显示 not connected