Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mongod runs but only outputs all output going to path and that's it

Tags:

macos

mongodb

I am completely lost at the moment and would greatly appreciate your assistance. I installed mongoDB through Homebrew and created a data/db directory on my hardrive at the root. Everything seemed fine so far. I then proceeded to run mongod and I was met with the following :

all output going to: /usr/local/var/log/mongodb/mongo.log

Here is the contents of the log file (the latest section of it) on my last run:

Wed Sep 26 18:46:19 [initandlisten] MongoDB starting : pid=7720 port=27017 dbpath=/usr/local/var/mongodb 64-bit host=Notionworks-MacBook-Pro.local
Wed Sep 26 18:46:19 [initandlisten] 
Wed Sep 26 18:46:19 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
Wed Sep 26 18:46:19 [initandlisten] db version v2.2.0, pdfile version 4.5
Wed Sep 26 18:46:19 [initandlisten] git version: f5e83eae9cfbec7fb7a071321928f00d1b0c5207
Wed Sep 26 18:46:19 [initandlisten] build info: Darwin bs-osx-106-x86-64-1.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386 BOOST_LIB_VERSION=1_49
Wed Sep 26 18:46:19 [initandlisten] options: { bind_ip: "127.0.0.1", config: "/usr/local/etc/mongod.conf", dbpath: "/usr/local/var/mongodb", logappend: "true", logpath: "/usr/local/var/log/mongodb/mongo.log" }
Wed Sep 26 18:46:19 [initandlisten] journal dir=/usr/local/var/mongodb/journal
Wed Sep 26 18:46:19 [initandlisten] recover : no journal files present, no recovery needed
Wed Sep 26 18:46:19 [websvr] admin web console waiting for connections on port 28017
Wed Sep 26 18:46:19 [initandlisten] waiting for connections on port 27017

As far as I can tell, everything looks like it is running correctly (however I don't really know what I'm looking at). The only thing that seems amis is the dbpath, which according to the documentation defaults to /data/db/

Any help would be greatly appreciated!

EDIT:

Sorry I forgot to mention that I did try to run mongo after running mongod. Here's the code:

Notionworks-MacBook-Pro:locomotivecms Notionwork$ mongod
all output going to: /usr/local/var/log/mongodb/mongo.log
mongo
db.test.save( { a: 1} )
db.test.find()

Does this look normal to you? It doesn't return anything...

UPDATE:

Solved it! I was being silly and trying to enter the command mongo in the same terminal window. I did not realize that you had to open a new window in order to run it. There was no mention of having to open a new window in mongoDB's set-up tutorial, and I didn't put two and two together. I was confounded, as I thought that mongoDB was just sitting there thinking... It works great now! All I have to figure out now is how to change mongoDB's default path permanently so that I wont have to change it every time with -- dbpath. Right now it defaults to usr/local/var/mongodb. I just have to find the config file and change that if possible... Just found it in the log! Yay! I'll see if I can change it! Thanks again for your prompt replies!

like image 891
MWGriffin Avatar asked Sep 27 '12 01:09

MWGriffin


People also ask

What does the Mongod command do?

mongod is the primary daemon process for the MongoDB system. It handles data requests, manages data access, and performs background management operations.

What is the difference between Mongod and mongos?

Here, Mongod is the server component. You start it, it runs, that's it. By definition we also call it the primary daemon process for the MongoDB database which handles data requests, manages data access, and performs background management operations. Whereas Mongo is a default command line client.

Where MongoDB data is stored?

The default location for the MongoDB data directory is c:\data\db. So you need to create this folder using the Command Prompt.


3 Answers

The you need to change the limit of your files which is 266 right now.

** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000

Enter the following in the command-line to change it:
ulimit -n 1000

You might get maxproc error which changing it, you can find out more on this post

like image 122
pouyanghasemi Avatar answered Sep 25 '22 14:09

pouyanghasemi


If you want to start playing around with that instance just type

mongo

in a new terminal or run mongod with --fork

like image 30
Scott Avatar answered Sep 23 '22 14:09

Scott


Type mongo in the new terminal.

like image 40
user1518659 Avatar answered Sep 23 '22 14:09

user1518659