can't start mongodb on a mac

573 views
Skip to first unread message

css-discuss.org

unread,
Oct 9, 2011, 8:19:18 PM10/9/11
to mongodb-user
Tried to get Mongodb up and running but I don't understand the
sequence to start it. I installed it from git.
I realize each distro is different, this is on a Mac with Snow
Leopard.
The instructions say do the following:
mkdir -p ~/data/db
mongod --dbpath ~/data/db/

I created the data directory above. Now what is --dbpath supposed to
be?
The directory where mongod is /usr/local/cellar/2*/bin/


mongod --/usr/local/cellar/2*/bin ~/data/db/
error command line: unknown option /usr/local/cellar/2*/bin

Another blog said do it this way but I get the below error:
sh-3.2# ./mongodb-xxxxxxx/bin/mongod
sh: ./mongodb-xxxxxxx/bin/mongod: No such file or directory

What is the xxxxxxx? Is that supposed to be the version. As I
mentioned above the path to mongod is /usr/local/cellar/2*/bin so
can you just tell me the right command to get this started?
tnx,

Bernie Hackett

unread,
Oct 9, 2011, 8:25:20 PM10/9/11
to mongodb-user
/path/to/mongod --dbpath ~/data/db

In your case I guess that would be:

/usr/local/cellar/2*/bin/mongod --dbpath ~/data/db

Timothy Hawkins

unread,
Oct 9, 2011, 8:25:00 PM10/9/11
to mongod...@googlegroups.com, mongodb-user
--dbpath is the option, you don't change it for anything, it tells mongod that the next argument (~/data/db) is the dbpath

Just type

"mongod --dbpath ~/data/db"


Sent from my iPad

> --
> 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.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>

Karl Seguin

unread,
Oct 9, 2011, 8:31:25 PM10/9/11
to mongod...@googlegroups.com
you can just create /data/db in your root  and then just start ./mongod    (it looks for /data/db in the root by default).

If you want  the data directory in ~/data/db...since you already created that folder, launch mongod like:


/usr/local/cellar/2*/bin/mongod --dbpath ~/data/db/ 

--dbpath isn't a variable, it's the name of the argument which is the path to the data file folder.

You can also create a bash script and use a config file:

#!/bin/sh

/usr/local/cellar/2*/bin/mongod -v --config /usr/local/cellar/2*/mongo.conf

and in your conf file put something like:

dbpath=~/data/db



css-discuss.org

unread,
Oct 9, 2011, 8:44:22 PM10/9/11
to mongodb-user
reading the directions is always confusing because they are generic.
I played around and got it. It is simply the path to mongod. Yeah-
who!! At least it looks like it is running.
/usr/local/cellar/mongodb/2*/bin/mongod
/usr/local/cellar/mongodb/2.0.0-x86_64/bin/mongod --help for help and
startup options
Sun Oct 9 17:41:53 [initandlisten] MongoDB starting : pid=4724
port=27017 dbpath=/data/db/ 64-bit host=janis-roughs-
macbookpro55.local
Sun Oct 9 17:41:53 [initandlisten] db version v2.0.0, pdfile version
4.5
Sun Oct 9 17:41:53 [initandlisten] git version:
695c67dff0ffc361b8568a13366f027caa406222
Sun Oct 9 17:41:53 [initandlisten] build info: Darwin erh2.10gen.cc
9.6.0 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008;
root:xnu-1228.9.59~1/RELEASE_I386 i386 BOOST_LIB_VERSION=1_40
Sun Oct 9 17:41:53 [initandlisten] options: {}
Sun Oct 9 17:41:53 [initandlisten] journal dir=/data/db/journal
Sun Oct 9 17:41:53 [initandlisten] recover : no journal files
present, no recovery needed
Sun Oct 9 17:41:53 [websvr] admin web console waiting for connections
on port 28017
Sun Oct 9 17:41:53 [initandlisten] waiting for connections on port
27017
Sun Oct 9 17:42:53 [clientcursormon] mem (MB) res:14 virt:2416 mapped:
0

css-discuss.org

unread,
Oct 9, 2011, 8:46:44 PM10/9/11
to mongodb-user
I'll try the config file and bash script I just wanted to get it
running the hard way before I make a short cut.

On Oct 9, 5:31 pm, Karl Seguin <karlseg...@gmail.com> wrote:

css-discuss.org

unread,
Oct 9, 2011, 9:17:59 PM10/9/11
to mongodb-user
I started the shell.
Why does it say there is a missing parenthesis?
I'm following along in the tutorial to create the object "t" & "j" and
save it in the collection things.

> j = ( name : "mongo" );
Sun Oct 9 18:11:47 SyntaxError: missing ) in parenthetical (shell):1
> t = ( x : 3 );
Sun Oct 9 18:14:03 SyntaxError: missing ) in parenthetical (shell):1
> db.things.save(j);
Sun Oct 9 18:14:48 ReferenceError: j is not defined (shell):1
> db.things.save(t);
Sun Oct 9 18:14:58 ReferenceError: t is not defined (shell):1
> db.things.find();




On Oct 9, 5:25 pm, Timothy Hawkins <tim.hawk...@mac.com> wrote:
> --dbpath is the option, you don't change it for anything, it tells mongod that the next argument (~/data/db) is the dbpath
>
> Just type
>
> "mongod --dbpath ~/data/db"
>
> Sent from my iPad
>

css-discuss.org

unread,
Oct 9, 2011, 9:21:16 PM10/9/11
to mongodb-user
I tried it with the other parenthesis also, but it doesn't read the
closing parenthesis???
> j = { name : "mongo" );
Sun Oct 9 18:19:42 SyntaxError: missing } after property list (shell):
1
tnx,

On Oct 9, 5:25 pm, Timothy Hawkins <tim.hawk...@mac.com> wrote:
> --dbpath is the option, you don't change it for anything, it tells mongod that the next argument (~/data/db) is the dbpath
>
> Just type
>
> "mongod --dbpath ~/data/db"
>
> Sent from my iPad
>

css-discuss.org

unread,
Oct 9, 2011, 9:23:34 PM10/9/11
to mongodb-user
I got it . I guess I was using the wrong parenthesis and it had to
flush its memory. Sorry, thanks very much.

> t = { x : 3 };
{ "x" : 3 }

On Oct 9, 5:25 pm, Timothy Hawkins <tim.hawk...@mac.com> wrote:
> --dbpath is the option, you don't change it for anything, it tells mongod that the next argument (~/data/db) is the dbpath
>
> Just type
>
> "mongod --dbpath ~/data/db"
>
> Sent from my iPad
>

Rahul Lamba

unread,
Nov 27, 2013, 10:15:11 AM11/27/13
to mongod...@googlegroups.com, janis...@gmail.com
How did you flush the memory?

I am facing same issue, 

Asya Kamsky

unread,
Nov 27, 2013, 11:50:41 PM11/27/13
to mongodb-user

What issue are you facing?

It would be better to describe your symptoms. There isn't really such a thing as needing to flush memory so I don't know what problem you or previous poster was describing. 

Asya

--
--
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
 
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages