簡體   English   中英

Mongorestore 不斷向我拋出“(NotMaster) not master”錯誤

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM