学习任务
今天要学习的是《12 | MongoDB全家桶》,第一章的最后一节,内容不多,只是mongodb周边软件的一个介绍。
第八天
MongoDB全家桶
软件模块 | 描述 |
---|---|
mongod | MongoDB数据库软件 |
mongo | MongoDB命令行工具,用于管理MongoDB数据库 |
mongos | MongoDB路由进程,分片环境下使用 |
mongodump/mongorestore | 命令行数据库备份与恢复工具 |
mongoexport/mongoimport | 导入导出CSV/JSON工具,用于不同系统间数据迁移 |
Compass | MongoDB GUI管理工具 |
Ops Manager | MongoDB集群管理软件 |
BI Connector | SQL解释器/BI套接件 |
MongoDB Charts | MongoDB可视化软件,生成各种图表 |
Atlas | MongoDB官方的托管服务,支持一个3节点的免费云数据库 |
mongodump/mongorestore
与mysqldump/mysqlrestore功能一样,完成数据的备份与恢复
mongodump常用参数
如果不加参数,就是连接到27017实例,然后全库导出成一个.bson文件
官方文档地址
参数 | 作用 |
---|---|
-h, --host=<hostname> | mongodb host to connect to (setname/host1,host2 for replica sets) |
--port=<port> | server port (can also use --host hostname:port) |
-u, --username=<username> | username for authentication |
-p, --password=<password> | password for authentication |
-d, --db=<database-name> | database to use |
-c, --collection=<collection-name> | collection to use |
--uri=mongodb-uri | mongodb uri connection string |
-o, --out=<directory-path> | output directory, or '-' for stdout (defaults to 'dump') |
--gzip | compress archive our collection output with Gzip |
--oplog | use oplog for taking a point-in-time snapshot |
--archive=<file-path> | dump as an archive to the specified path. If flag is specified without a value, archive is written to stdout |
mongorestore 常用参数
从当前文件夹下恢复.bson文件数据到27017端口的实例上
官方文档
参数 | 作用 |
---|---|
-h, --host=<hostname> | mongodb host to connect to (setname/host1,host2 for replica sets) |
--port=<port> | server port (can also use --host hostname:port) |
-u, --username=<username> | username for authentication |
-p, --password=<password> | password for authentication |
--uri=mongodb-uri | mongodb uri connection string |
-d, --db=<database-name> | database to use when restoring from a BSON file |
-c, --collection=<collection-name> | collection to use when restoring from a BSON file |
--objcheck | validate all objects before inserting |
--oplogReplay | replay oplog for point-in-time restore |
--oplogLimit=<seconds>[:ordinal] | only include oplog entries before the provided Timestamp |
--oplogFile=<filename> | oplog file to use for replay of oplog |
--archive=<filename> | restore dump from the specified archive file. If flag is specified without a value, archive is read from stdin |
--dir=<directory-name> | input directory, use '-' for stdin |
--gzip | decompress gzipped input |
--drop | drop each collection before import |
--dryRun | view summary without importing anything. recommended with verbosity |
Atlas
MongoDB官方提供的云托管理平台
MongoDB BI Connector
提供类似MySQL语法的查询分析工具
Ops Manager
集群管理工具
MongoDB Charts
生成图表软件
最后
今天内容就这些,明天开始复习。
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。