1. 程式人生 > >redis報(error) ERR Errors trying to SHUTDOWN. Check logs.

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

director distance ted end only conf 問題 sin lena

今天重啟redis 無法正常關閉報(error) ERR Errors trying to SHUTDOWN. Check logs.錯誤

[zykj@localhost src]$ redis-cli -p 6379 shutdown 
(error) ERR Errors trying to SHUTDOWN. Check logs.

  首先檢查一下是否是權限的問題,因為在shutdown命令的時候,會進行save操作,而save需要操作dump.rdb文件,如果沒有權限則會報這個錯.

如果權限沒問題 打開redis安裝目錄下的redis.conf找到

# 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 ./

  把dir ./改為相應的目錄,如“dir /home/distance/redis_dbfiles/”(這裏需要註意最後的斜杠不能忘記,如果缺失斜杠可能會解析為文件而非目錄),保存。

再次嘗試 成功啟動

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