Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
267 views
in Technique[技术] by (71.8m points)

Where does mongodb store database in ubuntu?

I want to take backup of a database in the mongodb. I found the command from documentation

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

But I see there is no any directory called "/data/" in my machine? But I can see the database in mongo shell:

$ mongo
MongoDB shell version: 2.4.9
connecting to: test
> show dbs;
ihtx    0.203125GB
local   0.078125GB
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Good idea to know where the configuration is kept:

$ 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

But in/var/lib/mongodb as it says there.

The standard installation procedure is here:

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...