mongodb在ubuntu中存储数据库的位置在哪里?

时间:2014-03-13 05:19:53

标签: mongodb

我想在mongodb中备份数据库。我从文档中找到了命令

mongodump --dbpath /data/db/ --out /data/backup/

但我发现没有任何名为" / data /"在我的机器上?但我可以在mongo shell中看到数据库:

$ mongo
MongoDB shell version: 2.4.9
connecting to: test
> show dbs;
ihtx    0.203125GB
local   0.078125GB

1 个答案:

答案 0 :(得分:1)

最好知道配置的保存位置:

$ cat /etc/mongod.conf
# mongod.conf

# Where to store the data.

# Note: if you run mongodb as a non-root user (recommended) you may
# need to create and set permissions for this directory manually,
# e.g., if the parent directory isn't mutable by the mongodb user.
dbpath=/var/lib/mongodb

#where to log
logpath=/var/log/mongodb/mongod.log

但正如/var/lib/mongodb那样。

标准安装程序如下:

http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/