MongoDB 恢复似乎卡住/没有进展

发布于 2025-01-11 14:46:00 字数 1188 浏览 3 评论 0原文

mongodump 之后,我尝试使用 mongorestore 进行恢复。

它在几秒钟内即可在本地运行。但是,当我 kubectl exec -it 进入主 mongodb 节点的 pod 并运行相同的命令时,它会卡住并无休止地以相同的进度和更新的时间戳重复该行(第一个和最后一个除时间戳外,行均相同,因此进度为 0)。这大约持续了 5 个小时,然后我因 ​​OOM 错误而被抛出。

我正在使用 mongo:3.6.9

2022-03-02T22:56:36.043+0000    [#############...........]  mydb.users  3.65MB/6.37MB  (57.4%)
2022-03-02T22:56:39.043+0000    [#############...........]  mydb.users  3.65MB/6.37MB  (57.4%)
2022-03-02T22:56:42.043+0000    [#############...........]  mydb.users  3.65MB/6.37MB  (57.4%)
2022-03-02T22:56:45.043+0000    [#############...........]  mydb.users  3.65MB/6.37MB  (57.4%)
2022-03-02T22:56:48.043+0000    [#############...........]  mydb.users  3.65MB/6.37MB  (57.4%)
2022-03-02T22:56:51.043+0000    [#############...........]  mydb.users  3.65MB/6.37MB  (57.4%)
2022-03-02T22:56:54.043+0000    [#############...........]  mydb.users  3.65MB/6.37MB  (57.4%)

当我从指定所有 mongo pod 的恢复容器执行 mongorestore 时,行为相同 mongorestore --db=mydb --collection=users data/mydb/users.bson --host mongo-0.mongo,mongo-1.mongo,mongo-2.mongo --port 27017

还有什么我可以尝试的吗?

After a mongodump I am trying to restore using mongorestore.

It works locally in seconds. However, when I kubectl exec -it into the pod of the primary mongodb node and run the same command it gets stuck and endlessly repeats the line with the same progress and an updated timestamp (the first and the last line are the same except the timestamp, so 0 progress). This goes about 5 hours, then I get thrown out with an OOM error.

I am using mongo:3.6.9

2022-03-02T22:56:36.043+0000    [#############...........]  mydb.users  3.65MB/6.37MB  (57.4%)
2022-03-02T22:56:39.043+0000    [#############...........]  mydb.users  3.65MB/6.37MB  (57.4%)
2022-03-02T22:56:42.043+0000    [#############...........]  mydb.users  3.65MB/6.37MB  (57.4%)
2022-03-02T22:56:45.043+0000    [#############...........]  mydb.users  3.65MB/6.37MB  (57.4%)
2022-03-02T22:56:48.043+0000    [#############...........]  mydb.users  3.65MB/6.37MB  (57.4%)
2022-03-02T22:56:51.043+0000    [#############...........]  mydb.users  3.65MB/6.37MB  (57.4%)
2022-03-02T22:56:54.043+0000    [#############...........]  mydb.users  3.65MB/6.37MB  (57.4%)

The same behavior when I do a mongorestore from a restore container specifying all mongo pods like so mongorestore --db=mydb --collection=users data/mydb/users.bson --host mongo-0.mongo,mongo-1.mongo,mongo-2.mongo --port 27017

Is there anything else I could try?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ㄖ落Θ余辉 2025-01-18 14:46:00

我在这里找到了答案:
https://stackoverflow.com/a/41352269/18358598

--writeConcern '{w:0}'
作品。

I found my answer here:
https://stackoverflow.com/a/41352269/18358598

--writeConcern '{w:0}'
works.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文