Re: setting up mongodb in an LSF cluster high performance computing server

77 views
Skip to first unread message

David Hows

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

Beyond the NUMA warnings everything there looks normal.

Mongod appears to be up and waiting for client connections.

What are you expecting?

Cheers,

David

Daniel Fernandez

unread,
Oct 8, 2012, 10:52:06 PM10/8/12
to mongod...@googlegroups.com
Hi, I guess I am confused as on how to use mongodb then.  I have used it in my own amazon ec2 server and have no problem when I type mongo, but ...

in this server I try the following and it would not connect:

Prepending: .mongodb-linux-x86_64-2.2.0 (ok)
allelix> mongo
MongoDB shell version: 2.2.0
connecting to: test
Mon Oct  8 22:47:49 Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:91
exception: connect failed

so i am not sure what to do or what could be the issue.  maybe a firewall blocking issue?

David Hows

unread,
Oct 8, 2012, 11:30:22 PM10/8/12
to mongod...@googlegroups.com
Are you running the mongo command on the same server that you have mongod running on?

If you are, then can you check that the process is running while you try and connect?

If the process is running then yes, there could be a firewall blocking loopback connections on that port.

Daniel Fernandez

unread,
Oct 8, 2012, 11:35:03 PM10/8/12
to mongod...@googlegroups.com
Are you running the mongo command on the same server that you have mongod running on? yes, I do.  As I said I have no server admin permissions so I have no idea how to solve this issue.

If you are, then can you check that the process is running while you try and connect?  How'd I do this?

If the process is running then yes, there could be a firewall blocking loopback connections on that port.  How could I solve this?

David Hows

unread,
Oct 9, 2012, 12:03:11 AM10/9/12
to mongod...@googlegroups.com
Daniel,

To check for a running mongod process, please try the following command "ps -ef | grep mongod"

To check simple connectivity you should try the telnet command.

The syntax to check would be, "telnet 127.0.0.1 27017" this will try and connect to the mongod port.

To exit telnet press Ctrl + ] which will give you a prompt then type quit.

Cheers,

David

Daniel Fernandez

unread,
Oct 10, 2012, 1:44:21 PM10/10/12
to mongod...@googlegroups.com
Hi David, thanks a lot.

I tried the commands you suggested and these are the results:

allelix> ps -ef | grep mongod 
dfernand 30839 22317  0 13:41 pts/132  00:00:00 grep mongod

allelix> telnet 127.0.0.1 27017 
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host: Connection refused

[tin.broadinstitute.org]allelix> mongod --dbpath /seq/epigenome01/allelix/ma/mongodb/
Wed Oct 10 13:42:15 [initandlisten] MongoDB starting : pid=32011 port=27017 dbpath=/seq/epigenome01/allelix/ma/mongodb/ 64-bit host=tin.broadinstitute.org
Wed Oct 10 13:42:15 [initandlisten] db version v2.2.0, pdfile version 4.5
Wed Oct 10 13:42:15 [initandlisten] git version: f5e83eae9cfbec7fb7a071321928f00d1b0c5207
Wed Oct 10 13:42:15 [initandlisten] build info: Linux ip-10-2-29-40 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_49
Wed Oct 10 13:42:15 [initandlisten] options: { dbpath: "/seq/epigenome01/allelix/ma/mongodb/" }
Wed Oct 10 13:42:15 [initandlisten] journal dir=/seq/epigenome01/allelix/ma/mongodb/journal
Wed Oct 10 13:42:15 [initandlisten] recover : no journal files present, no recovery needed
Wed Oct 10 13:42:15 [initandlisten] waiting for connections on port 27017
Wed Oct 10 13:42:15 [websvr] admin web console waiting for connections on port 28017

So my question would be how can I set it up, I do not have admin permission over these servers so I am not sure how to proceed.  Do you have any suggestion as what the admin team would have to do to allow the usage/connection to the server for mongodb.

ThANKS!

David Hows

unread,
Oct 10, 2012, 7:13:53 PM10/10/12
to mongod...@googlegroups.com
Right, the first two commands showed that your mongod instance was not running when you tried to connect to it.

My suggestion for you now is to do the following:

Add options to set the logpath of your mongod instance and the fork. These are --logpath <path to file> and --fork 

This means mongo will run in the background. You can see details on the mongod commands here

MongoDB is run in a number of parts, mongod is the actual DB server that stores your data. 
The "mongo" application is the MongoDB shell client, which gives you an interface into the server.
By the looks of things you did not have your server running when you tried to connect to it with your client.
Adding the fork and logpath options will allow mongod to run in the background so it can run without intervention.

Once its up and running in the background you can use "ps -ef | grep mongod" to check if the process is running and then connect with the mongo shell application.

If you need to see the diagnostic outputs from the mongod application these should be available in the logfile you specified.

Cheers,

David
Reply all
Reply to author
Forward
0 new messages