MongoDB中的mongodump和mongorestore两个命令是针对数据库进行备份与恢复,其用法非常简单,具体语法可以查看帮助文件。

1、MongoDB备份

1.1 备份本机MongoDB

如果mongodump命令后,没有指定-h和-p选项,则默认是备份本机的mongo数据库。如下:

[root@hdp04 ~]# mongodump -d admin -o admin-`date +"%m-%d-%y"`
2018-06-11T14:29:14.798+0800    writing admin.system.users to
2018-06-11T14:29:14.800+0800    done dumping admin.system.users (1 document)
2018-06-11T14:29:14.800+0800    writing admin.system.version to
2018-06-11T14:29:14.802+0800    done dumping admin.system.version (2 documents)
2018-06-11T14:29:14.802+0800    writing admin.temp to
2018-06-11T14:29:14.802+0800    writing admin.temp_boss to
2018-06-11T14:29:14.802+0800    writing admin.postalCodes to
2018-06-11T14:29:14.802+0800    writing admin.stdcodes to
2018-06-11T14:29:14.834+0800    done dumping admin.stdcodes (2611 documents)
2018-06-11T14:29:15.111+0800    done dumping admin.postalCodes (39734 documents)
2018-06-11T14:29:17.781+0800    [######..................]  admin.temp_boss  509963/1778416  (28.7%)
2018-06-11T14:29:17.781+0800    [####....................]       admin.temp  576948/3347522  (17.2%)
2018-06-11T14:29:17.781+0800
2018-06-11T14:29:20.792+0800    [#############...........]  admin.temp_boss  1000124/1778416  (56.2%)
2018-06-11T14:29:20.792+0800    [########................]       admin.temp  1163572/3347522  (34.8%)
2018-06-11T14:29:20.792+0800
2018-06-11T14:29:23.784+0800    [#####################...]  admin.temp_boss  1583586/1778416  (89.0%)
2018-06-11T14:29:23.784+0800    [############............]       admin.temp  1791435/3347522  (53.5%)
2018-06-11T14:29:23.784+0800
2018-06-11T14:29:24.579+0800    [########################]  admin.temp_boss  1778416/1778416  (100.0%)
2018-06-11T14:29:24.579+0800    done dumping admin.temp_boss (1778416 documents)
2018-06-11T14:29:26.781+0800    [#################.......]  admin.temp  2500342/3347522  (74.7%)
2018-06-11T14:29:29.781+0800    [######################..]  admin.temp  3095529/3347522  (92.5%)
2018-06-11T14:29:30.928+0800    [########################]  admin.temp  3347522/3347522  (100.0%)
2018-06-11T14:29:30.928+0800    done dumping admin.temp (3347522 documents)

1.2 备份指定的collection

如果同时指定了-c参数,则对某一个collection进行备份:

[root@hdp04 ~]# mongodump -d admin -c temp -o admin-`date +"%m-%d-%y"`
2018-06-13T09:38:57.176+0800    writing admin.temp to
2018-06-13T09:39:00.165+0800    [###.....................]  admin.temp  520753/3347522  (15.6%)
2018-06-13T09:39:03.165+0800    [######..................]  admin.temp  944359/3347522  (28.2%)
2018-06-13T09:39:06.165+0800    [###########.............]  admin.temp  1574717/3347522  (47.0%)
2018-06-13T09:39:09.166+0800    [###############.........]  admin.temp  2097372/3347522  (62.7%)
2018-06-13T09:39:12.165+0800    [####################....]  admin.temp  2909531/3347522  (86.9%)
2018-06-13T09:39:13.347+0800    [########################]  admin.temp  3347522/3347522  (100.0%)
2018-06-13T09:39:13.347+0800    done dumping admin.temp (3347522 documents)

1.3 备份远程的MongoDB

[root@hdp04 ~]# mongodump -d admin -h hdp05 -p 27017 -o hdp05-`date +"%m-%d-%y"`
2018-06-13T09:42:39.667+0800    writing admin.system.users to
2018-06-13T09:42:39.669+0800    done dumping admin.system.users (1 document)
2018-06-13T09:42:39.669+0800    writing admin.system.version to
2018-06-13T09:42:39.670+0800    done dumping admin.system.version (2 documents)
2018-06-13T09:42:39.670+0800    writing admin.temp to
2018-06-13T09:42:39.670+0800    writing admin.temp_boss to
2018-06-13T09:42:39.671+0800    writing admin.postalCodes to
2018-06-13T09:42:39.671+0800    writing admin.stdcodes to
2018-06-13T09:42:39.708+0800    done dumping admin.stdcodes (2611 documents)
2018-06-13T09:42:40.003+0800    done dumping admin.postalCodes (39734 documents)
2018-06-13T09:42:42.648+0800    [####....................]       admin.temp  590056/3347522  (17.6%)
2018-06-13T09:42:42.648+0800    [#######.................]  admin.temp_boss  525552/1778416  (29.6%)
2018-06-13T09:42:42.648+0800
2018-06-13T09:42:45.656+0800    [########................]       admin.temp  1226471/3347522  (36.6%)
2018-06-13T09:42:45.656+0800    [#############...........]  admin.temp_boss  1036036/1778416  (58.3%)
2018-06-13T09:42:45.656+0800
2018-06-13T09:42:48.648+0800    [############............]       admin.temp  1753971/3347522  (52.4%)
2018-06-13T09:42:48.648+0800    [####################....]  admin.temp_boss  1505954/1778416  (84.7%)
2018-06-13T09:42:48.648+0800
2018-06-13T09:42:50.405+0800    [########################]  admin.temp_boss  1778416/1778416  (100.0%)
2018-06-13T09:42:50.405+0800    done dumping admin.temp_boss (1778416 documents)
2018-06-13T09:42:51.648+0800    [################........]  admin.temp  2299187/3347522  (68.7%)
2018-06-13T09:42:54.648+0800    [#####################...]  admin.temp  2968543/3347522  (88.7%)
2018-06-13T09:42:56.147+0800    [########################]  admin.temp  3347522/3347522  (100.0%)
2018-06-13T09:42:56.147+0800    done dumping admin.temp (3347522 documents)

2、MongoDB恢复

2.1 本机恢复

[root@hdp04 ~]# mongorestore -d admin --drop /root/admin-06-13-18/admin/
2018-06-13T09:48:13.833+0800    building a list of collections to restore from /root/admin-06-13-18/admin dir
2018-06-13T09:48:13.857+0800    reading metadata for admin.temp from /root/admin-06-13-18/admin/temp.metadata.json
2018-06-13T09:48:13.865+0800    reading metadata for admin.temp_boss from /root/admin-06-13-18/admin/temp_boss.metadata.json
2018-06-13T09:48:13.869+0800    reading metadata for admin.postalCodes from /root/admin-06-13-18/admin/postalCodes.metadata.json
2018-06-13T09:48:13.872+0800    reading metadata for admin.stdcodes from /root/admin-06-13-18/admin/stdcodes.metadata.json
2018-06-13T09:48:13.880+0800    restoring admin.temp from /root/admin-06-13-18/admin/temp.bson
2018-06-13T09:48:13.889+0800    restoring admin.temp_boss from /root/admin-06-13-18/admin/temp_boss.bson
2018-06-13T09:48:13.910+0800    restoring admin.postalCodes from /root/admin-06-13-18/admin/postalCodes.bson
2018-06-13T09:48:13.912+0800    restoring admin.stdcodes from /root/admin-06-13-18/admin/stdcodes.bson
2018-06-13T09:48:14.077+0800    no indexes to restore
2018-06-13T09:48:14.077+0800    finished restoring admin.stdcodes (2611 documents)
2018-06-13T09:48:15.334+0800    restoring indexes for collection admin.postalCodes from metadata
2018-06-13T09:48:15.479+0800    finished restoring admin.postalCodes (39734 documents)
2018-06-13T09:48:16.829+0800    [........................]       admin.temp  19.0MB/815MB  (2.3%)
2018-06-13T09:48:16.829+0800    [........................]  admin.temp_boss  25.3MB/629MB  (4.0%)
2018-06-13T09:48:16.829+0800
2018-06-13T09:48:19.828+0800    [#.......................]       admin.temp  49.1MB/815MB   (6.0%)
2018-06-13T09:48:19.828+0800    [##......................]  admin.temp_boss  67.8MB/629MB  (10.8%)
2018-06-13T09:48:19.828+0800
2018-06-13T09:48:22.828+0800    [##......................]       admin.temp  76.3MB/815MB   (9.4%)
2018-06-13T09:48:22.828+0800    [####....................]  admin.temp_boss   106MB/629MB  (16.8%)
2018-06-13T09:48:22.828+0800
2018-06-13T09:48:25.828+0800    [##......................]       admin.temp  101MB/815MB  (12.4%)
2018-06-13T09:48:25.829+0800    [#####...................]  admin.temp_boss  142MB/629MB  (22.5%)
2018-06-13T09:48:25.829+0800
2018-06-13T09:48:28.828+0800    [###.....................]       admin.temp  129MB/815MB  (15.8%)
2018-06-13T09:48:28.828+0800    [######..................]  admin.temp_boss  180MB/629MB  (28.7%)
2018-06-13T09:48:28.828+0800
2018-06-13T09:48:31.828+0800    [####....................]       admin.temp  156MB/815MB  (19.1%)
2018-06-13T09:48:31.828+0800    [########................]  admin.temp_boss  219MB/629MB  (34.8%)
2018-06-13T09:48:31.828+0800
2018-06-13T09:48:34.828+0800    [#####...................]       admin.temp  184MB/815MB  (22.5%)
2018-06-13T09:48:34.828+0800    [#########...............]  admin.temp_boss  259MB/629MB  (41.1%)
2018-06-13T09:48:34.828+0800
2018-06-13T09:48:37.828+0800    [######..................]       admin.temp  211MB/815MB  (25.8%)
2018-06-13T09:48:37.828+0800    [###########.............]  admin.temp_boss  295MB/629MB  (47.0%)
2018-06-13T09:48:37.828+0800
2018-06-13T09:48:40.832+0800    [######..................]       admin.temp  234MB/815MB  (28.7%)
2018-06-13T09:48:40.832+0800    [############............]  admin.temp_boss  329MB/629MB  (52.3%)
2018-06-13T09:48:40.832+0800
2018-06-13T09:48:43.829+0800    [#######.................]       admin.temp  259MB/815MB  (31.8%)
2018-06-13T09:48:43.829+0800    [#############...........]  admin.temp_boss  365MB/629MB  (58.0%)
2018-06-13T09:48:43.829+0800
2018-06-13T09:48:46.828+0800    [########................]       admin.temp  275MB/815MB  (33.8%)
2018-06-13T09:48:46.828+0800    [##############..........]  admin.temp_boss  386MB/629MB  (61.4%)
2018-06-13T09:48:46.828+0800
2018-06-13T09:48:49.828+0800    [########................]       admin.temp  304MB/815MB  (37.3%)
2018-06-13T09:48:49.828+0800    [################........]  admin.temp_boss  427MB/629MB  (67.8%)
2018-06-13T09:48:49.828+0800
2018-06-13T09:48:52.828+0800    [#########...............]       admin.temp  331MB/815MB  (40.6%)
2018-06-13T09:48:52.828+0800    [#################.......]  admin.temp_boss  465MB/629MB  (74.0%)
2018-06-13T09:48:52.828+0800
2018-06-13T09:48:55.828+0800    [##########..............]       admin.temp  357MB/815MB  (43.8%)
2018-06-13T09:48:55.828+0800    [###################.....]  admin.temp_boss  502MB/629MB  (79.8%)
2018-06-13T09:48:55.829+0800
2018-06-13T09:48:58.829+0800    [###########.............]       admin.temp  382MB/815MB  (46.8%)
2018-06-13T09:48:58.829+0800    [####################....]  admin.temp_boss  537MB/629MB  (85.3%)
2018-06-13T09:48:58.829+0800
2018-06-13T09:49:01.829+0800    [###########.............]       admin.temp  407MB/815MB  (50.0%)
2018-06-13T09:49:01.829+0800    [#####################...]  admin.temp_boss  574MB/629MB  (91.2%)
2018-06-13T09:49:01.829+0800
2018-06-13T09:49:04.828+0800    [############............]       admin.temp  431MB/815MB  (52.9%)
2018-06-13T09:49:04.828+0800    [#######################.]  admin.temp_boss  608MB/629MB  (96.6%)
2018-06-13T09:49:04.828+0800
2018-06-13T09:49:06.562+0800    [########################]  admin.temp_boss  629MB/629MB  (100.0%)
2018-06-13T09:49:06.562+0800    no indexes to restore
2018-06-13T09:49:06.562+0800    finished restoring admin.temp_boss (1778416 documents)
2018-06-13T09:49:07.828+0800    [#############...........]  admin.temp  457MB/815MB  (56.1%)
2018-06-13T09:49:10.869+0800    [##############..........]  admin.temp  488MB/815MB  (59.9%)
2018-06-13T09:49:13.829+0800    [###############.........]  admin.temp  515MB/815MB  (63.2%)
2018-06-13T09:49:16.828+0800    [################........]  admin.temp  551MB/815MB  (67.6%)
2018-06-13T09:49:19.828+0800    [#################.......]  admin.temp  583MB/815MB  (71.6%)
2018-06-13T09:49:22.828+0800    [##################......]  admin.temp  613MB/815MB  (75.2%)
2018-06-13T09:49:25.828+0800    [##################......]  admin.temp  642MB/815MB  (78.8%)
2018-06-13T09:49:28.828+0800    [###################.....]  admin.temp  674MB/815MB  (82.7%)
2018-06-13T09:49:31.828+0800    [####################....]  admin.temp  704MB/815MB  (86.4%)
2018-06-13T09:49:34.828+0800    [#####################...]  admin.temp  734MB/815MB  (90.1%)
2018-06-13T09:49:37.828+0800    [######################..]  admin.temp  766MB/815MB  (94.0%)
2018-06-13T09:49:40.828+0800    [#######################.]  admin.temp  798MB/815MB  (97.9%)
2018-06-13T09:49:42.507+0800    [########################]  admin.temp  815MB/815MB  (100.0%)
2018-06-13T09:49:42.507+0800    no indexes to restore
2018-06-13T09:49:42.507+0800    finished restoring admin.temp (3347522 documents)
2018-06-13T09:49:42.507+0800    restoring users from /root/admin-06-13-18/admin/system.users.bson
2018-06-13T09:49:42.539+0800    done
[root@hdp04 ~]# 

2.2 异机恢复

[root@hdp04 ~]# mongorestore --host hdp05 --port 27017 --drop /root/admin-06-13-18/
2018-06-13T09:53:07.783+0800    preparing collections to restore from
2018-06-13T09:53:07.834+0800    reading metadata for admin.temp from /root/admin-06-13-18/admin/temp.metadata.json
2018-06-13T09:53:07.836+0800    reading metadata for admin.stdcodes from /root/admin-06-13-18/admin/stdcodes.metadata.json
2018-06-13T09:53:07.858+0800    reading metadata for admin.temp_boss from /root/admin-06-13-18/admin/temp_boss.metadata.json
2018-06-13T09:53:07.862+0800    reading metadata for admin.postalCodes from /root/admin-06-13-18/admin/postalCodes.metadata.json
2018-06-13T09:53:07.880+0800    restoring admin.temp from /root/admin-06-13-18/admin/temp.bson
2018-06-13T09:53:07.886+0800    restoring admin.stdcodes from /root/admin-06-13-18/admin/stdcodes.bson
2018-06-13T09:53:07.895+0800    restoring admin.temp_boss from /root/admin-06-13-18/admin/temp_boss.bson
2018-06-13T09:53:07.896+0800    restoring admin.postalCodes from /root/admin-06-13-18/admin/postalCodes.bson
2018-06-13T09:53:08.020+0800    no indexes to restore
2018-06-13T09:53:08.020+0800    finished restoring admin.stdcodes (2611 documents)
2018-06-13T09:53:09.404+0800    restoring indexes for collection admin.postalCodes from metadata
2018-06-13T09:53:09.683+0800    finished restoring admin.postalCodes (39734 documents)
2018-06-13T09:53:10.776+0800    [........................]       admin.temp  15.7MB/815MB  (1.9%)
2018-06-13T09:53:10.776+0800    [........................]  admin.temp_boss  21.8MB/629MB  (3.5%)
2018-06-13T09:53:10.777+0800
2018-06-13T09:53:13.776+0800    [#.......................]       admin.temp  40.6MB/815MB  (5.0%)
2018-06-13T09:53:13.777+0800    [##......................]  admin.temp_boss  56.9MB/629MB  (9.0%)
2018-06-13T09:53:13.777+0800
2018-06-13T09:53:16.777+0800    [#.......................]       admin.temp  62.3MB/815MB   (7.6%)
2018-06-13T09:53:16.777+0800    [###.....................]  admin.temp_boss  88.0MB/629MB  (14.0%)
2018-06-13T09:53:16.777+0800
2018-06-13T09:53:19.776+0800    [##......................]       admin.temp  84.0MB/815MB  (10.3%)
2018-06-13T09:53:19.776+0800    [####....................]  admin.temp_boss   118MB/629MB  (18.8%)
2018-06-13T09:53:19.776+0800
2018-06-13T09:53:22.780+0800    [###.....................]       admin.temp  110MB/815MB  (13.5%)
2018-06-13T09:53:22.780+0800    [#####...................]  admin.temp_boss  156MB/629MB  (24.7%)
2018-06-13T09:53:22.780+0800
2018-06-13T09:53:25.776+0800    [###.....................]       admin.temp  134MB/815MB  (16.4%)
2018-06-13T09:53:25.776+0800    [#######.................]  admin.temp_boss  191MB/629MB  (30.3%)
2018-06-13T09:53:25.776+0800
2018-06-13T09:53:28.778+0800    [####....................]       admin.temp  158MB/815MB  (19.3%)
2018-06-13T09:53:28.778+0800    [########................]  admin.temp_boss  225MB/629MB  (35.7%)
2018-06-13T09:53:28.778+0800
2018-06-13T09:53:31.777+0800    [#####...................]       admin.temp  182MB/815MB  (22.3%)
2018-06-13T09:53:31.777+0800    [#########...............]  admin.temp_boss  259MB/629MB  (41.2%)
2018-06-13T09:53:31.777+0800
2018-06-13T09:53:34.777+0800    [######..................]       admin.temp  209MB/815MB  (25.7%)
2018-06-13T09:53:34.777+0800    [###########.............]  admin.temp_boss  297MB/629MB  (47.2%)
2018-06-13T09:53:34.777+0800
2018-06-13T09:53:37.777+0800    [######..................]       admin.temp  230MB/815MB  (28.3%)
2018-06-13T09:53:37.777+0800    [############............]  admin.temp_boss  328MB/629MB  (52.2%)
2018-06-13T09:53:37.777+0800
2018-06-13T09:53:40.777+0800    [#######.................]       admin.temp  256MB/815MB  (31.4%)
2018-06-13T09:53:40.777+0800    [#############...........]  admin.temp_boss  364MB/629MB  (57.9%)
2018-06-13T09:53:40.777+0800
2018-06-13T09:53:43.776+0800    [########................]       admin.temp  281MB/815MB  (34.5%)
2018-06-13T09:53:43.776+0800    [###############.........]  admin.temp_boss  399MB/629MB  (63.4%)
2018-06-13T09:53:43.776+0800
2018-06-13T09:53:46.777+0800    [########................]       admin.temp  305MB/815MB  (37.4%)
2018-06-13T09:53:46.777+0800    [################........]  admin.temp_boss  433MB/629MB  (68.9%)
2018-06-13T09:53:46.777+0800
2018-06-13T09:53:49.776+0800    [#########...............]       admin.temp  328MB/815MB  (40.2%)
2018-06-13T09:53:49.776+0800    [#################.......]  admin.temp_boss  465MB/629MB  (73.9%)
2018-06-13T09:53:49.776+0800
2018-06-13T09:53:52.776+0800    [##########..............]       admin.temp  350MB/815MB  (43.0%)
2018-06-13T09:53:52.776+0800    [##################......]  admin.temp_boss  497MB/629MB  (79.0%)
2018-06-13T09:53:52.776+0800
2018-06-13T09:53:55.776+0800    [###########.............]       admin.temp  374MB/815MB  (45.9%)
2018-06-13T09:53:55.776+0800    [####################....]  admin.temp_boss  531MB/629MB  (84.3%)
2018-06-13T09:53:55.776+0800
2018-06-13T09:53:58.776+0800    [###########.............]       admin.temp  396MB/815MB  (48.6%)
2018-06-13T09:53:58.776+0800    [#####################...]  admin.temp_boss  561MB/629MB  (89.2%)
2018-06-13T09:53:58.776+0800
2018-06-13T09:54:01.777+0800    [############............]       admin.temp  420MB/815MB  (51.6%)
2018-06-13T09:54:01.777+0800    [######################..]  admin.temp_boss  596MB/629MB  (94.8%)
2018-06-13T09:54:01.777+0800
2018-06-13T09:54:04.553+0800    [########################]  admin.temp_boss  629MB/629MB  (100.0%)
2018-06-13T09:54:04.553+0800    no indexes to restore
2018-06-13T09:54:04.553+0800    finished restoring admin.temp_boss (1778416 documents)
2018-06-13T09:54:04.776+0800    [#############...........]  admin.temp  444MB/815MB  (54.5%)
2018-06-13T09:54:07.776+0800    [##############..........]  admin.temp  478MB/815MB  (58.7%)
2018-06-13T09:54:10.776+0800    [###############.........]  admin.temp  511MB/815MB  (62.6%)
2018-06-13T09:54:13.776+0800    [###############.........]  admin.temp  537MB/815MB  (65.9%)
2018-06-13T09:54:16.776+0800    [################........]  admin.temp  569MB/815MB  (69.8%)
2018-06-13T09:54:19.776+0800    [#################.......]  admin.temp  597MB/815MB  (73.2%)
2018-06-13T09:54:22.776+0800    [##################......]  admin.temp  628MB/815MB  (77.0%)
2018-06-13T09:54:25.778+0800    [###################.....]  admin.temp  661MB/815MB  (81.2%)
2018-06-13T09:54:28.777+0800    [####################....]  admin.temp  691MB/815MB  (84.8%)
2018-06-13T09:54:31.777+0800    [#####################...]  admin.temp  724MB/815MB  (88.9%)
2018-06-13T09:54:34.776+0800    [######################..]  admin.temp  753MB/815MB  (92.4%)
2018-06-13T09:54:37.776+0800    [#######################.]  admin.temp  784MB/815MB  (96.2%)
2018-06-13T09:54:40.776+0800    [#######################.]  admin.temp  815MB/815MB  (100.0%)
2018-06-13T09:54:40.785+0800    [########################]  admin.temp  815MB/815MB  (100.0%)
2018-06-13T09:54:40.785+0800    no indexes to restore
2018-06-13T09:54:40.785+0800    finished restoring admin.temp (3347522 documents)
2018-06-13T09:54:40.786+0800    restoring users from /root/admin-06-13-18/admin/system.users.bson
2018-06-13T09:54:40.825+0800    done
[root@hdp05 ~]# mongo
MongoDB shell version v3.6.5
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.6.5
switched to db admin
> db.temp.count()
3347522
> 

2.3 恢复指定的collection

[root@hdp04 ~]# mongorestore -d admin -c temp --drop /root/admin-06-13-18/admin/temp.bson
2018-06-13T09:59:09.549+0800    checking for collection data in /root/admin-06-13-18/admin/temp.bson
2018-06-13T09:59:09.655+0800    reading metadata for admin.temp from /root/admin-06-13-18/admin/temp.metadata.json
2018-06-13T09:59:09.665+0800    restoring admin.temp from /root/admin-06-13-18/admin/temp.bson
2018-06-13T09:59:12.554+0800    [#.......................]  admin.temp  51.1MB/815MB  (6.3%)
2018-06-13T09:59:15.544+0800    [###.....................]  admin.temp  104MB/815MB  (12.8%)
2018-06-13T09:59:18.544+0800    [####....................]  admin.temp  163MB/815MB  (20.0%)
2018-06-13T09:59:21.544+0800    [######..................]  admin.temp  234MB/815MB  (28.7%)
2018-06-13T09:59:24.544+0800    [########................]  admin.temp  288MB/815MB  (35.3%)
2018-06-13T09:59:27.545+0800    [#########...............]  admin.temp  338MB/815MB  (41.5%)
2018-06-13T09:59:30.544+0800    [###########.............]  admin.temp  391MB/815MB  (48.0%)
2018-06-13T09:59:33.545+0800    [#############...........]  admin.temp  442MB/815MB  (54.3%)
2018-06-13T09:59:36.544+0800    [##############..........]  admin.temp  496MB/815MB  (60.8%)
2018-06-13T09:59:39.544+0800    [################........]  admin.temp  546MB/815MB  (67.0%)
2018-06-13T09:59:42.544+0800    [#################.......]  admin.temp  591MB/815MB  (72.5%)
2018-06-13T09:59:45.544+0800    [##################......]  admin.temp  626MB/815MB  (76.8%)
2018-06-13T09:59:48.544+0800    [###################.....]  admin.temp  677MB/815MB  (83.1%)
2018-06-13T09:59:51.546+0800    [#####################...]  admin.temp  728MB/815MB  (89.3%)
2018-06-13T09:59:54.544+0800    [######################..]  admin.temp  779MB/815MB  (95.6%)
2018-06-13T09:59:56.822+0800    [########################]  admin.temp  815MB/815MB  (100.0%)
2018-06-13T09:59:56.822+0800    no indexes to restore
2018-06-13T09:59:56.822+0800    finished restoring admin.temp (3347522 documents)
2018-06-13T09:59:56.822+0800    done

MongoDB CookBook读书笔记之备份与恢复相关推荐

  1. MongoDB CookBook读书笔记之导入导出

    本文主要介绍MongoDB的导入导出操作. 一.导入数据 MongoDB支持csv格式的数据导入.本节除了导入MongoDB CookBook书本提供的测试数据,还介绍了其他格式的csv文件数据导入. ...

  2. 【SQL.Cookbook读书笔记】——1检索记录

    SQL.Cookbook读书笔记 前言 1检索记录 1.1从表中检索所有行和列 1.2从表中检索部分行(where) 1.3查找满足多个条件的行(where.and.or) 1.4从表中检索部分列 1 ...

  3. mongoDB的读书笔记(04)_【Replica】(01)_Replica的一些基本概念

    数据库分布已经是当下互联网的标准配置.原来单节点标准配置,一台web服务器,一台数据库服务器的1+1模式,可以应对一个小公司或者少量的访问量.而随着服务的提升,对于7×24×365的高可用性的要求的需 ...

  4. MongoDB实战读书笔记(二):面向文档的数据

    1 schema设计原则 1.1 关系型数据库的三大设计范式 第一范式(1NF)无重复的列 第二范式(2NF)属性完全依赖于主键 [ 消除部分子函数依赖 ] 第三范式(3NF)属性不依赖于其它非主属性 ...

  5. Flex CookBook 读书笔记 第一部分

    定义数组和对象 可以通过ActionScript或者在Mxml中定义 <mx:Array> <mx:String>flex</mx:String> <mx:S ...

  6. mongoDB的读书笔记(via3.0)(00)_【概览】(02)_mongoDB3.0中的mongod启动方式小试牛刀

    mongod启动 本来想写Replica的非测试模式的集群架构的,但是实在是手痒痒,把mongoDB的3.0给download下来了,看了一两眼文档后决定还是先大概写一点点关于启动的话题,之后写Rep ...

  7. PHP Cookbook读书笔记 – 第16章互联网服务

    发送电子邮件 书中主要是以PEAR中的邮件发送类(Mail)来讲解的(关于如何在WIN系统下安装PEAR可以参考WIN下成功安装PEAR).PEAR的MAIL类可以通过3种方式来发送电子邮件: 通过P ...

  8. Kali Linux Network Scanning Cookbook读书笔记之nmap

    前言,这本书比我想象中的简单,但是一天就看了三百多页,因为真的没有什么很精彩的内容,所以前面四章就总结成这一篇的内容了,再者,真的一个nmap几乎秒了其他所有工具,所以直接介绍nmap,netcat就 ...

  9. PHP Cookbook读书笔记 – 第17章图形

    概述 PHP中绘制图形多使用GD库来实现,GD的功能多寡会因你使用的GD版本以及在配置期间启用了哪些选项而有很大的不同. 常用的GD函数 ImageCreate() : 创建一个基于调色板的图像 Im ...

  10. python cookbook 读书笔记2(字符串处理2)

    1.8检查字符集中是否包含某字符集中的字符,在以下几个例子中,也就是检查seq是否包含aset中的项,各函数中Any结尾是部分包含,也就是只要有其中元素就返回true,All结尾的是全部包含,必须包含 ...

最新文章

  1. EXCEL基础篇(二)
  2. Confluence 6 从外部目录中同步数据配置同步间隔
  3. .NET Standard 来日苦短去日长
  4. javascript 里Array的一些方法
  5. LeetCode 95. 不同的二叉搜索树 II(递归)
  6. MINA核心结构和处理消息的逻辑流程
  7. 时序列数据库武斗大会之 OpenTSDB 篇
  8. 【Vue】五个最常用的事件修饰符
  9. 仿MIUI音量变化环形进度条实现
  10. Ubuntu用Apache2快速搭建一个HTTP文件服务器
  11. linux中的so文件
  12. limesurvey-怎么用
  13. Codeforces Round #595 (Div. 3) E. By Elevator or Stairs?
  14. centos7下多播路由器安装及配置
  15. OpenAccessLibrary 网站简单爬取
  16. 王自如发致歉声明 称对现有业务进行整改
  17. js的exports
  18. 智能灯控制页面用HTML编写,3分钟教你创建手机APP控制全彩智能灯泡应用,图形化编程!...
  19. [转载]打工辛酸路:我是一朵飘零的花之61
  20. python 中的while true是什么意思_While True还是While 1?

热门文章

  1. 万年历插件软件测试,一个计算万年历的简单程序
  2. vlc_for_android(基于git-3.0.0)快速集成并播放电视节目直播
  3. 爱奇艺Android移动客户端app瘦身经验
  4. 使用第三方框架解耦的一种思路—简单工厂模式的运用
  5. Android Multimedia框架总结(二十三)MediaCodec补充及MediaMuxer引入(附案例)
  6. oracle字段id加1,oracle 字段ID自动增1
  7. html输入输出文件,学习如何用 C 语言来进行文件输入输出操作
  8. sap 打印预览界面点击打印时记录打印次数_9个Excel打印神技巧!从此打印不求人!...
  9. GitHub 版本控制 项目托管 02 搭建GitHub运行环境
  10. nodejs写的HTTP静态文件的引擎(轻量级)