Importing to CosmosDB MongoDB API using mongorestore fails with retryable writes error

前端 未结 2 745
一向
一向 2021-01-21 16:01

I\'m trying to export and import data from an old MongoDB database server to Azure CosmosDB with MongoDB API using mongodump and mongorestore. But i\'m having issues with the co

相关标签:
2条回答
  • 2021-01-21 16:45

    You can try a version of mongorestore that shipped with MongoDB 3.4. This may not be able to read recent dumps though.

    The ismaster output you provided includes:

    logicalSessionTimeoutMinutes: 30

    This advertises session support but https://docs.microsoft.com/en-us/azure/cosmos-db/mongodb-feature-support-36 says cosmosdb does not support sessions.

    CosmosDB is advertising support for a feature it does not implement, the tooling then (correctly) attempts to use it. This is a bug in cosmosdb.

    0 讨论(0)
  • 2021-01-21 16:58

    I found that the various mongotools (mongoimport, mongorestore, etc.) seem to ignore the retrywrites=false or retryWrites=false in the URI, but tacking on the option --writeConcern="{w:0}" allows the command to run successfully on instances that don't support retryable writes

    0 讨论(0)
提交回复
热议问题