Tags: http ar sp file data on log AD BSTranslated from http://docs.mongodb.org/manual/core/backups/There are several ways to back up the MongoDB cluster:
Backup by copying the underlying data file
Back up with Mongodump
Cloud Backup via MMS (Mms:mongodb Management Service)
Backup software via MMS o
Tags: name r2 Administrator server specified instance SM bubuko infSystem environmentServer System: Windows Server2012 R2 mongodb:v3.4.4 You can view version information by command: mongo-version Scenario: Back up the database smp_maint_2, and revert to the new database Smp_maint_2_restore.MongoDB Database Backup1. Syntax:Mongodump-h dbhost-d Dbname-o dbdirectoryParameter description:-H:MONGDB the server address, for example: 127.0.0.1, you can also specify the port number: 127.0.0.1:27017-D: T
Replicationset is used to avoid data loss on a single node. The test results are as follows: 228 million data records are inserted on the server. Disconnect the 162 service after the insertion is complete.
Replication set is used to avoid data loss on a single node. The test results are as follows: 228 million data records are inserted on the server. Disconnect the 162 service after the insertion is complete.
First, create a MongoDB design draw
First, create a MongoDB design drawing for testing:
The figure is clear. Can take my other notes: http://blog.csdn.net/crazyjixiang/article/category/844957 if not clear please leave a message
Replication set is used to avoid data loss on a single node.
The test results are as follows:
Insert 228 million data records on the server. After the insertion is complete, the 162 server is disconnected and then executed in mongos quickly.
> db.users.count()
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
Label:Backup data:Mongodump-h 192.168.2.20-u game-p 12345678-d dbname-o/data/test/--excludecollection=user_statsWhere-H is the IP address,-u account,-p password,-d database name,-o path to store data,--excludecollection represents the collection to be filtered,--excludecollectionswithprefix represents a prefix to filter some collectionsImport data:Mongorestore--db Gourmet--collection User_face_data/home/gamedev/user_face_data.bsonMongoimport-h 127.0.0.1-d gourmet-c user_face_data--file Aa.jsonTo
Company database migration, so add a bit of knowledge:1 Import and export of collectionsCommand-line help Mongoexport--helpExportExport Newsserver database under News collectionmongoexport-d newsserver-c News-o D:\data\news.jsonSame as above, but specify only partial fields (Id,title)mongoexport-d newsserver-c news-f _id,title-o D:\data\news.jsonIf you need user rights authentication, you need to specify the user and password,-u (--user) followed by the set user name, the password set by-pMongoe
Method One:
Use a file copy form to make a backup of the MongoDB data file.
[Mongo@localhost ~]$ cat mongo_back.sh #!/bin/sh#su-mongoSource/home/mongo/.bash_profile
#对数据库进行加锁, prevents data from being written, synchronizes data, and flushes dirty data to disk. To ensure that the files in the data directory are the most current data.
/opt/mongodb/
First, data backup operationsIn real-world scenarios, it is often necessary to back up business data for disaster preparedness, and MongoDB provides backup and recovery capabilities, namely the Mongodump.exe and Mongorestore.exe files in the MongoDB download directory, in the form of
Tags: style http color os using Java ar strong fileFirst, the Mongobackup file package that someone else wrote was applied. Go to this website download: http://pan.baidu.com/s/15YsBs Download the Mongobackup file to your MongoDB bin directory Input chmod a+x mongobackup//Let the system compile it Then, restart MongoDB Introduction Mongobackup is an incremental backup
No matter how much you think about it, backup of the data is always necessary, especially important data. MongoDB also provides backup and recovery capabilities, respectively, Mongdump.exe and Mongorestore.exe files in the MongoDB download directory. first introduce the following command syntax: > Mongodump - H Dbhost
Tags: Database recovery direct Directory recovery backup directory Specify port pos delete 1. MongoDB database backup 1, Syntax: mongodump-h dbhost-d dbname-o dbdirectory Parameter description: -H:MONGDB server address, for example: 127.0.0.1, you can also specify the port number: 127.0.0.1:27017 nbsp -D: Database instances that need to be
Briefly describe how MongoDB is backed up:
1. Mogodump/mongorestore
These 2 commands mongodb the data into the Bson format and can be recovered when needed.This approach is also applicable as a small database. But if it's sharding or more than hundreds of G data,is almost impossible to use. Because of the Bson and the space it occupies.
2. Slave Replication
This is the most suitable and reliable, suitab
set Change weight simulation main outageThe default three machine weights are 1, if any one of the weights is set to higher than the other, then the machine immediately switch to primary role, so we preset three machines to the weight of 203:3,201:2,202:1At the Lord's execution:CFG = rs.conf ()Cfg.members[0].priority = 3Cfg.members[1].priority = 2cfg.members[2].priority = 1Rs.reconfig (CFG)In this case, the second node will be a candidate nodeThe Lord discards packets entered from Port 27017Ipt
First, create a MongoDB backup directoryUsed to store datamkdir -p /data/mongodb_bak/mongodb_bak_nowmkdir-p /data/mongodb_bak/mongodb_bak_listIi. Creating a MongoDB database backup script#!/bin/bash#Dump=/usr/local/mongodb/bin/mongodump #mongodump命令路Path Out_dir=/data/mongod
records, but instead repeats them (if possible).This method is time-consuming when the volume of data is large.backing up data files directly
MONGO 127.0.0.1:27017/db_to_back--eval "Db.fsynclock ()"
RSYNC-AVH--delete/path/to/your/mongofile/path/to/ backup/folder/
MONGO 127.0.0.1:21001/turbo--eval "Db.fsyncunlock ()"
The key is two commands in the first and third lines, and for Db.fsynclock (), the M
2018-06-14 15:32, I mistakenly deleted the table of the MongoDB cluster on the line.Ok,mongobooster is a stop button. Click Stop to Help. But, can not stop at all, every refresh will see the form in 1M decreasing speed, every refresh once dizziness will aggravate the mind of the rapid thinking solutionCourse:1. Find ops and take backup. Looking for a long time unexpectedly did not have a recent
MongoDB Database BackupMongodump--host mongodb.example.net--port 27017Backup path SelectionMongodump--out/data/backup/Select the databases and collections to back upMongodump--collection mycollection--db testCreate a non-local database backupMongodump--host mongodb1.example.net--port 3017--username user--password "Pass"--out/opt/backup/ Mongodump-2013-10-24======
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.