I'm trying to perform a save or bgsave on my redis instance to run through the backup/restore process. I'm getting errors when I try to save however:
532:M 28 Jun 23:58:30.396 # Failed opening the RDB file backup.rdb (in server root dir /var/lib/redis) for saving: Read-only file system
Permissions on the /var/lib/redis
folder:
$@/var/lib$ ls -artl | grep redis
drwxrwxrwx 3 redis redis 4096 Jun 28 23:58 redis
Permissions on the /var/lib
folder:
$@/var$ ls -artl | grep lib
drwxrwxrwx 31 root root 4096 Jun 28 23:44 lib
Permissions on the /var
folder:
$@/$ ls -artl | grep var
drwxrwxrwx 11 root root 4096 Jul 18 2016 var
Redis CLI output for config get dir
:
1) "dir"
2) "/var/lib/redis"
Redis CLI output for config get dbfilename
:
1) "dbfilename"
2) "backup.rdb"
Error from redis:
532:M 28 Jun 23:58:30.396 # Failed opening the RDB file backup.rdb (in server root dir /var/lib/redis) for saving: Read-only file system
Any help would be much appreciated!
rdb file can be found under the /data directory in the container. You can also request RDB files on demand by using the SAVE and BGSAVE commands. The SAVE command is synchronous.
Using redis-cli SAVE command At this stage, the RDB file will be saved in /var/lib/redis/ and will be named dump. rdb .
By default Redis saves snapshots of the dataset on disk, in a binary file called dump. rdb . You can configure Redis to have it save the dataset every N seconds if there are at least M changes in the dataset, or you can manually call the SAVE or BGSAVE commands.
You need to add the following to your /etc/systemd/system/redis-server unit file:
ReadWriteDirectories=-/var/lib/redis
Note that /var/lib/redis
is the default, but if in your /etc/redis/redis.conf
you set a different dir
config option, you will need to set ReadWriteDirectories
to that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With