Redis error currently not able to persist on disk

When doing a FLUSHALl on redis server, i get following error message

[root@server ~]# redis-cli FLUSHALL
(error) MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.
[root@server ~]#

The error was because redis data directory was not properly configured.

To fix, the error, edit redis config file

vi /etc/redis/redis.conf

Find

dir ./

Replace with

dir /var/lib/redis

Create a directory

mkdir /var/lib/redis

Make it owned by user redis

chown redis:redis /var/lib/redis

Restart redis server

systemctl restart redis

See Redis

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *