I'm installing Mongodb in several time in Ubuntu 15.04 but it not install properly and mongo shell has an error :
mongo
MongoDB shell version: 3.0.1
connecting to: test
2015-04-07T18:46:14.958+0430 W NETWORK Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2015-04-07T18:46:14.959+0430 E QUERY Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed
at connect (src/mongo/shell/mongo.js:179:14)
at (connect):1:6 at src/mongo/shell/mongo.js:179
exception: connect failed
I'm installing the 2.6.4 and updated to 3.0.1 but the error not resolve.
I found this Answer in stackoverflow and search to find mongod.lock in ubuntu and remove it and then flow this step :
Step 2: Repair mongodb.
sudo mongod --repair
Step 3: start mongodb.
sudo start mongodb
or
sudo service mongodb start
Step 4: Check status of mongodb.
sudo status mongodb
or
sudo service mongodb status
Step 5: Start mongo console.
mongo
for reapir :
mongod --repair
2015-04-07T18:58:15.595+0430 I STORAGE [initandlisten] exception in initAndListen: 29 Data directory /data/db not found., terminating
2015-04-07T18:58:15.595+0430 I CONTROL [initandlisten] dbexit: rc: 100
This error for sudo service mongodb start :
sudo service mongodb start
[sudo] password for amir:
Failed to start mongodb.service: Unit mongodb.service failed to load: No such file or directory.
and for status :
sudo service mongodb status
● mongodb.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
and for start shell the first problem has throw.
I try install mongodb with linuxbrew and again the error did not gone...
--------------- update --------
since in what say "demostene" :
I think you just need to create this folder /data/db . Try sudo mkdir /data/db then repair
I have the /data/db in the home/amir/data/db then i create the /data/db in root and nothing change...
In last time i installing the mongo with linuxbrew and for that the sudo command did not work in sudo mongod --repair and other step and without sudo that's command did not work...
so i first try sudo su in terminal and try the step in root
in first step say the mongodb is not install and for install it insert : apt-get install mongo-server
I insert this command and install mongodb again.
Now in root mongo shell start correctly in this version :
root#AbrFa:/home/amir# mongo
MongoDB shell version: 2.6.3
connecting to: test
>
and without the sudo su mongo shell start in this version :
MongoDB shell version: 3.0.1
connecting to: test
By the way I want's to know do not conflict this 2 version with each other?
Ok I've found the fix. Not the best but it'll do for now. Click this link and download the suitable option. I chose the apt-install option. Choice is yours. The version is 2.6.3 and you will have to create the /data/db folder again. But we're back for now.
in my case I was running "sudo mongod --repair" and I figure out that I did not have the folder "/data/db". So I just created that folder and ran again the "sudo mongod --repair" and now it works!
Related
I recently completed the m001 basics course on Mongo University and connecting to Atlas with the connection string was not a problem. With experimenting I messed up and now I am not able to start mongo. The steps I followed are (from my root directory):
brew doctor --verbose
to make sure Homebrew is running correctly and there were no issues.
HomeBrew version: 3.0.1,
macOs: 11.1,
Homebrew Cask Staging Location: /usr/local/Caskroom
Homebrew Cask Taps: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask (3823 casks)
/usr/bin/xattr
brew cleanup
brew update
brew tap mongodb/brew
Mongo Docs installation
brew install mongodb-community#4.4
Already downloaded: /Users/kevinturney/Library/Caches/Homebrew/downloads/269692f6b2d908000ecd7602021f4826947a782576c1fea760d25ece5ccbb521--mongodb-macos-x86_64-4.4.3.tgz
brew services start mongodb-community#4.4
Service mongodb-community already started, use brew services restart mongodb-community to restart.
brew services restart mongodb-community
==> Successfully stopped mongodb-community (label: homebrew.mxcl.mongodb-community)
==> Successfully started mongodb-community (label: homebrew.mxcl.mongodb-community)
kevinturney / $ brew services list
Here is the error:
Name
Status
User
Plist
mongodb-community
error
kevinturney
/Users/kevinturney/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist
mysql
stopped
postgresql
stopped
redis
stopped
unbound
stopped
I checked the processes,
MongDB University-processes
ps -ef | grep mongo
501 10770 81999 0 10:34AM ttys007 0:00.00 grep mongo
ps -ef | grep mongod
501 10776 81999 0 10:34AM ttys007 0:00.00 grep mongod
ps -ef | grep mongos
01 10781 81999 0 10:34AM ttys007 0:00.00 grep mongos
mongo --version
MongoDB shell version v4.2.2
git version: a0bbbff6ada159e19298d37946ac8dc4b497eadf
allocator: system
modules: enterprise
build environment:
distarch: x86_64
target_arch: x86_64
mongod --version
db version v4.2.2
git version: a0bbbff6ada159e19298d37946ac8dc4b497eadf
allocator: system
modules: enterprise
build environment:
distarch: x86_64
target_arch: x86_64
When I run brew services start mongodb-community it successfully starts and then
mongo this is the result:
kevinturney / $ brew services start mongodb-community
==> Successfully started `mongodb-community` (label: homebrew.mxcl.mongodb-community)
kevinturney / $ mongo
MongoDB shell version v4.2.2<br/>
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb<br/>
2021-02-17T11:37:32.192-0500 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, <br/>connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect#src/mongo/shell/mongo.js:341:17<br/>
#(connect):2:6
2021-02-17T11:37:32.195-0500 F - [main] exception: connect failed
2021-02-17T11:37:32.195-0500 E - [main] exiting with code 1
I followed a very similar StackOverflow question, went though mongo docs, uninstalled, reinstalled, Also, tried this great post I am not sure what to try next.
If you are using macOS Catalina / BigSur Above this fix will work:
Go to command line and execute these commands, you need to use SUDO else this will not work.
We first remove the folder mongodb,
sudo rm -rf /usr/local/var/mongodb
then, we add it manually,
cd /usr/local/var && mkdir mongodb
Now, we run the brew service as below, please mention the mongodb version at the end, as below:
brew services start mongodb-community#5.0
If you get below response please restart the service,
Service `mongodb-community` already started, use `brew services restart mongodb-community` to restart.
To restart the service use below, please mention the mongodb version at the end:
brew services restart mongodb-community#5.0
Stopping `mongodb-community`... (might take a while)
==> Successfully stopped `mongodb-community` (label: homebrew.mxcl.mongodb-commu
==> Successfully started `mongodb-community` (label: homebrew.mxcl.mongodb-commu
Now we list all services, with below command:
brew services list
Output:
Name Status User Plist
mongodb-community started xxx homebrew.mxcl.mongodb-community.plist
Open your Terminal and type mongod –version to verify your installation.
Could be permission issues Check ownership of /tmp/mongodb-27017.sock Try to remove this file and start the service again
via:https://www.mongodb.com/community/forums/t/help-brew-mongodb-community-5-0-error-macos/125648
If someone can provide some insights here I would GREATLY appreciate it.
I had a express/node.js app running on MongoDB locally successfully, but upon restarting my computer, I attempted to restart the Mongo server and it began giving errors and wouldn't start. Since then, I have re-installed Mongo several times only to find the same error occurring. this is what I am receiving:
privee:mongodb-osx-x86_64-2.4.6 jonlinton$ ./bin/mongo
MongoDB shell version: 2.4.6
connecting to: test
Mon Aug 26 14:48:47.168 Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145
exception: connect failed
Am I missing a step? Should I be creating a config file?
If you have installed mongodb through homebrew then you can simply start mongodb through (mongodb-community if installted mongodb-community
brew services start mongodb
OR
brew services start mongodb-community
Then access the shell by
mongo
You can shut down your db by
brew services stop mongodb
You can restart your db by
brew services restart mongodb
For more options
brew info mongodb
Updated answer (9/2/2019):
Homebrew has removed mongodb formula from its core repository, see this pull request.
The new way to install mongodb using Homebrew is as follows:
~> brew tap mongodb/brew
~> brew install mongodb-community
After installation you can start the mongodb service by following the caveats:
~> brew info mongodb-community
mongodb/brew/mongodb-community: stable 4.2.0
High-performance, schema-free, document-oriented database
https://www.mongodb.com/
Not installed
From: https://github.com/mongodb/homebrew-brew/blob/master/Formula/mongodb-community.rb
==> Caveats
To have launchd start mongodb/brew/mongodb-community now and restart at login:
brew services start mongodb/brew/mongodb-community
Or, if you don't want/need a background service you can just run:
mongod --config /usr/local/etc/mongod.conf
Deprecated answer (8/27/2019):
I assume you are using Homebrew. You can see the additional information that you need using brew info $FORMULA
~> brew info mongo 255
mongodb: stable 2.4.6, devel 2.5.1
http://www.mongodb.org/
/usr/local/Cellar/mongodb/2.4.5-x86_64 (20 files, 287M) *
Built from source
From: https://github.com/mxcl/homebrew/commits/master/Library/Formula/mongodb.rb
==> Caveats
To reload mongodb after an upgrade:
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
Caveats is what you need to follow after installation.
Assuming you have created the data/db directory under bin after install.
Start a terminal for your mongo server
Go to <mongodb-install-directory>/bin directory
Run the command
./mongod
Start a terminal for your mongo shell
Go to <mongodb-install-directory>/bin directory
Run the command (make sure you put the name of the database)
./mongo test
Problem here is you are trying to open a mongo shell without starting a mongo db which is listening to port 127.0.0.1:27017(deafault for mongo db) thats what the error is all about:
Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145 exception: connect failed
The easiest solution is to open the terminal and type
$ mongod --dbpath ~/data/db
Note: dbpath here is "Users/user" where data/db directories are created
i.e., you need to create directory data and sub directory db in your user folder.
For e.g say `
/Users/johnny/data
After mongo db is up. Open another terminal in new window and type
$ mongo
it will open mongo shell with your mongo db connection opened in another terminal.
Mac Installation:
Install brew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Update and verify you are good with
brew update
brew doctor
Install mongodb with
brew install mongodb
Create folder for mongo data files:
mkdir -p /data/db
Set permissions
sudo chown -R `id -un` /data/db
Open another terminal window & run and keep running a mongo server/daemon
mongod
Return to previous terminal and run a mongodb shell to access data
mongo
To quit each of these later:
The Shell:
quit()
The Server
ctrl-c
For those that could be facing the same problem and the solutions suggested above aren't working, for example in my case, I had installed mongodb-community, so you might wanna run the command below to restart your mongo server.
For those that installed mongodb-community using brew
brew services start mongodb-community
additionally you may want mongo to run on another port, then paste this command on terminal,
mongod --dbpath /data/db/ --port 27018
where 27018 is the port we want mongo to run on
assumptions
mongod exists in your bin i.e /usr/local/bin/ for mac ( which would be if you installed with brew), otherwise you'd need to navigate to the path where mongo is installed
the folder /data/db/ exists
mongo => mongo-db console
mongodb => mongo-db server
If you're on Mac and looking for a easier way to start/stop your mongo-db server, then MongoDB Preference Pane is something that you should look into. With it, you start/stop your mongo-db instance via UI. Hope it helps!
Make sure you are logged in as root user in your terminal.
Steps to start mongodb server in your mac
Open Terminal
Run the command sudo su
Enter your administrator password
run the command mongod
MongoDb Server starts
Hope it helps you.
Thanks
Nothing less likely to be outdated that the official docs: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/
What worked for me on MacOS 12.6.1:
Go to Homebrew copy the "Install Brew " link from there , paste and run .run
To check the version of brew
brew
or
brew -v
then
brew tap mongodb/brew
brew install mongodb-community
sudo mkdir -p /System/Volumes/Data/data/db
sudo chown -R `id -un` /System/Volumes/Data/data/db
sudo mongod --dbpath /System/Volumes/Data/data/db
this would run your MongoDB .
Download MongoDB and install it on your local machine.
Link https://www.mongodb.com/try/download/enterprise
Extract the file and put it on the desktop.
Create another folder where you want to store the data. I have created mongodb-data folder.
Then run the below command.
Desktop/mongodb/bin/mongod --dbpath=/Users/yourname/Desktop/mongodb-data/
Before the hyphen is the executable path of your mongoDB and after hyphen is your data store.
I just installed mongoDB on ubuntu 14.0.4.
I tried to start the shell but I'm getting a connection refused error.
me#medev:/etc/init.d$ mongo
MongoDB shell version: 2.6.5
connecting to: test
2014-11-10T15:06:28.084-0500 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2014-11-10T15:06:28.085-0500 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146
exception: connect failed
So I decided to try to restart the service but that's failing too. I get the following error message:
me#medev:/etc/init.d$ sudo service mongodb restart
mongodb: unrecognized service
me#medev:/etc/init.d$
This is what I have in my /var/log/mongodb/mongod.log - http://pastebin.com/MrHt8tce
what i've tried so far:
I found another post here: can't start mongodb as sudo
which made a comment about remove the mongo lock file.
I deleted the lock file and then retried my command but it still fails as you can see below:
me#medev:/var/lib/mongodb$ sudo rm mongod.lock
me#medev:/var/lib/mongodb$ ls
journal local.0 local.ns _tmp
me#medev:/var/lib/mongodb$ sudo service mongodb start
mongodb: unrecognized service
But I can start it using /etc/init.d as you can see below:
me#medev:/var/lib/mongodb$ sudo /etc/init.d/mongod start
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mongod start
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start mongod
mongod start/running, process 27469
me#medev:/var/lib/mongodb$ ls
journal local.0 local.ns mongod.lock
me#medev:/var/lib/mongodb$ mongo
MongoDB shell version: 2.6.5
connecting to: test
> db
test
>
Any ideas on why I can't start it using the service command would be appreciated. From what I've read, i should be using sudo service mongodb
Try this:
Write mongodb instead of mongod
sudo service mongodb status
I got the same error one day You should use this:
1.Get the status of your mongo service:
/etc/init.d/mongod status
or
sudo service mongod status
2.If it's not started repair it like this:
sudo rm /var/lib/mongodb/mongod.lock
mongod --repair
sudo service mongodb start
And check again if the service is started again(1)
For me the solution was to replace
service mongod start
with
start mongod
You need to make sure the file (ex. /etc/init.d/mongodb) has execute permissions.
chmod +x /etc/init.d/mongodb
For debian, from the 10gen repo, between 2.4.x and 2.6.x, they renamed the init script /etc/init.d/mongodb to /etc/init.d/mongod, and the default config file from /etc/mongodb.conf to /etc/mongod.conf, and the PID and lock files from "mongodb" to "mongod" too. This made upgrading a pain, and I don't see it mentioned in their docs anywhere. Anyway, the solution is to remove the old "mongodb" versions:
update-rc.d -f mongodb remove
rm /etc/init.d/mongodb
rm /var/run/mongodb.pid
diff -ur /etc/mongodb.conf /etc/mongod.conf
Now, look and see what config changes you need to keep, and put them in mongod.conf.
Then:
rm /etc/mongodb.conf
Now you can:
service mongod restart
I installed mongo server on Debian Jessie using manual from official site.
It didn't started after recommended command sudo service mongod restart with the same error - mongodb: unrecognized service.
After looking into installed package contents, I noticed that it contains only Systemd service unit, but no SystemV init script:
# dpkg -L mongodb-org-server
/.
/usr
/usr/bin
/usr/bin/mongod
/usr/share
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/mongodb-org-server
/usr/share/doc
/usr/share/doc/mongodb-org-server
/usr/share/doc/mongodb-org-server/LICENSE-Community.txt
/usr/share/doc/mongodb-org-server/README
/usr/share/doc/mongodb-org-server/copyright
/usr/share/doc/mongodb-org-server/changelog.gz
/usr/share/doc/mongodb-org-server/GNU-AGPL-3.0.gz
/usr/share/doc/mongodb-org-server/THIRD-PARTY-NOTICES.gz
/usr/share/doc/mongodb-org-server/MPL-2.gz
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/mongod.1.gz
/etc
/etc/mongod.conf
/lib
/lib/systemd
/lib/systemd/system
/lib/systemd/system/mongod.service
But my system was running on SysV init:
# stat /proc/1/exe
File: '/proc/1/exe' -> '/sbin/init'
So, there are 2 options now:
(Continue on SysV) Write sysV init script manually as #khylo mentioned above
(Switch to SystemD) and run systemctl start mongod
For me nothing have helped, I've ended up with a solution:
create /lib/systemd/system/mongod.service file with content
[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target
Documentation=https://docs.mongodb.org/manual
[Service]
User=mongodb
Group=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf
[Install]
WantedBy=multi-user.target
then start/stop commands should work
$ sudo service mongod start
For reference - I have Ubuntu 14.04 LTS, MongoDB 3.2.9 installed from
deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse
You can use mongod command instead of mongodb, if you find any issue regarding dbpath in mongo you can use my answer in the link below.
https://stackoverflow.com/a/53057695/8247133
I think you may have installed the version of mongodb for the wrong system distro.
Take a look at how to install mongodb for ubuntu and debian:
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-debian/
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
I had a similar problem, and what happened was that I was installing the ubuntu packages in debian
Original Source - https://www.techrepublic.com/article/how-to-install-mongodb-community-edition-on-ubuntu-linux/
If you're on Ubuntu 16.04 and face the unrecognized service error, these instructions will fix it for you:-
Open a terminal window.
Issue the command sudo apt-key adv —keyserver hkp://keyserver.ubuntu.com:80 —recv EA312927
Issue the command sudo touch /etc/apt/sources.list.d/mongodb-org.list
Issue the command sudo gedit /etc/apt/sources.list.d/mongodb-org.list
Copy and paste one of the following lines from below (depending upon your release) into the open file.
For 12.04: deb http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.6 multiverse
For 14.04: deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.6 multiverse
For 16.04: deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse
Make sure to edit the version number with the appropriate latest version and save the file.
Installation
Open a terminal window and issue command sudo apt-get update && sudo apt-get install -y mongodb-org
Let the installation complete.
Running MongoDB To start the database, issue the command sudo service mongodb start. You should now be able to issue the command to see that MongoDB is running: systemctl status mongodb
Ubuntu 16.04 solution
If you are using Ubuntu 16.04, you may run into an issue where you see the error mongodb: unrecognized service due to the switch from upstart to systemd. To get around this, you have to follow these steps.
If you added the /etc/apt/sources.list.d/mongodb-org.list, remove it with the command sudo rm /etc/apt/sources.list.d/mongodb-org.list
Update apt with the command sudo apt-get update
Install the official MongoDB version from the standard repositories with the command sudo apt-get install mongodb in order to get the service set up properly
Remove what you just installed with the command sudo apt-get remove mongodb && sudo apt-get autoremove
Now follow steps 1 through 5 listed above to install MongoDB; this should re-install the latest version of MongoDB with the systemd services already in place. When you issue the command systemctl status mongodb you should see that the server is active.
I mostly copy pasted the above (with minor modifications and typo fixes) from here - https://www.techrepublic.com/article/how-to-install-mongodb-community-edition-on-ubuntu-linux/
This is a simple solution that worked for me with the same problem (I think):
mv /var/lib/mongodb /var/lib/mongodb_backup
mkdir /var/lib/mongodb
chmod 700 /var/lib/mongodb
chown mongodb:daemon /var/lib/mongodb
systemctl restart mongodb or service mongod restart
If you're running Ubuntu in WSL (Windows Subsystem for Linux), you will have issues because WSL does not currently support systemd.
The link below explains how to run MongoDB without systemd, and even how to add a script for using the service command with WSL.
https://learn.microsoft.com/en-us/windows/wsl/tutorials/wsl-database#mongodb-init-system-differences
tutorials may start MongoDB using the operating system's built-in init system. You might see the command sudo systemctl status mongodb used in tutorials or articles. Currently WSL does not have support for systemd (a service management system in Linux).
You shouldn't notice a difference, but if a tutorial recommends using sudo systemctl, instead use: sudo /etc/init.d/. For example, sudo systemctl status docker, for WSL would be sudo /etc/init.d/docker status ...or you can also use sudo service docker status.
Recently I extended my server's storage size. Everything else is working fine, but I cannot manage to start MongoDB by sudo service mongodb start. After I typed in this command, it prompted mongodb start/running, process 1279. It looks OK. but when I check the status of the service, it shows the service is not running. So I checked the mongodb.log. What I found is the service will start, and after a while, the service process will receive a signal 2: Thu Jun 6 06:09:06.963 got signal 2 (Interrupt), will terminate after current cmd ends.
I also try to configure the mongodb to output more verbose log, but it didn't help me to figure out the source if the interruption.
Now I can only start MongoDB with sudo mongod --config /path/to/conf_file. Anyone knows how to fix it? Thanks!
What I did was being sure that all the files and directories in your /var/lib/mongodb/ folder (or whichever folder dbpath points to) belong to the mongodb user and mongodb group.
cd /var/lib/mongodb/
sudo chown -R mongodb *
sudo chgrp -R mongodb *
Then you can remove the lock, repair the database and restart the daemon:
sudo rm /var/lib/mongodb/mongod.lock
sudo -u mongodb mongod --config /etc/mongodb.conf --repair
sudo service mongodb start
I've been trying to run mongo on my system, but I just doesn't want to start. I've installed mongodb with brew. Both mongo and mongod are on my system and I can use them. But the mongod process won't start.
These are the steps I'm taking after I installed mongo on my system with brew.
$ mongod
all output going to: /usr/local/var/log/mongodb/mongo.log
$
It seems mongod is closing directly, because I don't see any process running and it gives me the dollar sign back again. Thereby there's no rotating icon in my terminal, so it isn't running.
If I open a new window in the terminal after running the above command, I'm getting this error:
$ mongo
MongoDB shell version: 2.4.3
connecting to: test
Thu May 23 12:22:09.314 JavaScript execution failed: Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:L112
exception: connect failed
$
This output is a logical error seen from the fact mongod didn't do a thing. But when I run this:
$ ps -ef | grep mongod
501 99123 15827 0 12:24PM ttys001 0:00.00 grep mongod
$
So I'm not sure or it's running or not.. You guys know a solution for this? Because I can't figure out what I'm doing wrong..
update
I've tried to change the db path and that works partially. I'm now able to run mongod command, but I need to specify the dbPath even though I have the dbPath changed in the config file.
$ mongod --dbpath ~/data/db/
And when I try to run mongod by itself, it won't run..
$ mongod
all output going to: /usr/local/var/log/mongodb/mongo.log
$
I don't have a working solution, but from your output, it seems like mongod is running daemonized. You could try setting the 'fork' option to false (or uncommenting it) in /usr/local/Cellar/mongodb/2.4.x-x86_64/mongod.conf and running mongod with the -v / --verbose flag to see if that gives you more details.
Also, are you sure you're actually using the homebrew version of mongo and not some previously installed version? You can check which mongod is used by running:
➜ ~ which mongod
/usr/local/bin/mongod
And the following to see if that's indeed the version that got installed using homebrew:
➜ ~ ls -l /usr/local/bin/mongod
lrwxr-xr-x 1 user admin 41 21 mrt 22:06 /usr/local/bin/mongod -> ../Cellar/mongodb/2.4.x-x86_64/bin/mongod
The default data directory is /data/db. In order to have that work by default you need to do two things:
sudo mkdir -p /data/db
sudo chown `whoami` /data/db