简体   繁体   English

在mongod.cfg文件中指定转储目录

[英]Specifying dump directory in mongod.cfg file

All, 所有,

Is there a system wide setting to specify the dump folder in MongoDB? 是否有系统范围的设置来指定MongoDB中的转储文件夹? I went through this link and couldn't find any. 通过此链接 ,找不到任何链接

Basically, I want C:\\MongoDB\\dump to be the folder where all backups are created. 基本上,我希望C:\\ MongoDB \\ dump是创建所有备份的文件夹。 Currently, a dump folder is created in the folder mongodump is executed in or one has to specify a folder explicitly using --out parameter as a part of mongodump. 当前,在执行mongodump的文件夹中创建了一个转储文件夹,或者必须使用--out参数明确指定一个文件夹作为mongodump的一部分。

Instead, wherever I may execute mongodump from, I want the dumps to be always created in C:\\MongoDB\\dump 相反,无论我在哪里执行mongodump,我都希望转储始终在C:\\ MongoDB \\ dump中创建

Thanks, rgn 谢谢,rgn

您可以使用mongodump

mongodump --host mongodb1.example.net --port 37017 --username user --password "pass" --out /opt/backup/mongodump-2011-10-24

If you do not specify the --out paramater to the mongodump , it will create a dump directory in the current directory to store the database dump. 如果不指定--out paramater到mongodump ,它会创建一个dump在当前目录的目录来存放数据库的转储。

You can set a system level parameter for the base directory for all of your dumps. 您可以为所有转储的基本目录设置系统级参数。 However, for every mongodump you take you will have to pass the --out parameter to uniquely identify that dump. 但是,对于您执行的每个mongodump ,您都必须传递--out参数以唯一地标识该转储。

Failing to do so will overwrite the existing dumps within your base dump directory 否则,将覆盖基本转储目录中的现有转储

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Windows上我的Mongo安装中没有mongod.cfg文件 - mongod.cfg file not present in my Mongo installation on Windows 如何使mongodb自动使用mongod.cfg文件,而不必运行它来使dbpath变得不同? - How to make mongodb automatically use the mongod.cfg file instead of having to run it to make dbpath different? 在 mongod.cfg 中启用授权会导致服务器崩溃 - Enabling authorization in mongod.cfg makes server crash 如何让 mongod 默认从 /bin/mongod.cfg 加载配置? - How to get mongod to load configuration from /bin/mongod.cfg by default? 将 ips 添加到 mongod.cfg 中的 bind_ip 后,无法将 MongoDB 作为服务启动 - Cannot start MongoDB as a service after adding ips to bind_ip in mongod.cfg mongod libstdc ++。so.6没有这样的文件或目录 - mongod libstdc++.so.6 no such file or directory 启动 MongoDB : ./bin/mongod 没有那个文件或目录 - Starting MongoDB : ./bin/mongod No such file or directory bash:mongodb / bin / mongod:没有这样的文件或目录 - bash: mongodb/bin/mongod : No such file or directory 无法锁定锁定文件:/data/db/mongod.lock。 另一个mongod实例已经在/ data / db目录中运行,终止 - Unable to lock the lock file: /data/db/mongod.lock. Another mongod instance is already running on the /data/db directory, terminating 尽管指定了路径,但仍无法识别 Mongod 命令 - Mongod Command not recognized despite specifying Path
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM