百度智能云

All Product Document

          Cloud Database MONGODB

          FAQs About Operations

          Does the use of the Mongodump/Mongorestore for data migration affect your business?

          Migrating the data by the mongodump/mongorestore command is an offline migration process, which needs to stop reading/writing the business. So, recommend you to conduct the operation at the low peak of the business.

          How to confirm the dump/restore operation is complete?

          When the mongodump/mongorestore operation gets finished, there is a result prompt indicating that the number of documents collected in the database from the dump/restore operation. If the execution gets failed, there is also a result prompt indicating that which database operations get failed.

          Execute the prompt result completed by mongodump
          2019-04-09T09:52:00.161+0800    writing admin.system.version to
          2019-04-09T09:52:00.162+0800    done dumping admin.system.version (1 document)
          2019-04-09T09:52:00.162+0800    writing student_db.student_col to
          2019-04-09T09:52:00.162+0800    writing mydb.mycollection to
          2019-04-09T09:52:00.163+0800    done dumping student_db.student_col (5 documents)
          2019-04-09T09:52:00.163+0800    done dumping mydb.mycollection (3 documents)
          
          Execute the prompt result completed by mongorestore
          2019-04-09T10:06:05.724+0800    preparing collections to restore from
          2019-04-09T10:06:05.725+0800    reading metadata for student_db.student_col from dump/student_db/student_col.metadata.json
          2019-04-09T10:06:05.758+0800    reading metadata for mydb.mycollection from dump/mydb/mycollection.metadata.json
          2019-04-09T10:06:05.758+0800    restoring mydb.mycollection from dump/mydb/mycollection.bson
          2019-04-09T10:06:05.778+0800    no indexes to restore
          2019-04-09T10:06:05.778+0800    finished restoring mydb.mycollection (3 documents)

          Is there any compatibility problem with the versions other than 4.0? Do they support the data import?

          Because the MongoDB instances created on the Baidu AI Cloud belong to version 3.4 and are based on the WiredTiger storage engine, you can install the version 3.4 software in the BCC. However, the version of MongoDB database of self-built/competing products may be version 4.0 or above. Therefore, recommend you to install the MongoDB software of the 4.0 version on the BCC machine to solve the compatibility problem and normally import the data.

          Why do I need to remotely log in to the MongoDB instance from the BCC to dump the data?

          Because the DocDB for MongoDB instance only supports operations on the BCC currently, the data can be dumped directly to the BCC from a public cloud. If you have a self-built/private cloud, you need to dump the data in a self-built environment and then upload it to the Baidu AI Cloud BCC machine. Then, the data is finally restored to the Baidu AI Cloud database DocDB for mongoDB instance.

          How to deal with the disconnection? Do I need to re-dump it?

          If the disconnection occurs during data dumping/restoring, you need to reconnect it for operation. However, if the data size is big and the terminal shows the dumped/restored data, you need not rework the data except for the database uncompleted.

          Why does the cluster system.indexes not exist in the local MongoDB database after they are restored to Baidu AI Cloud DocDB for MongoDB?

          Due to different storage engines, the storage engine used by the DocDB for MongoDB is version 3.4 of WiredTiger. The “mmapv1” storage engine used by the local MongoDB does not exist after the data migration. However, it does not affect the normal use after the migration.

          The error occurred in Mongodump/Mongorestore is as follows.

          2019-04-09T14:36:35.338+0800    Failed: error counting admin.system.keys: not authorized on admin to execute command { count: "system.keys", query: {}, $readPreference: { mode: "secondaryPreferred" }, $db: "admin" }

          It is because the version of the MongoDB shell is incompatible with the MongoDB server. This error occurs when operating the MongoDB database of version 4.0 or above with the MongoDB shell of version 3.X. Recommend you to upgrade the software version on Baidu AI Cloud BCC to 4.0 or above.

          Do I need to use the Mongodump for data backup?

          To prevent misoperation and ensure data security, you often use the “mongodump” to back up the database, and the “mongorestore” to restore the backup state of the database at a certain time.

          How to realize the remote connection of the Baidu AI Cloud DocDB for MongoDB services?

          Create a BCC deployed under the same VPC as the DocDB for MongoDB service node. Connect the Baidu AI Cloud database service node remotely after logging in to the BCC. For specific operation steps, see the [Connection Instance](MONGODB/Operation Guide/Connect to an Instance.md).

          The remote connection to Baidu AI Cloud DocDB For MongoDB gets failed.

          Causes Solutions
          Parameter input error Check whether the database name, user name, password or other parameters are correct
          Privilege issue Check whether the privilege entered matches those of the database
          The client version is too low Check the version of the client Mongo shell and upgrade it to version 3.4 or above.

          DB error occurs during backup of all the Mongodump databases

          image.png

          If you encounter the error above when performing the one-click backup of all databases, the possible cause is that the client version is too low. Please upgrade it to version 3.4 or above.

          Where is the backup file saved when using the Mongodump for data backup?

          The backup file is saved onto the client node where the mongodump command gets executed. Configure the path in the “-o” parameter.

          When using the Mongodump for data backup, does the restoration roll back and cover the original Mongodb Baidu AI Cloud database?

          Yes. Thus, you need to confirm which backup files you want to restore before executing the restore command mongorestore.

          Does the process of backup, or restoration get interrupted when using the Mongodump for data backup? How to deal with the interruption?

          The backup and restoration process may be interrupted due to network fluctuation. If interrupted, the command execution error occurs. At this moment, you need to re-initiate the backup or restoration.

          Does the use of the Mongodump for data backup affect your business?

          The data backup by the Mongodump is an offline backup. During the backup and restoration, the database stops the provision of read/write services. Thus, recommend you to perform the backup operation at the low peak of the business.

          Previous
          FAQs Overview
          Next
          FAQs About Use of Product