I get the following error, whenever I execute any commands that modify data in redis
Redis is configured to save RDB snapshots, but is currently not able to persist on disk.
Commands that may modify the data set are disabled.
Please check Redis logs for details about the error.
I installed redis using brew on mac. How can I get the location of log files where redis-server logs information to. I tried looking for redis conf. file, but couldn't find it either.
What is the default location of [1] redis conf file [2] redis log file.
How do I get rid of the above error, and be able to execute commands that modify data in redis.
Best Answer
When installing with brew the logfile is set to stdout. You need to edit
/usr/local/etc/redis.conf
and change logfile to something else. I set mine to:You'll also make sure the user that runs redis has write permissions to the logfile, or redis will simply fail to launch completely. Then just restart redis:
After restarting it'll take a while for the error to show up in the logs, because it happens after redis fails its timed flushes. You should be seeing something like:
After a brew install it attempts to save to
/usr/local/var/db/redis/
and since redis is probably running as your current user and not root, it can't write to it. Once redis has permission to write to the directory, your logfile will say:and the
stop-writes-on-bgsave-error
error will no longer get raised.