gpt4 book ai didi

redis 快照位置与配置中指定的不一致

转载 作者:可可西里 更新时间:2023-11-01 11:14:35 24 4
gpt4 key购买 nike

正常运行一段时间后,我的 redis 实例出现写入错误:

(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.

在日志中我看到:

 9948:C 22 Mar 20:49:32.241 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system

但是,我的 redis 配置文件是/etc/redis/redis.conf 确认:

 redis-cli -p 6379 info | grep 'config_file'
config_file:/etc/redis/redis.conf

我有:

 dir /mnt/data/redis

确实,那里有一个快照。

但尽管如此,redis 现在认为我的数据目录是

 redis-cli -p 6379 CONFIG GET dir
1) "dir"
2) "/var/spool/cron"

对应于上面引用的错误。

谁能告诉我为什么/如何在 redis 启动后我的数据目录发生变化,以至于它不再是配置文件中指定的内容?

最佳答案

所以答案是redis服务器被黑了,配置变了,事实证明这很容易做到。 (我应该指出,我没有理由认为这不容易做到。我只是假设在这种情况下通过默默无闻的安全性就足够了——错了。无论如何,这只是一个 Playground ,而不是任何类型的生产服务器) .

所以不要向世界开放你的 redis 端口。如果在 AWS 上使用安全组来限制对需要它的机器的访问,或者使用 AUTH(这仍然不是很棒,因为所有客户端都需要知道单个密码,该密码显然也以明文形式发送) ,或者有一些中间件控制访问。

入侵 Redis 很容易,可能会危及您的数据,甚至可以对您的服务器进行未经授权的 SSH 访问。这就是为什么你不应该强调。

关于redis 快照位置与配置中指定的不一致,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55307646/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com