【发布时间】:2016-01-26 20:05:39
【问题描述】:
根据 docker 文档,我尝试了一个非常简单的带有 redis 的 python 应用程序的第一次测试。这会在一段时间后崩溃,因为 redis 无法持久化。我不知道为什么。你可以在这里找到公共回购:Github repo
我当前的 docker-compose.yml 是:
web:
build: .
ports:
- "5000:5000"
volumes:
- .:/code
links:
- redis
redis:
image: redis:latest
volumes:
- ./data:/data
编辑:这是日志的摘录:
1:M 09 Feb 10:51:15.130 # Background saving error
1:M 09 Feb 10:51:21.072 * 100 changes in 300 seconds. Saving...
1:M 09 Feb 10:51:21.073 * Background saving started by pid 345
345:C 09 Feb 10:51:21.074 # Failed opening .rdb for saving: Permission denied
1:M 09 Feb 10:51:21.173 # Background saving error
1:M 09 Feb 10:51:27.011 * 100 changes in 300 seconds. Saving...
1:M 09 Feb 10:51:27.011 * Background saving started by pid 346
346:C 09 Feb 10:51:27.013 # Failed opening .rdb for saving: Permission denied
Edit2:这是 Redis 在 python 中抛出的完整错误:
MISCONF 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
有趣的是,我没有对 redis 图像做任何事情。
【问题讨论】:
-
它一定是你机器里的东西,我已经测试了你的 .yml 文件,它对我有用
-
你确定它崩溃是因为 Redis 不能持久化吗?这不是 Redis 的行为方式
-
你可以通过
docker logs --follow <container_name or container_id>查看你的redis容器的日志。你可以在这里查看并发布吗? -
您好,我已经添加了日志的摘录。
标签: docker redis docker-compose