Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MongDB 5.0.2 导入数据报错 #50

Closed
LiuZhipeng99 opened this issue Aug 10, 2021 · 4 comments
Closed

MongDB 5.0.2 导入数据报错 #50

LiuZhipeng99 opened this issue Aug 10, 2021 · 4 comments
Labels
bug Something isn't working question Further information is requested

Comments

@LiuZhipeng99
Copy link

docker镜像部署执行mongorestore --gzip --archive=yyets_mongo.gz 报错如下

2021-08-10T13:22:10.071+0000    continuing through error: E11000 duplicate key error collection: zimuzu.yyets index: _id_ dup key: { _id: ObjectId('6099085490a830c78bbdfcd7') }
2021-08-10T13:22:10.071+0000    continuing through error: E11000 duplicate key error collection: zimuzu.yyets index: _id_ dup key: { _id: ObjectId('60b35a8a19af21adbf431f9c') }
2021-08-10T13:22:10.071+0000    continuing through error: E11000 duplicate key error collection: zimuzu.yyets index: _id_ dup key: { _id: ObjectId('60c57d195d5281c7f98ae389') }
2021-08-10T13:22:10.071+0000    continuing through error: E11000 duplicate key error collection: zimuzu.yyets index: _id_ dup key: { _id: ObjectId('60cf544a077ccbc4f0c6690a') }
2021-08-10T13:22:10.071+0000    zimuzu.yyets  234MB
2021-08-10T13:22:10.071+0000    finished restoring zimuzu.yyets (0 documents, 17522 failures)
2021-08-10T13:22:10.073+0000    restoring indexes for collection zimuzu.yyets from metadata
2021-08-10T13:22:10.073+0000    index: &idx.IndexDocument{Options:primitive.M{"name":"data.info.id_1", "v":2}, Key:primitive.D{primitive.E{Key:"data.info.id", Value:1}}, PartialFilterExpression:primitive.D(nil)}
2021-08-10T13:22:10.073+0000    index: &idx.IndexDocument{Options:primitive.M{"name":"data.info.area_1", "v":2}, Key:primitive.D{primitive.E{Key:"data.info.area", Value:1}}, PartialFilterExpression:primitive.D(nil)}
2021-08-10T13:22:10.073+0000    index: &idx.IndexDocument{Options:primitive.M{"name":"data.info.views_-1", "v":2}, Key:primitive.D{primitive.E{Key:"data.info.views", Value:-1}}, PartialFilterExpression:primitive.D(nil)}
2021-08-10T13:22:10.089+0000    0 document(s) restored successfully. 17522 document(s) failed to restore.
@LiuZhipeng99 LiuZhipeng99 changed the title MongDB 5.2 导入数据报错 MongDB 5.0.2 导入数据报错 Aug 10, 2021
@LiuZhipeng99
Copy link
Author

另外运行install脚本也是如此。创建容器后查看发现同时web容器也没端口映射,是要修改yaml吗
image

@BennyThink BennyThink added bug Something isn't working question Further information is requested labels Aug 13, 2021
@BennyThink
Copy link
Member

root@f86d0ed6d838:/tmp# mongod --version
db version v5.0.2
Build Info: {
    "version": "5.0.2",
    "gitVersion": "6d9ec525e78465dcecadcff99cce953d380fedc8",
    "openSSLVersion": "OpenSSL 1.1.1f  31 Mar 2020",
    "modules": [],
    "allocator": "tcmalloc",
    "environment": {
        "distmod": "ubuntu2004",
        "distarch": "x86_64",
        "target_arch": "x86_64"
    }
}
root@f86d0ed6d838:/tmp# mongorestore --gzip --archive=yyets_mongo.gz
2021-08-13T04:37:15.944+0000	preparing collections to restore from
2021-08-13T04:37:15.954+0000	reading metadata for zimuzu.yyets from archive 'yyets_mongo.gz'
2021-08-13T04:37:15.977+0000	restoring zimuzu.yyets from archive 'yyets_mongo.gz'
2021-08-13T04:37:18.904+0000	zimuzu.yyets  118MB
2021-08-13T04:37:20.546+0000	zimuzu.yyets  234MB
2021-08-13T04:37:20.547+0000	finished restoring zimuzu.yyets (17522 documents, 0 failures)
2021-08-13T04:37:20.549+0000	restoring indexes for collection zimuzu.yyets from metadata
2021-08-13T04:37:20.552+0000	index: &idx.IndexDocument{Options:primitive.M{"name":"data.info.views_-1", "v":2}, Key:primitive.D{primitive.E{Key:"data.info.views", Value:-1}}, PartialFilterExpression:primitive.D(nil)}
2021-08-13T04:37:20.552+0000	index: &idx.IndexDocument{Options:primitive.M{"name":"data.info.id_1", "v":2}, Key:primitive.D{primitive.E{Key:"data.info.id", Value:1}}, PartialFilterExpression:primitive.D(nil)}
2021-08-13T04:37:20.552+0000	index: &idx.IndexDocument{Options:primitive.M{"name":"data.info.area_1", "v":2}, Key:primitive.D{primitive.E{Key:"data.info.area", Value:1}}, PartialFilterExpression:primitive.D(nil)}
2021-08-13T04:37:21.199+0000	17522 document(s) restored successfully. 0 document(s) failed to restore.
root@f86d0ed6d838:/tmp#

你是第二次导入吧?清掉数据库,重新导入一下哦。

@BennyThink
Copy link
Member

install.sh 确实有问题,sed的行号不对,我更新一下。

@chenxihub
Copy link

我导入还是失败,是什么情况
image

AuraBear added a commit that referenced this issue Jun 13, 2022
AuraBear pushed a commit that referenced this issue Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants