Getting mongod to run.. new to mongo and Linux!

299 views
Skip to first unread message

Mel

unread,
Jun 6, 2012, 12:41:12 PM6/6/12
to mongodb-user
I've been working with mongo for a while on my Windows computer and so
far have had no issues, but when I try to run it on Unix I'm getting
some errors and it will not start up. Below I have the output I'm
getting, so if anyone has a suggestion please let me know. I'll note
that one of the errors involves "running on a NUMA machine" and I
tried launching it using numactle --interleave=all etc like referenced
in the tutorial, but nothing worked. Thanks for the help!

execution:
/Downloads/mongodb-linux-x86_64-2.0.5/bin> ./mongod --dbpath='~data/
db'
output:
Wed Jun 6 11:28:25 [initandlisten] MongoDB starting : pid=18394
port=27017 dbpath=~data/db 64-bit host={hostname}
Wed Jun 6 11:28:25 [initandlisten]
Wed Jun 6 11:28:25 [initandlisten] ** WARNING: You are running on a
NUMA machine.
Wed Jun 6 11:28:25 [initandlisten] ** We suggest launching
mongod like this to avoid performance problems:
Wed Jun 6 11:28:25 [initandlisten] ** numactl --
interleave=all mongod [other options]
Wed Jun 6 11:28:25 [initandlisten]
Wed Jun 6 11:28:25 [initandlisten] ** WARNING: /proc/sys/vm/
overcommit_memory is 2
Wed Jun 6 11:28:25 [initandlisten] ** Journaling works best
with it set to 0 or 1
Wed Jun 6 11:28:25 [initandlisten]
Wed Jun 6 11:28:25 [initandlisten] db version v2.0.5, pdfile version
4.5
Wed Jun 6 11:28:25 [initandlisten] git version:
1bb4de4630302fad8af53824ca4f627db490b753
Wed Jun 6 11:28:25 [initandlisten] build info: Linux ip-10-110-9-236
2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64
BOOST_LIB_VERSION=1_41
Wed Jun 6 11:28:25 [initandlisten] options: { dbpath: "~data/db" }
Wed Jun 6 11:28:25 [initandlisten] exception in initAndListen: 10296
dbpath (~data/db) does not exist, terminating
Wed Jun 6 11:28:25 dbexit:
Wed Jun 6 11:28:25 [initandlisten] shutdown: going to close listening
sockets...
Wed Jun 6 11:28:25 [initandlisten] shutdown: going to flush
diaglog...
Wed Jun 6 11:28:25 [initandlisten] shutdown: going to close
sockets...
Wed Jun 6 11:28:25 [initandlisten] shutdown: waiting for fs
preallocator...
Wed Jun 6 11:28:25 [initandlisten] shutdown: lock for final commit...
Wed Jun 6 11:28:25 [initandlisten] shutdown: final commit...
Wed Jun 6 11:28:25 [initandlisten] shutdown: closing all files...
Wed Jun 6 11:28:25 [initandlisten] closeAllFiles() finished
Wed Jun 6 11:28:25 dbexit: really exiting now

Mel

unread,
Jun 6, 2012, 1:38:15 PM6/6/12
to mongodb-user
Thanks for the reply, so I'm guessing the error is due to running on
NUMA? so I'm trying to interpret these instructions on the mongo site:

http://www.mongodb.org/display/DOCS/NUMA

so I type in

~/Downloads/mongodb-linux-x86_64-2.0.5/bin> numactl --interleave=all $
{MONGODB_HOME}/bin/mongod --config conf/mongodb.conf

and my output is:
numactl: execution of `/bin/mongod': No such file or directory

Can anyone help me interpret those instructions? Obviously I'm not
doing it quite right.

Thanks

On Jun 6, 11:54 am, "[psyg]" <mnsol...@gmail.com> wrote:
> Hi, not sure if this will help but might be worth a look if you haven't
> already.
>
> https://groups.google.com/forum/?fromgroups#!topic/mongodb-user/k2Sqk...
>
> <https://groups.google.com/forum/?fromgroups#!topic/mongodb-user/k2Sqk...>
> Thanks!

Sam Millman

unread,
Jun 6, 2012, 2:06:23 PM6/6/12
to mongod...@googlegroups.com
try:

~/Downloads/mongodb-linux-x86_64-2.0.5/bin> numactl --interleave=all ./mongod --dbpath='/data/db'

That should now say run the mongod in the current directory (since you are already in /bin/) and use dbpath /data/db.

If you have not setup permissions you may require sudo. If you have not setup the directory you will need to mkdir /data and /db within /data.

Of course technically you don't need the '' on the dbpath but it helps the console interpreter.

That should get your somewhere.

--
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

Mel

unread,
Jun 6, 2012, 2:11:10 PM6/6/12
to mongod...@googlegroups.com
Thanks for that. (also data/db definitely is set up in the home directory, so no issues there.) when I execute the numactl command you gave me, basically nothing at all happened.. is that what I should expect? how do I know if mongod is running? On Windows I leave that terminal open and run mongo.exe in a separate command prompt, should that be the case on Linux too?

thanks

Mel

unread,
Jun 6, 2012, 2:14:07 PM6/6/12
to mongod...@googlegroups.com
Never mind that last comment, turns out I do need sudo for it. I think that should work though once I get myself a password.

Sam Millman

unread,
Jun 6, 2012, 2:15:18 PM6/6/12
to mongod...@googlegroups.com
What do you mean "nothing happens" what output do you get?

I don't ue NUMA (for obvious reasons) so can you explain the "nothing".

In theory is should actually show mongod starting up and going through the process of allocating journal.

Edit: Even without sudo it should throw out an error message telling you mongod cannot touch the /data/db since it is outside of your home directory.

Mel

unread,
Jun 6, 2012, 2:43:47 PM6/6/12
to mongod...@googlegroups.com
I'm thinking now that it's less of a NUMA issue and more that it can't find the data/db directory for whatever reason. I tried moving all the mongo files to my home directory and running it from there, but now instead of it starting up and stopping, *nothing* happens, that is, I just get another command line. I've tried ./mongod and ./mongod --dbpath='data/db', but neither do anything. Here's a copy of my terminal:

[330]galloway@lucifer1 ~> ls
bsondump  Documents  mongo        mongodump    mongoimport   mongosniff  Music     Templates
data      Downloads  mongod       mongoexport  mongorestore  mongostat   Pictures  Videos
Desktop   journal    mongod.lock  mongofiles   mongos        mongotop    Public
[331]galloway@lucifer1 ~> ./mongod
[332]galloway@lucifer1 ~> ./mongod --dbpath='data/db'

As you can see, /data/db exists in my home directory, but now just nothing at all happens when i try to run mongod. Any thoughts?

Sam Millman

unread,
Jun 6, 2012, 2:51:23 PM6/6/12
to mongod...@googlegroups.com
And what if you do a ls -la on your home directory?

My first thought is that you have taken mongod outside of its original folder (inside of /bin) if that is the binary mongod and not a directory, hence why it might be failing.

If you go back to the mongod in your mongo bin folder and run the same command from there what do you get (~/Downloads/mongodb-linux-x86_
64-2.0.5/bin)
?

--

Mel

unread,
Jun 6, 2012, 3:02:17 PM6/6/12
to mongod...@googlegroups.com
Okay, I moved mongod to its original folder (downloads/mongo...etc.../bin), and now when I try to run it also nothing happens, where before it'd start and then fail..did I screw something up when I moved the file to my home directory and back?

Adam C

unread,
Jun 7, 2012, 6:46:47 AM6/7/12
to mongod...@googlegroups.com
You mention previously that your data folder is in the home folder, which would make it ~/data/db

Let's clear up the confusion once and for all.  Go to the folder where your MongoDB data will reside by running something like this:

# change to the home folder
cd 
# now to the data folder
cd data/db
# finally, get the full path
pwd

The output of pwd will give you the full path to the folder.  Take that full path and use it for the --dbpath argument.

If you still have problems, then re-post the output when you try to start monogod and we can take it from there.

Adam

Mel

unread,
Jun 7, 2012, 5:32:22 PM6/7/12
to mongod...@googlegroups.com
Thanks for that suggestion.. I think that has a good chance of working. My problem now is that I was told to try moving all my mongo files into my home directory and try from there, but not when I try to run ./mongod in any form (with/without any dbpath specified), nothing at all happens, not even it starting and failing, it just goes right to the next command line. Are there issues associated with moving the mongo files into different folders, and how can I correct them? all I did was "mv mongod ~/mongod. "

Sam Millman

unread,
Jun 7, 2012, 5:46:58 PM6/7/12
to mongod...@googlegroups.com
I am not familar with Mongod's coding however I would definitely say its a receipe for disaster, not sure who told you to move the folders (I definately didn't).

If you download straight from the downloads page again: http://www.mongodb.org/downloads and do the steps you did before again. After run the command said earlier in this thread making sure you use pwd to get the absolute directory paths.





An example of the basic steps I take to stepup Mongo in about 2 mins:

cd ~ // lets go home
wget http://www.mongodb.org/downloads/mongodb-2.0.x.tar.gz // lets download the file

And then unzip:

tar xvf ./mongodb-2.0.x.tar.gz

and then cd into the mongo directory:

cd ./mongodb-2.0.x/bin

then create the data folders somewhere lets say in the root:

sudo mkdir /data
sudo mkdir /data/db

then run mongod

sudo ./mongod

It should now not like your numa but like everything else, in which case you apply the comand stated earlier in this thread to turn off numa

Mel

unread,
Jun 11, 2012, 4:16:48 PM6/11/12
to mongod...@googlegroups.com
Alright, turned out that the whole problem was not using the full path! Thanks so much for the suggestion, and everything is fine now.

On Thursday, June 7, 2012 5:46:47 AM UTC-5, Adam C wrote:
Reply all
Reply to author
Forward
0 new messages