Re: to allocate collection on specified disk device

99 views
Skip to first unread message

David Hows

unread,
Oct 4, 2012, 2:45:09 AM10/4/12
to mongod...@googlegroups.com
Hi Gowest,

MongoDB stores all its data under one folder which is controlled by the DBPath variable.


There are no methods within mongo to direct the output for different databases to different locations.

Hope that clears things up,

David

gowest

unread,
Oct 4, 2012, 5:14:23 AM10/4/12
to mongod...@googlegroups.com
Hi David. Thanks a lot !!
 
>>There are no methods within mongo to direct the output for different databases to different locations.

I got it.

But that link is very available.

I'll make effort to decrease the data amount, or re-build the database on a larger space than current.

Scott Hernandez

unread,
Oct 4, 2012, 6:10:06 AM10/4/12
to mongod...@googlegroups.com
You can specify the directoryperdb option to have each database in a
different directory, under dbpath. In this way you can store different
databases on difference devices using symlinks or mount points.

http://www.mongodb.org/display/DOCS/--directoryperdb

This allows you to do number 2.

> Hope that clears things up,
>
> David
>
> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user...@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb

gowest

unread,
Oct 4, 2012, 10:32:21 PM10/4/12
to mongod...@googlegroups.com
Hi, Scott. Thanks a lot for an available massage.

I think it might be the way to do waht I want.

But, It is impposible to use the option when I create  the database.

Best Regards.

2012年10月4日木曜日 19時10分37秒 UTC+9 Scott Hernandez:

Scott Hernandez

unread,
Oct 4, 2012, 11:08:02 PM10/4/12
to mongod...@googlegroups.com
It is a mode you start the server in. You can create the db
directories and move the files over if you started without it. Just
create the directories with the same name as the database, and put all
the database files in there with that name.

gowest

unread,
Oct 8, 2012, 10:47:45 PM10/8/12
to mongod...@googlegroups.com
Thanks, Scott.

I got it.

I’ll try that.

Best Regards.

2012年10月5日金曜日 12時08分41秒 UTC+9 Scott Hernandez:

gowest

unread,
Oct 24, 2012, 12:56:35 AM10/24/12
to mongod...@googlegroups.com
Hi, Scott.

Its been a while.

Now, I need your addvise.

I made 2 databases under same directory like this,
(under /var/db/mongo)

db1 col1.0 col1.1 col1.ns
db2 col2.0 col2.1 col2.ns

I want to move db2 database to other directory(/home/mongo).

So, I do the mongod command like this

/opt/mongodb/bin/mongod --dbpath /home/mongo/col2.0 --directoryperdb

But it didn't work well.

How do I write the command?

Tom Vo

unread,
Oct 24, 2012, 2:11:47 AM10/24/12
to mongod...@googlegroups.com
Hi Gowest 

I think you should make directory "db2" in "/home/mongo" . And you could start your database by command: /opt/mongodb/bin/mongod --dbpath /home/mongo/db2 --directoryperdb

Thanks.

--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb



--

Thanks and Best Regards
-------------------------------------------------------------------------------------------------------------
Vo Tan Hau (TOM)
Senior Database Administrator
NEXCEL SOLUTIONS LTD
SMS Tower,Lot 40, Quang Trung Software City, District 12, HCMC, Vietnam.
Tel:+84-8-37154278 - Fax:+84-8-37154279 www.nexcel.vn
Messenger
(Skype+Yahoo+Live): Vohau2002


gowest

unread,
Oct 25, 2012, 1:04:39 AM10/25/12
to mongod...@googlegroups.com
Hi Tom. Thank you for your reply.

At that example, db1 and db2 are not directories but databases.

If I make new database with dedault sessing by createCollection command, New database is build under a default directory.

Can I make db2 under another directoty ?

Best Regard.

2012年10月24日水曜日 15時12分02秒 UTC+9 Tom Vo:
Reply all
Reply to author
Forward
0 new messages