文档详情

mongodb的备份还原案例.doc

发布:2015-09-26约1.26万字共6页下载文档
文本预览下载声明
mongodb的备份还原案例 Mongodb自带了mongodump和mongorestore这两个工具来实现对数据的备份和恢复。 mongodump能够在Mongodb运行时进行备份,它的工作原理是对运行的Mongodb做查询,然后将所有查到的文档写入磁盘。但是存在的问题时使用mongodump产生的备份不一定是数据库的实时快照,如果我们在备份时对数据库进行了写入操作,则备份出来的文件可能不完全和Mongodb实时数据相等。另外在备份时可能会对其它客户端性能产生不利的影响。 mongodump用法; [root@Mongodb ~]# mongodump --help Export MongoDB data to BSON files. options: --help produce help message -v [ --verbose ] be more verbose (include multiple times for more verbosity e.g. -vvvvv) --version print the programs version and exit -h [ --host ] arg mongo host to connect to ( set name/s1,s2 for sets) --port arg server port. Can also use --host hostname:port --ipv6 enable IPv6 support (disabled by default) -u [ --username ] arg username -p [ --password ] arg password --authenticationDatabase arg user source (defaults to dbname) --authenticationMechanism arg (=MONGODB-CR) authentication mechanism --dbpath arg directly access mongod database files in the given path, instead of connecting to a mongod server - needs to lock the data directory, so cannot be used if a mongod is currently accessing the same path --directoryperdb each db is in a separate directly (relevant only if dbpath specified) --journal enable journaling (relevant only if
显示全部
相似文档