After typing mongod I got the log below:
2015-11-21T21:51:11.424-0800 I JOURNAL [initandlisten] journal dir=/data/db/journal
2015-11-21T21:51:11.424-0800 I JOURNAL [initandlisten] recover : no journal files present, no recovery needed
2015-11-21T21:51:11.438-0800 I JOURNAL [durability] Durability thread started
2015-11-21T21:51:11.439-0800 I CONTROL [initandlisten] MongoDB starting : pid=22458 port=27017 dbpath=/data/db 64-bit host=(name)-MBP
2015-11-21T21:51:11.439-0800 I CONTROL [initandlisten]
2015-11-21T21:51:11.439-0800 I JOURNAL [journal writer] Journal writer thread started
2015-11-21T21:51:11.439-0800 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
2015-11-21T21:51:11.439-0800 I CONTROL [initandlisten] db version v3.0.7
2015-11-21T21:51:11.439-0800 I CONTROL [initandlisten] git version: nogitversion
2015-11-21T21:51:11.439-0800 I CONTROL [initandlisten] build info: Darwin yosemitevm.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
2015-11-21T21:51:11.439-0800 I CONTROL [initandlisten] allocator: system
2015-11-21T21:51:11.439-0800 I CONTROL [initandlisten] options: {}
2015-11-21T21:51:11.456-0800 I NETWORK [initandlisten] waiting for connections on port 27017
It seems like I am having a warning and an error but is connected.
Now, I'm following MongoDB's document to test out how the database works. In one of the tutorials, it tells me to import a json file into my mongo db.
I input the following:
mongoimport --db test --collection restaurants --drop --file primer-dataset.json
and the result is :
2015-11-21T21:57:36.533-0800 [........................] test.restaurants 0.0 B/11.3 MB (0.0%)
2015-11-21T21:57:37.066-0800 Failed: error connecting to db server: no reachable servers
2015-11-21T21:57:37.066-0800 imported 0 documents
Can anyone tell me how to fix this problem?
I did brew update to update everything. So my mongodb version is 3.0.7 (the latest one)
And I'm in development mode using homebrew.