node.js - Redis配置为保存RDB快照,但当前无法在磁盘上持久保存-Ubuntu Server

标签 node.js docker deployment redis

我使用的是Redis Alpine 和容器,我刚在生产中收到此错误-在我的服务器上。
我找到了MISCONF Redis is configured to save RDB snapshots并通过了它,但是那里的任何建议都没有用。

这是错误消息:

    $ node dist/queue.js

events.js:174
      throw er; // Unhandled 'error' event
      ^
ReplyError: 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.
    at parseError (/home/deploy/gympoint/node_modules/redis-parser/lib/parser.js:193:12)
    at parseType (/home/deploy/gympoint/node_modules/redis-parser/lib/parser.js:303:14)
Emitted 'error' event at:
    at /home/deploy/gympoint/node_modules/beequeue/lib/queue.js:322:14
    at /home/deploy/gympoint/node_modules/beequeue/lib/queue.js:177:21
    at Object.callbackOrEmit [as callback_or_emit] (/home/deploy/gympoint/node_modules/redis/lib/utils.js:89:9)
    at RedisClient.return_error (/home/deploy/gympoint/node_modules/redis/index.js:706:11)
    at JavascriptRedisParser.returnError (/home/deploy/gympoint/node_modules/redis/index.js:196:18)
    at JavascriptRedisParser.execute (/home/deploy/gympoint/node_modules/redis-parser/lib/parser.js:572:12)
    at Socket.<anonymous> (/home/deploy/gympoint/node_modules/redis/index.js:274:27)
    at Socket.emit (events.js:198:13)
    at addChunk (_stream_readable.js:287:12)
    at readableAddChunk (_stream_readable.js:268:11)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

最佳答案

发生此错误的原因之一是当您使用Redis容器而没有受到卷的攻击时。要解决此问题,只需将以下行放入docker compose文件:

volumes:
    - "./redis-data:/data"

关于node.js - Redis配置为保存RDB快照,但当前无法在磁盘上持久保存-Ubuntu Server,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58903982/

相关文章:

javascript - 一种知道何时在 javascript 中完成所有回调的方法

Kubernetes 上的 Docker nginx 反向代理

node.js - Node ,针对特定文件类型的不同缓存规则

javascript - 创建 React App + Express.js + Passport.js 登录问题

docker - 如何在 Amazon ECS 上找到服务地址 (URL) 和/或对 Mailtrain 实例进行故障排除?

docker - 在 gitlab-ci 中运行 buildah

deployment - Magento2不自动生成静态文件

python - 无法部署到 Scrapinghub

php - 接收 "Deployment Role Instances Not In Started State After 30 seconds"Azure PHP

node.js - 如何在 typescript 中引用@types/module?