0

So I have successfully installed mongodb on my macbook. I say this bc when i run 'brew install mongodb' command line says: 'mongodb-2.6.7 already installed. I ran the command 'mkdir -p /data/db' although I am not able to really follow what that did (and I have tried going through some of the other threads on SO and the Mongo site but didn't understand how to resolve the issue; sry I am a little bit noobish and don't really understand the problem). However, when I type in mongod to see if it is running successfully I get the following error/output

2015-02-01T14:37:30.575-0500 [initandlisten] MongoDB starting : pid=41932 port=27017 dbpath=/data/db 64-bit host=[removed]-mbp.home
2015-02-01T14:37:30.575-0500 [initandlisten] 
2015-02-01T14:37:30.575-0500 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
2015-02-01T14:37:30.575-0500 [initandlisten] db version v2.6.7
2015-02-01T14:37:30.575-0500 [initandlisten] git version: nogitversion
2015-02-01T14:37:30.575-0500 [initandlisten] build info: Darwin minimavericks.local 13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
2015-02-01T14:37:30.575-0500 [initandlisten] allocator: tcmalloc
2015-02-01T14:37:30.575-0500 [initandlisten] options: {}
2015-02-01T14:37:30.577-0500 [initandlisten] exception in initAndListen: 10309 Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating
2015-02-01T14:37:30.577-0500 [initandlisten] dbexit: 
2015-02-01T14:37:30.577-0500 [initandlisten] shutdown: going to close listening sockets...
2015-02-01T14:37:30.577-0500 [initandlisten] shutdown: going to flush diaglog...
2015-02-01T14:37:30.577-0500 [initandlisten] shutdown: going to close sockets...
2015-02-01T14:37:30.577-0500 [initandlisten] shutdown: waiting for fs preallocator...
2015-02-01T14:37:30.577-0500 [initandlisten] shutdown: lock for final commit...
2015-02-01T14:37:30.577-0500 [initandlisten] shutdown: final commit...
2015-02-01T14:37:30.578-0500 [initandlisten] shutdown: closing all files...
2015-02-01T14:37:30.578-0500 [initandlisten] closeAllFiles() finished
2015-02-01T14:37:30.578-0500 [initandlisten] shutdown: removing fs lock...
2015-02-01T14:37:30.578-0500 [initandlisten] couldn't remove fs lock errno:9 Bad file descriptor
2015-02-01T14:37:30.578-0500 [initandlisten] dbexit: really exiting now

One of the issues listed says 'soft rlimits too low', but my understanding is since I'm just doing this for development rather than production purposes that is irrelevant. Can someone adivse how to resolve this error? Here is a comparable thread but I wasn't sure what to do:

Trouble installing mongodb using Homebrew

After running sudo chown $USER /data/db I am now getting:

mongod --help for help and startup options
2015-02-01T15:48:06.940-0500 [initandlisten] MongoDB starting : pid=43297 port=27017 dbpath=/data/db 64-bit host=shus-mbp.home
2015-02-01T15:48:06.941-0500 [initandlisten] 
2015-02-01T15:48:06.941-0500 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
2015-02-01T15:48:06.941-0500 [initandlisten] db version v2.6.7
2015-02-01T15:48:06.941-0500 [initandlisten] git version: nogitversion
2015-02-01T15:48:06.941-0500 [initandlisten] build info: Darwin minimavericks.local 13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
2015-02-01T15:48:06.941-0500 [initandlisten] allocator: tcmalloc
2015-02-01T15:48:06.941-0500 [initandlisten] options: {}
2015-02-01T15:48:06.949-0500 [initandlisten] journal dir=/data/db/journal
2015-02-01T15:48:06.950-0500 [initandlisten] recover : no journal files present, no recovery needed
2015-02-01T15:48:06.972-0500 [initandlisten] allocating new ns file /data/db/local.ns, filling with zeroes...
2015-02-01T15:48:07.025-0500 [FileAllocator] allocating new datafile /data/db/local.0, filling with zeroes...
2015-02-01T15:48:07.025-0500 [FileAllocator] creating directory /data/db/_tmp
2015-02-01T15:48:07.125-0500 [FileAllocator] done allocating datafile /data/db/local.0, size: 64MB,  took 0.099 secs
2015-02-01T15:48:07.154-0500 [initandlisten] build index on: local.startup_log properties: { v: 1, key: { _id: 1 }, name: "_id_", ns: "local.startup_log" }
2015-02-01T15:48:07.165-0500 [initandlisten]     added index to empty collection
2015-02-01T15:48:07.165-0500 [initandlisten] command local.$cmd command: create { create: "startup_log", size: 10485760, capped: true } ntoreturn:1 keyUpdates:0 numYields:0  reslen:37 193ms
2015-02-01T15:48:07.165-0500 [initandlisten] waiting for connections on port 27017
2015-02-01T15:49:06.978-0500 [clientcursormon] mem (MB) res:34 virt:2637
2015-02-01T15:49:06.978-0500 [clientcursormon]  mapped (incl journal view):160
2015-02-01T15:49:06.978-0500 [clientcursormon]  connections:0

Does that mean its working now?

vfvfvfvfvfvfvfvfv
  • 143
  • 1
  • 1
  • 7
  • mkdir just makes a directory (which you could almost guess if you tried really hard to pronounce it as a word). The -p flag just says "and make the parent directory if that doesn't already exist." – vrmc Feb 01 '15 at 20:36
  • Hi -thanks. It looks like the is the part that is having an error based on the output. Do you know what I should do to resolve the issue? – vfvfvfvfvfvfvfvfv Feb 01 '15 at 20:38
  • When I ran ls -l /data I get 'drwxr-xr-x' and when I run ls-ld /data/db I get 'drwxr-xr-x' as well – vfvfvfvfvfvfvfvfv Feb 01 '15 at 20:41
  • Probably a permissions thing. I would check out [this answer](http://stackoverflow.com/a/7948986/3483033). – vrmc Feb 01 '15 at 20:54
  • Hi - I saw that answer and ran 'sudo chown $USER /data/db'. Does the stuff I added to the answer make sense and does it mean it is working now? At the bottom it says connections: 0 so I didn't know if that was a problem – vfvfvfvfvfvfvfvfv Feb 01 '15 at 20:56
  • Yeah, looks like it's running now. Try querying it. Since you're new to Mongo, I would download [Robomongo](http://robomongo.org). It's a pretty decent graphical interface you can use to poke around in there. – vrmc Feb 01 '15 at 21:01

1 Answers1

0

Yes this is working. When you run 'mongod' and see this 'waiting for connections on port 27017', then your mongodb is running well and you can start querying it.

Abhay PS
  • 4,015
  • 5
  • 25
  • 32