Tags: god represents file HTML common category name cat stringZhang Ying published in 2013-12-03 Category list: NoSQL Tags: mongodb, backup, import, export, restore MongoDB data backup and restore is mainly divided into two kinds, one is for the library of Mongodump and Mongorestore, one is for the table in the library
Backup and recovery MongoDB1makesureallprocesswhichiswritingmongodbarestopped. 2dumpdatabasefromGAMONGODB81sudo. mongodump -- hostgamongodb91: 27017 -- usernameGAEditor -- password9AEd! T0r -- outdataBondPrice_backup3compressback
Backup and recovery MongoDB 1 make sure all process which is writing mongodb are stopped. 2 dump database from GAMONGODB81 sudo./mongod
[[emailprotected] mongodb]# mongodump -h 192.168.1.108 -d tank -o /home/zhangy/mongodb/ connected to: 192.168.1.108 Tue Dec 3 06:11:41.618 DATABASE: tank to /home/zhangy/mongodb/tank Tue Dec 3 06:11:41.623 tank.system.indexes to /home/zhangy/mongodb/tank/system.indexes.bson Tue Dec 3 06:11:41.623 2 objects T
Label:MongoDB data backup and restore is mainly divided into two kinds, one is for the library of Mongodump and Mongorestore, one is for the table in the library mongoexport and Mongoimport. One, Mongodump backup database 1, Common command grid
Mongodump-h IP--port Port-u user name-p password-d database-o file exists path
If there is no user who can remove-u and-P.If you export the native database, you can remove-H.If it is the defaul
MongoDB data backup and restore is mainly divided into two kinds, one is for the library of Mongodump and Mongorestore, one is for the table in the library mongoexport and Mongoimport.One, Mongodump backup database1, Common command gridMongodump-h IP--port Port-u user name-p password-d database-o file exists pathIf there is no user who can remove-u and-P.If you export the native database, you can remove-H.I
The principle of mongodump.exe backup is to get the current server snapshot through a single query. The snapshot is written to disk, so it is not stored in real time, because the server will have data writes after the snapshot is taken, and in order to secure the backup, we can also use the Fsync lock to temporarily write the server data to the cache.
Efficient open source database (mongodb) Download address: http://www.jb51.net/softs/41751.html
P
MongoDB Standalone:To back up all libraries:Mongodump--host 10.10.7.33:27019--gzip--OUT/HOME/MONGODB/0415_BFTo back up the specified library:Mongodump--host 10.10.10.251:21100-d dbname--gzip-out/home/mongodb/bjdata2Restore recovery:Mongorestore--host Replica backup of the set cluster:Backup Data set:mongodump -h"ttlsa/10.1.1.155,10.1.1.156,10.1.1.157"--oplog -o /
user--type csv--headerline--fileUser_csv.datConnected to:127.0.0.1Imported 3 objects[Email protected] bin]#Parameter description:-type indicates the file format to import-headerline The first row is not imported because the first row is a column name-file indicates the file path to importAttention:CSV format is good, mainstream database support export to CSV format, so this format is very beneficial to heterogeneous data migrationData backup MongodumpYou can use Mongodump to make a library or t
One: Back up the databaseG:\Program files\mongodb\server\3.0\bin>mongodump-d Mydb-o G:/data/backMongodump-h IP--port Port-u user name-p password-d database-o file exists pathIf there are no users, you can remove-u and-P.If you export the native database, you can remove-H.If it is the default port, you can remove--port.If you want to export all databases, you can remove-D.Export all databasesCommand: Mongodump-h 127.0.0.1-o/home/zhangy/
heterogeneous data migrationData backup MongodumpYou can use Mongodump to make a library or table-level backup of MongoDB, as illustrated below:1. Backing Up the Iflashbuy_log database>c:\mongo\bin\mongodump-d Iflashbuy_logA dump directory is created in the current directory to hold the backed-up files, or to specify the directory where the backup resides.2. Specify directory Backup Iflashbuy_log database>
One, MongoDB Backup 1, mongodb backup backup data using the following command mongodump-h dbhost-d Dbname-o dbdirectory back up the user database [[email protected] bin]#. mongodump-h127.0.0.1-d User-o/home/[[email protected] bin]# Ls/home/user/b3.bson B3.metadata.json C1.bson c1.metadata.json# can see the backed up files 2, MongoDB single collection backup backu
Tags: mon instance dump--database God images ack span1.mongodb BackupThe Mongodump command can use a list of available options.This command backs up only the specified database, in the specified path
Grammar
Description
Example
Mongodump--host host_name--port port_number
This command will specify the Mongod instance to back up all the databases.
Mongodump-
Database backup –mongodump
Back up all local MongoDB databases:
Copy Code code as follows:
# mongodump-h 127.0.0.1--port 27017-o/root/db/alldb
To back up a remote specified database:
Copy Code code as follows:
# mongodump-h 192.168.1.233--port 27018-d yourdb-o/root/db/yourdb
More Mongodump Detailed
Database Restore-mongorestore
MongoDB permissions, Backup, restore, de-weight
PermissionsData security is a critical part of a database, so here's a general procedure for setting up MongoDB user rights.First, create a new database administrator in unlicensed mode:Start the database service:mongodEnable the Named line tool:mongouse admindb.createUser({user:"gly",pwd:"[emailprotected]",role
Mongodump (a large collection will have a Bson file)./mongodump-d Test-o/tmp/--Back up the test database to/tmp/, you will have a/tmp/test/xxx.bson ... File-D Database-H View Detailed parameters* If you do not specify a directory, the default is to create a dump directory under the current file directory (BIN) to hold the backed up filesYou can specify a directory: where to go after adding-o/tmp/my_mongodb_dump backup2: Data Recovery Mongorestore./mo
Tags: MONGO backup restoreMongoDB Data BackupIn MongoDB we use the Mongodump command to back up MongoDB data. The command can export all data to the specified directory.The Mongodump command allows you to specify the server to which the exported data can be dumped by parameter.GrammarThe mongodump command script syntax is as follows:>mongodump-h dbhost-d Dbname-o dbdirectory
-h: MONGDB the server a
process:25444c Hild Process started successfully, parent exiting9. If the hostname of the Shard has changed, the Config database needs to be updated10. Restart all Shard Mongod instances11. Restart other MONGOs instances12. Verifying the cluster environmentmongos> db.printshardingstatus ()---sharding Status---sharding version: {"_id": 1, "Mincompatibleve Rsion ": 5," CurrentVersion ": 6," Clusterid ": ObjectId (" 553f0cc819d7841961ac8f4b ")} shards: {" _i D ":" S1 "," host ":" s1/11.11.11.195:2
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.