I have just installed Mongodb on my Ubuntu 18 LTS. When I follow the instructions according to the Mongodb Manual, I get some errors in step 3 which is apt update:
Err:11 http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 InRelease
403 Forbidden [IP: 143.204.209.210 80]
Err:12 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 InRelease
403 Forbidden [IP: 143.204.209.210 443]
After much trying, I finally installed mongodb with this command,(I removed -org):
sudo apt-get install -y mongodb
after that, I started Mongodb without any errors:
sudo service mongodb start
then I checked the status and everything seems to be fine:
mongodb.service - An object/document-oriented database
Loaded: loaded (/lib/systemd/system/mongodb.service; enabled; vendor preset:
Active: active (running) since Thu 2020-04-16 10:32:29 +0430; 25min ago
Docs: man:mongod(1)
Main PID: 1066 (mongod)
Tasks: 23 (limit: 4418)
CGroup: /system.slice/mongodb.service
└─1066 /usr/bin/mongod --unixSocketPrefix=/run/mongodb --config /etc/
But the problem is when I type "mongod" in my Terminal, I encounter the error code:100 though I have my dbpath:
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] MongoDB starting : pid=4353 port=27017 dbpath=/data/db 64-bit host=ata-Aspire-E1-571G
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] db version v3.6.3
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] git version: 9586e557d54ef70f9ca4b43c26892cd55257e1a5
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.1 11 Sep 2018
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] allocator: tcmalloc
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] modules: none
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] build environment:
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] distarch: x86_64
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] target_arch: x86_64
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] options: {}
2020-04-16T11:14:05.161+0430 I STORAGE [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] now exiting
2020-04-16T11:14:05.161+0430 I CONTROL [initandlisten] shutting down with code:100
Does anyone have any idea what my problem is? I checked the previous talks but found nothing on this.
Another thing I have to report is that I use Sudo before mongod but get the same error with mongod.
While you could repair your existing installation, the log output indicates that you installed 3.6 which is 2 versions out of date (current version is 4.2), and is not even the most recent 3.6 release which is 3.6.17. So I suggest you follow the instructions again and prior to doing that, remove any existing files with names like /etc/apt/sources.list.d/mongodb-org-4.2.list that you may have and remove any installed MongoDB packages.
Finally I installed my Mongodb via changing my DNS because of sanctions problem. Now, I have my mongodb installed but when I type "mongod" in my Ubuntu terminal I get this:
2020-04-17T12:38:01.073+0430 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-04-17T12:38:01.078+0430 W ASIO [main] No TransportLayer configured during NetworkInterface startup
2020-04-17T12:38:01.078+0430 I CONTROL [initandlisten] MongoDB starting : pid=2476 port=27017 dbpath=/data/db 64-bit host=ata-Aspire-E1-571G
2020-04-17T12:38:01.078+0430 I CONTROL [initandlisten] db version v4.2.5
2020-04-17T12:38:01.078+0430 I CONTROL [initandlisten] git version: 2261279b51ea13df08ae708ff278f0679c59dc32
2020-04-17T12:38:01.078+0430 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.1 11 Sep 2018
2020-04-17T12:38:01.078+0430 I CONTROL [initandlisten] allocator: tcmalloc
2020-04-17T12:38:01.078+0430 I CONTROL [initandlisten] modules: none
2020-04-17T12:38:01.078+0430 I CONTROL [initandlisten] build environment:
2020-04-17T12:38:01.078+0430 I CONTROL [initandlisten] distmod: ubuntu1804
2020-04-17T12:38:01.078+0430 I CONTROL [initandlisten] distarch: x86_64
2020-04-17T12:38:01.078+0430 I CONTROL [initandlisten] target_arch: x86_64
2020-04-17T12:38:01.078+0430 I CONTROL [initandlisten] options: {}
2020-04-17T12:38:01.079+0430 E NETWORK [initandlisten] Failed to unlink socket file /tmp/mongodb-27017.sock Operation not permitted
2020-04-17T12:38:01.079+0430 F - [initandlisten] Fatal Assertion 40486 at src/mongo/transport/transport_layer_asio.cpp 684
2020-04-17T12:38:01.079+0430 F - [initandlisten]
***aborting after fassert() failure
And then when I re-run it with the commadand "sudo mongod" I encounter:
2020-04-17T12:42:30.535+0430 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-04-17T12:42:30.536+0430 W ASIO [main] No TransportLayer configured during NetworkInterface startup
2020-04-17T12:42:30.537+0430 I CONTROL [initandlisten] MongoDB starting : pid=2514 port=27017 dbpath=/data/db 64-bit host=ata-Aspire-E1-571G
2020-04-17T12:42:30.537+0430 I CONTROL [initandlisten] db version v4.2.5
2020-04-17T12:42:30.537+0430 I CONTROL [initandlisten] git version: 2261279b51ea13df08ae708ff278f0679c59dc32
2020-04-17T12:42:30.537+0430 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.1 11 Sep 2018
2020-04-17T12:42:30.537+0430 I CONTROL [initandlisten] allocator: tcmalloc
2020-04-17T12:42:30.537+0430 I CONTROL [initandlisten] modules: none
2020-04-17T12:42:30.537+0430 I CONTROL [initandlisten] build environment:
2020-04-17T12:42:30.537+0430 I CONTROL [initandlisten] distmod: ubuntu1804
2020-04-17T12:42:30.537+0430 I CONTROL [initandlisten] distarch: x86_64
2020-04-17T12:42:30.537+0430 I CONTROL [initandlisten] target_arch: x86_64
2020-04-17T12:42:30.537+0430 I CONTROL [initandlisten] options: {}
2020-04-17T12:42:30.537+0430 E STORAGE [initandlisten] Failed to set up listener: SocketException: Address already in use
2020-04-17T12:42:30.552+0430 I CONTROL [initandlisten] now exiting
2020-04-17T12:42:30.552+0430 I CONTROL [initandlisten] shutting down with code:48
when I type "sudo systemctl status mongodb", I get this:
Unit mongodb.service could not be found.
But, when I enter this command I get the proper answer:
"mongo --eval 'db.runCommand({ connectionStatus: 1 })'"
MongoDB shell version v4.2.5
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("a24c786b-d161-4c3c-91bd-a55198d72505") }
MongoDB server version: 4.2.5
{
"authInfo" : {
"authenticatedUsers" : [ ],
"authenticatedUserRoles" : [ ]
},
"ok" : 1
}
Now, I was wondered what the problem could be?
I think I finally got my answer. Here there are some problems that may cause problems:
1.Uninstalling Mongodb completely is very important. You should remove every each of folders. For this, you can use Mongodb Uninstalling instructions.
For those who had the same problem as me, Forbidden access is sth for countries which are under sanctions and will not access to the targeted website unless you change your DNS or use Proxies. Otherwise you won't get access to anything.
3.If the previous step is met, then we can follow the instructions in Mongodb website in order to install your Mongodb.
**** An important thing is sometimes we need to change our IP connection in Configuration of Mongodb ****
Having Mongodb installed in your Computer, a reboot(restart) may be needed. After a restart the system may work correctly.
For running Mongodb in your Terminal type :
Mongod and if it didn't work, try "sudo mongod"
And finally we can enjoy our Mongodb.
Goodluck!
Related
Just trying to get up and started using the "mongod" command...
I've already looked at the following:
Cannot start mongo db
Trouble Starting MongoDB (Mac) - Code: 100
... and many other forum posts.
This is what I got in my terminal:
#####-MacBook-Pro-2:p2w4-back_end ashesmachine$ mongod
2020-05-17T13:53:02.341-0700 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-05-17T13:53:02.345-0700 W ASIO [main] No TransportLayer configured during NetworkInterface startup
2020-05-17T13:53:02.346-0700 I CONTROL [initandlisten] MongoDB starting : pid=57712 port=27017 dbpath=/data/db 64-bit host=#####-MacBook-Pro-2.local
2020-05-17T13:53:02.346-0700 I CONTROL [initandlisten] db version v4.2.6
2020-05-17T13:53:02.346-0700 I CONTROL [initandlisten] git version: 20364840b8f1af16917e4c23c1b5f5efd8b352f8
2020-05-17T13:53:02.346-0700 I CONTROL [initandlisten] allocator: system
2020-05-17T13:53:02.346-0700 I CONTROL [initandlisten] modules: none
2020-05-17T13:53:02.346-0700 I CONTROL [initandlisten] build environment:
2020-05-17T13:53:02.346-0700 I CONTROL [initandlisten] distarch: x86_64
2020-05-17T13:53:02.346-0700 I CONTROL [initandlisten] target_arch: x86_64
2020-05-17T13:53:02.346-0700 I CONTROL [initandlisten] options: {}
2020-05-17T13:53:02.346-0700 I STORAGE [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating
2020-05-17T13:53:02.347-0700 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2020-05-17T13:53:02.347-0700 I - [initandlisten] Stopping further Flow Control ticket acquisitions.
2020-05-17T13:53:02.347-0700 I CONTROL [initandlisten] now exiting
2020-05-17T13:53:02.347-0700 I CONTROL [initandlisten] shutting down with code:100
You should create the data/db directory before starting mongodb. Something like mkdir -p /data/db
This worked for me:
sudo mongod --dbpath ~/Documents/data/mongo-db
I'm trying to install mongoDB on my Mac. However, I'm running into a lot of issues.
I first installed mongoDB using Homebrew by running the following commands:
brew tap mongodb/brew
brew install mongodb-community#4.2
Then ran it using:
brew services start mongodb-community#4.2
Everything looks fine at this point, until I try running in the terminal:
mongod
At first I thought the issue was that I didn't create the /data/db folder, so I ran:
sudo mkdir -p /data/db
This did not work.
I then found an article stating Mac users need to run:
sudo mkdir -p /System/Volumes/Data/data/db
This worked.. then I ran:
mongod --dbpath /System/Volumes/Data/data/db
And received the following:
2020-02-09T20:36:07.667-0500 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-02-09T20:36:07.672-0500 I CONTROL [initandlisten] MongoDB starting : pid=65406 port=27017 dbpath=/System/Volumes/Data/data/db 64-bit host=user-MacBook-Pro.local
2020-02-09T20:36:07.672-0500 I CONTROL [initandlisten] db version v4.2.3
2020-02-09T20:36:07.672-0500 I CONTROL [initandlisten] git version: 6874650b362138df74be53d366bbefc321ea32d4
2020-02-09T20:36:07.672-0500 I CONTROL [initandlisten] allocator: system
2020-02-09T20:36:07.672-0500 I CONTROL [initandlisten] modules: none
2020-02-09T20:36:07.672-0500 I CONTROL [initandlisten] build environment:
2020-02-09T20:36:07.672-0500 I CONTROL [initandlisten] distarch: x86_64
2020-02-09T20:36:07.672-0500 I CONTROL [initandlisten] target_arch: x86_64
2020-02-09T20:36:07.672-0500 I CONTROL [initandlisten] options: { storage: { dbPath: "/System/Volumes/Data/data/db" } }
2020-02-09T20:36:07.673-0500 E STORAGE [initandlisten] Failed to set up listener: SocketException: Address already in use
2020-02-09T20:36:07.673-0500 I CONTROL [initandlisten] now exiting
2020-02-09T20:36:07.673-0500 I CONTROL [initandlisten] shutting down with code:48
I tried running:
sudo chown -Rv user /System/Volumes/Data/data/db
mongod
Then received the following:
2020-02-09T20:36:52.247-0500 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-02-09T20:36:52.249-0500 I CONTROL [initandlisten] MongoDB starting : pid=65410 port=27017 dbpath=/data/db 64-bit host=user-MacBook-Pro.local
2020-02-09T20:36:52.249-0500 I CONTROL [initandlisten] db version v4.2.3
2020-02-09T20:36:52.249-0500 I CONTROL [initandlisten] git version: 6874650b362138df74be53d366bbefc321ea32d4
2020-02-09T20:36:52.249-0500 I CONTROL [initandlisten] allocator: system
2020-02-09T20:36:52.249-0500 I CONTROL [initandlisten] modules: none
2020-02-09T20:36:52.249-0500 I CONTROL [initandlisten] build environment:
2020-02-09T20:36:52.249-0500 I CONTROL [initandlisten] distarch: x86_64
2020-02-09T20:36:52.249-0500 I CONTROL [initandlisten] target_arch: x86_64
2020-02-09T20:36:52.249-0500 I CONTROL [initandlisten] options: {}
2020-02-09T20:36:52.250-0500 E STORAGE [initandlisten] Failed to set up listener: SocketException: Address already in use
2020-02-09T20:36:52.250-0500 I CONTROL [initandlisten] now exiting
2020-02-09T20:36:52.250-0500 I CONTROL [initandlisten] shutting down with code:48
For the SocketException, I tried:
mongod --port 27018
And received:
2020-02-09T20:37:39.191-0500 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-02-09T20:37:39.195-0500 I CONTROL [initandlisten] MongoDB starting : pid=65414 port=27018 dbpath=/data/db 64-bit host=user-MacBook-Pro.local
2020-02-09T20:37:39.195-0500 I CONTROL [initandlisten] db version v4.2.3
2020-02-09T20:37:39.195-0500 I CONTROL [initandlisten] git version: 6874650b362138df74be53d366bbefc321ea32d4
2020-02-09T20:37:39.195-0500 I CONTROL [initandlisten] allocator: system
2020-02-09T20:37:39.195-0500 I CONTROL [initandlisten] modules: none
2020-02-09T20:37:39.195-0500 I CONTROL [initandlisten] build environment:
2020-02-09T20:37:39.195-0500 I CONTROL [initandlisten] distarch: x86_64
2020-02-09T20:37:39.195-0500 I CONTROL [initandlisten] target_arch: x86_64
2020-02-09T20:37:39.195-0500 I CONTROL [initandlisten] options: { net: { port: 27018 } }
2020-02-09T20:37:39.196-0500 I STORAGE [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating
2020-02-09T20:37:39.196-0500 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2020-02-09T20:37:39.196-0500 I - [initandlisten] Stopping further Flow Control ticket acquisitions.
2020-02-09T20:37:39.196-0500 I CONTROL [initandlisten] now exiting
2020-02-09T20:37:39.196-0500 I CONTROL [initandlisten] shutting down with code:100
I just can't seem to figure out what's going on, since I've just been following all the steps I've found on StackOverflow from other people with this exact issue.
After doing some more research and viewing the comments above, it appears that when installing MongoDB through homebrew you will use the following commands:
brew services start mongodb-community
Then in a new tab:
mongo
This will start mongo successfully. I'm still not 100% sure why mongod kicks back errors, but for all I know, the above works.
I am trying to start working with MongoDB but when I write the mongod command I get this error
2019-10-20T23:26:41.054-0500 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2019-10-20T23:26:41.062-0500 I CONTROL [initandlisten] MongoDB starting : pid=4724 port=27017 dbpath=/data/db 64-bit host=MacBook-Pro-de-Andres.local
2019-10-20T23:26:41.062-0500 I CONTROL [initandlisten] db version v4.2.0
2019-10-20T23:26:41.062-0500 I CONTROL [initandlisten] git version: a4b751dcf51dd249c5865812b390cfd1c0129c30
2019-10-20T23:26:41.062-0500 I CONTROL [initandlisten] allocator: system
2019-10-20T23:26:41.062-0500 I CONTROL [initandlisten] modules: enterprise
2019-10-20T23:26:41.062-0500 I CONTROL [initandlisten] build environment:
2019-10-20T23:26:41.062-0500 I CONTROL [initandlisten] distarch: x86_64
2019-10-20T23:26:41.062-0500 I CONTROL [initandlisten] target_arch: x86_64
2019-10-20T23:26:41.062-0500 I CONTROL [initandlisten] options: {}
2019-10-20T23:26:41.064-0500 E STORAGE [initandlisten] Failed to set up listener: SocketException: Address already in use
2019-10-20T23:26:41.064-0500 I CONTROL [initandlisten] now exiting
2019-10-20T23:26:41.064-0500 I CONTROL [initandlisten] shutting down with code:48
It is a problem with your port number. Since your default port number 27017 is already allocated to mongodb, this error occurs.
In this case, You can do two things.
you can stop the mongodb process and run mongod. Either you can run
mongod in a different port.
mongod --port PORT_NUMBER
port number can be 27018 or any number you wish.
Hope you can fix your issue
I am start working with mongoDB recent and get this issue again and again. I think i miss something but not get exactly where is the issue.I am working on a latest mongo db version 4.0.1.
iron#iron-System-Product-Name:/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/codesnippets$ sudo mongod --dbpath db
2018-08-24T09:30:26.351+0530 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2018-08-24T09:30:26.354+0530 I CONTROL [initandlisten] MongoDB starting : pid=5994 port=27017 dbpath=db 64-bit host=iron-System-Product-Name
2018-08-24T09:30:26.354+0530 I CONTROL [initandlisten] db version v4.0.1
2018-08-24T09:30:26.354+0530 I CONTROL [initandlisten] git version: 54f1582fc6eb01de4d4c42f26fc133e623f065fb
2018-08-24T09:30:26.354+0530 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016
2018-08-24T09:30:26.354+0530 I CONTROL [initandlisten] allocator: tcmalloc
2018-08-24T09:30:26.354+0530 I CONTROL [initandlisten] modules: none
2018-08-24T09:30:26.354+0530 I CONTROL [initandlisten] build environment:
2018-08-24T09:30:26.354+0530 I CONTROL [initandlisten] distmod: ubuntu1604
2018-08-24T09:30:26.354+0530 I CONTROL [initandlisten] distarch: x86_64
2018-08-24T09:30:26.354+0530 I CONTROL [initandlisten] target_arch: x86_64
2018-08-24T09:30:26.354+0530 I CONTROL [initandlisten] options: { storage: { dbPath: "db" } }
2018-08-24T09:30:26.354+0530 E STORAGE [initandlisten] Failed to set up listener: SocketException: Address already in use
2018-08-24T09:30:26.354+0530 I CONTROL [initandlisten] now exiting
2018-08-24T09:30:26.354+0530 I CONTROL [initandlisten] shutting down with code:48
sudo lsof -iTCP -sTCP:LISTEN -n -P
sudo kill <mongo_command_pid>
mongod
Try these three commands and you will surely get out of it.
I'm testing learning locker which is based on MongoDB it's all inside a ubuntu14.04 docker https://hub.docker.com/r/hadyrashwan/learninglocker-ubuntu14.04/ . I got it to work but I can't start Mongodb automatically tried the repair command and changing the name in start service command to Mongodb or mongo but not working. but running Mongodb just make it start but I want to start it automatically not opening a terminal and leave it open so the system continues to work
root#bd1997365c3a:/# mongodb
2016-09-06T07:41:51.816+0000 I CONTROL [initandlisten] MongoDB starting : pid=197 port=27017 dbpath=/data/db 64-bit host=bd1997365c3a
2016-09-06T07:41:51.817+0000 I CONTROL [initandlisten] db version v3.2.9
2016-09-06T07:41:51.817+0000 I CONTROL [initandlisten] git version: 22ec9e93b40c85fc7cae7d56e7d6a02fd811088c
2016-09-06T07:41:51.817+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014
2016-09-06T07:41:51.817+0000 I CONTROL [initandlisten] allocator: tcmalloc
2016-09-06T07:41:51.817+0000 I CONTROL [initandlisten] modules: none
2016-09-06T07:41:51.817+0000 I CONTROL [initandlisten] build environment:
2016-09-06T07:41:51.817+0000 I CONTROL [initandlisten] distmod: ubuntu1404
2016-09-06T07:41:51.817+0000 I CONTROL [initandlisten] distarch: x86_64
2016-09-06T07:41:51.817+0000 I CONTROL [initandlisten] target_arch: x86_64
2016-09-06T07:41:51.817+0000 I CONTROL [initandlisten] options: {}
2016-09-06T07:41:51.823+0000 I - [initandlisten] Detected data files in /data/db created by the 'mmapv1' storage engine, so setting the active storage engine to 'mmapv1'.
2016-09-06T07:41:51.867+0000 I JOURNAL [initandlisten] journal dir=/data/db/journal
2016-09-06T07:41:51.867+0000 I JOURNAL [initandlisten] recover : no journal files present, no recovery needed
2016-09-06T07:41:52.027+0000 I JOURNAL [durability] Durability thread started
2016-09-06T07:41:52.027+0000 I JOURNAL [journal writer] Journal writer thread started
2016-09-06T07:41:52.101+0000 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2016-09-06T07:41:52.101+0000 I CONTROL [initandlisten]
2016-09-06T07:41:52.102+0000 I CONTROL [initandlisten]
2016-09-06T07:41:52.102+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2016-09-06T07:41:52.102+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2016-09-06T07:41:52.102+0000 I CONTROL [initandlisten]
2016-09-06T07:41:52.102+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2016-09-06T07:41:52.102+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2016-09-06T07:41:52.102+0000 I CONTROL [initandlisten]
2016-09-06T07:41:52.111+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2016-09-06T07:41:52.112+0000 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2016-09-06T07:41:52.112+0000 I NETWORK [initandlisten] waiting for connections on port 27017
If already you install the mongodb just uninstall based on mongodb config
Before going do all stuff first install mongodb server.
sudo apt install mongodb-server
Then continue to install what mongodb config suggest you.
Once done your mongodb configuration you can go
sudo service mongodb start
Note: Its not mongod its mongodb
I had same problem. It seems there is some mis-configuration if you install via source code.
Re-installing mongoDB using apt-get activated mongod as a service for
me.