无法打开RDB文件...只读文件系统 [英] Failed opening the RDB file ... Read-only file system

查看:189
本文介绍了无法打开RDB文件...只读文件系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的Redis实例上执行保存或bgsave以通过备份/还原过程运行.但是,当我尝试保存时出现错误:

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

/var/lib/redis文件夹上的权限:

$@/var/lib$ ls -artl | grep redis
drwxrwxrwx  3 redis    redis    4096 Jun 28 23:58 redis

/var/lib文件夹上的权限:

$@/var$ ls -artl | grep lib
drwxrwxrwx 31 root root  4096 Jun 28 23:44 lib

/var文件夹上的权限:

$@/$ ls -artl | grep var
drwxrwxrwx  11 root root  4096 Jul 18  2016 var

config get dir的Redis CLI输出:

Redis CLI output for config get dir:

1) "dir"
2) "/var/lib/redis"

config get dbfilename的Redis CLI输出:

Redis CLI output for config get dbfilename:

1) "dbfilename"
2) "backup.rdb"

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

任何帮助将不胜感激!

推荐答案

您需要将以下内容添加到/etc/systemd/system/redis-server单元文件中:

You need to add the following to your /etc/systemd/system/redis-server unit file:

ReadWriteDirectories=-/var/lib/redis

请注意,默认值为/var/lib/redis,但是如果在/etc/redis/redis.conf中设置了不同的dir配置选项,则需要为此设置ReadWriteDirectories.

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.

这篇关于无法打开RDB文件...只读文件系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆