[英]UncategorizedMongoDbException: Command failed with error 10107 (NotMaster): 'not master' on server
[英]Mongorestore keeps throwing "(NotMaster) not master" error at me
我是 mongodb 的新手,我一直在尝试从 mongodump 恢复我的数据。 每当我尝试在终端中运行脚本时,它几乎会完全执行,然后恢复。 我试过环顾四周,但解决方案没有触及“非大师”问题
这是我的 mongorestore 脚本; 为简洁起见的占位符
mongorestore --host 'the-given-shard.net:27017' \
--ssl -u 'username' -p 'placeholder' --authenticationDatabase admin --db=loc8r \
--collection=locations dump/loc8r/locations.bson
这是输出
2020-02-04T17:30:21.817+0000 checking for collection data in dump/loc8r/locations.bson
2020-02-04T17:30:22.123+0000 restoring to existing collection loc8r.locations without dropping
2020-02-04T17:30:22.123+0000 reading metadata for loc8r.locations from dump/loc8r/locations.metadata.json
2020-02-04T17:30:22.124+0000 restoring loc8r.locations from dump/loc8r/locations.bson
2020-02-04T17:30:24.205+0000 [########################] loc8r.locations 8.21KB/8.21KB (100.0%)
2020-02-04T17:30:24.888+0000 [########################] loc8r.locations 8.21KB/8.21KB (100.0%)
2020-02-04T17:30:24.888+0000 finished restoring loc8r.locations (0 documents, 0 failures)
2020-02-04T17:30:24.889+0000 Failed: loc8r.locations: error restoring from dump/loc8r/locations.bson: (NotMaster) not master
2020-02-04T17:30:24.889+0000 0 document(s) restored successfully. 0 document(s) failed to restore.
当我跟随时db.isMaster()
对我不起作用
https://docs.mongodb.com/manual/tutorial/getting-started/
db.inventory.insertMany([ { item: "journal", qty: 25, status: "A", size: { h: 14, w: 21, uom: "cm" }, tags: [ "blank", "red" ] }, { item: "notebook", qty: 50, status: "A", size: { h: 8.5, w: 11, uom: "in" }, tags: [ "red", "blank" ] }, { item: "paper", qty: 10, status: "D", size: { h: 8.5, w: 11, uom: "in" }, tags: [ "red", "blank", "plain" ] }, { item: "planner", qty: 0, status: "D", size: { h: 22.85, w: 30, uom: "cm" }, tags: [ "blank", "red" ] }, { item: "postcard", qty: 45, status: "A", size: { h: 10, w: 15.25, uom: "cm" }, tags: [ "blue" ] } ]);
并实际输出:
uncaught exception: WriteCommandError({
"operationTime" : Timestamp(1615842692, 6),
"ok" : 0,
"errmsg" : "not master",
"code" : 10107,
"codeName" : "NotMaster",
"$clusterTime" : {
"clusterTime" : Timestamp(1615842692, 6),
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : NumberLong(0)
}
}
}) :
WriteCommandError({
"operationTime" : Timestamp(1615842692, 6),
"ok" : 0,
"errmsg" : "not master",
"code" : 10107,
"codeName" : "NotMaster",
"$clusterTime" : {
"clusterTime" : Timestamp(1615842692, 6),
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : NumberLong(0)
}
}
})
WriteCommandError@src/mongo/shell/bulk_api.js:417:48
executeBatch@src/mongo/shell/bulk_api.js:915:23
Bulk/this.execute@src/mongo/shell/bulk_api.js:1163:21
DBCollection.prototype.insertMany@src/mongo/shell/crud_api.js:326:5
@(shell):1:1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.