Unable to start mongdb - mongodb

2017-05-11T12:03:49.700+0530 I CONTROL [initandlisten] MongoDB starting : pid=5716 port=27017 dbpath=/data/db/ 64-bit host=localhost
2017-05-11T12:03:49.700+0530 I CONTROL [initandlisten] db version v3.2.0
2017-05-11T12:03:49.700+0530 I CONTROL [initandlisten] git version: 45d947729a0315accb6d4f15a6b06be6d9c19fe7
2017-05-11T12:03:49.700+0530 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014
2017-05-11T12:03:49.700+0530 I CONTROL [initandlisten] allocator: tcmalloc
2017-05-11T12:03:49.700+0530 I CONTROL [initandlisten] modules: none
2017-05-11T12:03:49.700+0530 I CONTROL [initandlisten] build environment:
2017-05-11T12:03:49.700+0530 I CONTROL [initandlisten] distmod: ubuntu1404
2017-05-11T12:03:49.700+0530 I CONTROL [initandlisten] distarch: x86_64
2017-05-11T12:03:49.700+0530 I CONTROL [initandlisten] target_arch: x86_64
2017-05-11T12:03:49.700+0530 I CONTROL [initandlisten] options: { storage: { dbPath: "/data/db/" } }
2017-05-11T12:03:49.724+0530 E NETWORK [initandlisten] Failed to unlink socket file /tmp/mongodb-27017.sock errno:1 Operation not permitted
2017-05-11T12:03:49.724+0530 I - [initandlisten] Fatal Assertion 28578
2017-05-11T12:03:49.724+0530 I - [initandlisten]
***aborting after fassert() failure`enter code here`
I am not able to start Mongodb server i tried using service as well and using --dbpath as well i don't know what is the issue. i tried to delete journal files as well but that didn't work

Try to delete the file /tmp/mongodb-27017.sock manually and restart the process.

Have you tried starting it with Sudo from the terminal like so
sudo mongod
this will require your system username and password

Related

My MongoDB isnt working when I type mongod in the terminal

I type in mongod to create a new db but I get this error, any idea what's going on here?
mongod
2018-08-28T18:06:36.824+0100 I CONTROL [initandlisten] MongoDB starting : pid=41812 port=27017 dbpath=/data/db 64-bit host=Ruairidhs-MacBook-Pro.local
2018-08-28T18:06:36.825+0100 I CONTROL [initandlisten] db version v3.6.3
2018-08-28T18:06:36.825+0100 I CONTROL [initandlisten] git version: 9586e557d54ef70f9ca4b43c26892cd55257e1a5
2018-08-28T18:06:36.825+0100 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2n 7 Dec 2017
2018-08-28T18:06:36.825+0100 I CONTROL [initandlisten] allocator: system
2018-08-28T18:06:36.825+0100 I CONTROL [initandlisten] modules: none
2018-08-28T18:06:36.825+0100 I CONTROL [initandlisten] build environment:
2018-08-28T18:06:36.825+0100 I CONTROL [initandlisten] distarch: x86_64
2018-08-28T18:06:36.825+0100 I CONTROL [initandlisten] target_arch: x86_64
2018-08-28T18:06:36.825+0100 I CONTROL [initandlisten] options: {}
2018-08-28T18:06:36.825+0100 I STORAGE [initandlisten] exception in initAndListen: DBPathInUse: Unable to lock the lock file: /data/db/mongod.lock (Resource temporarily unavailable). Another mongod instance is already running on the /data/db directory, terminating
2018-08-28T18:06:36.825+0100 I CONTROL [initandlisten] now exiting
2018-08-28T18:06:36.825+0100 I CONTROL [initandlisten] shutting down with code:100
Open a new terminal window, and execute top, according to the error, you already have an instance of mongod running, so you need to find it and terminate it.

Create admin user MongoDB not possible

When I am trying to follow the tutorial by typing
mongod --port 27017 --dbpath /data/db1
console responds with
C:\WINDOWS\system32>mongod --port 27017 --dbpath /data/db1
2017-03-03T14:43:54.019+0100 I CONTROL [initandlisten] MongoDB starting : pid=1776 port=27017 dbpath=/data/db1 64-bit host=Tim-V5
2017-03-03T14:43:54.020+0100 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2017-03-03T14:43:54.021+0100 I CONTROL [initandlisten] db version v3.4.2
2017-03-03T14:43:54.021+0100 I CONTROL [initandlisten] git version: 3f76e40c105fc223b3e5aac3e20dcd026b83b38b
2017-03-03T14:43:54.022+0100 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1u-fips 22 Sep 2016
2017-03-03T14:43:54.023+0100 I CONTROL [initandlisten] allocator: tcmalloc
2017-03-03T14:43:54.023+0100 I CONTROL [initandlisten] modules: none
2017-03-03T14:43:54.023+0100 I CONTROL [initandlisten] build environment:
2017-03-03T14:43:54.023+0100 I CONTROL [initandlisten] distmod: 2008plus-ssl
2017-03-03T14:43:54.024+0100 I CONTROL [initandlisten] distarch: x86_64
2017-03-03T14:43:54.024+0100 I CONTROL [initandlisten] target_arch: x86_64
2017-03-03T14:43:54.025+0100 I CONTROL [initandlisten] options: { net: { port: 27017 }, storage: { dbPath: "/data/db1" } }
2017-03-03T14:43:54.025+0100 I STORAGE [initandlisten] exception in initAndListen: 29 Data directory /data/db1 not found., terminating
2017-03-03T14:43:54.026+0100 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2017-03-03T14:43:54.026+0100 I NETWORK [initandlisten] shutdown: going to flush diaglog...
2017-03-03T14:43:54.027+0100 I CONTROL [initandlisten] now exiting
2017-03-03T14:43:54.027+0100 I CONTROL [initandlisten] shutting down with code:100
Even I already have created folder with
mkdir C:\data\db
and checked that it exists!
Following with
mongo --port 27017
It responds with
MongoDB shell version v3.4.2
connecting to: mongodb://127.0.0.1:27017/
MongoDB server version: 3.4.2
Server has startup warnings:
2017-03-03T10:02:59.647+0100 I CONTROL [initandlisten]
2017-03-03T10:02:59.647+0100 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-03-03T10:02:59.647+0100 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2017-03-03T10:02:59.647+0100 I CONTROL [initandlisten]
I am using windows 10, how can I solve this? It's rather frustating

Trouble Starting MongoDB (Mac) - Code: 100

I installed MongoDB via Homebrew and seem to be having some trouble starting when I run the mongod command. I have tried setting a up the data/db directory correctly and viewed a few other answers on stackoverflow, but haven't been able to figure this out. Here is what I keep getting (sorry I am new to this):
2017-01-02T23:45:53.444-0500 I CONTROL [initandlisten] MongoDB starting : pid=1419 port=27017 dbpath=/data/db 64-bit host=Johns-MacBook-Pro-3.local
2017-01-02T23:45:53.445-0500 I CONTROL [initandlisten] db version v3.4.0
2017-01-02T23:45:53.445-0500 I CONTROL [initandlisten] git version: f4240c60f005be757399042dc12f6addbc3170c1
2017-01-02T23:45:53.445-0500 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2j 26 Sep 2016
2017-01-02T23:45:53.445-0500 I CONTROL [initandlisten] allocator: system
2017-01-02T23:45:53.445-0500 I CONTROL [initandlisten] modules: none
2017-01-02T23:45:53.445-0500 I CONTROL [initandlisten] build environment:
2017-01-02T23:45:53.445-0500 I CONTROL [initandlisten] distarch: x86_64
2017-01-02T23:45:53.445-0500 I CONTROL [initandlisten] target_arch: x86_64
2017-01-02T23:45:53.445-0500 I CONTROL [initandlisten] options: {}
2017-01-02T23:45:53.446-0500 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=7680M,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2017-01-02T23:45:53.447-0500 E STORAGE [initandlisten] WiredTiger error (2) [1483418753:447985][1419:0x7fffe84c03c0], file:WiredTiger.wt, connection: /data/db/WiredTiger.wt: handle-open: open: No such file or directory
2017-01-02T23:45:53.457-0500 I - [initandlisten] Assertion: 28595:2: No such file or directory src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 267
2017-01-02T23:45:53.458-0500 I STORAGE [initandlisten] exception in initAndListen: 28595 2: No such file or directory, terminating
2017-01-02T23:45:53.458-0500 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2017-01-02T23:45:53.458-0500 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2017-01-02T23:45:53.458-0500 I NETWORK [initandlisten] shutdown: going to flush diaglog...
2017-01-02T23:45:53.458-0500 I CONTROL [initandlisten] now exiting
2017-01-02T23:45:53.458-0500 I CONTROL [initandlisten] shutting down with code:100
Just create directory - /data/db/ on system hdd
This worked for me: sudo mongod --dbpath ~/data/db

MongoDB server getting disconnected

I am getting the following error while running mongod in the terminal(Ubuntu 16.04 LTS).
2016-08-16T13:32:14.690+0530 I CONTROL [initandlisten] MongoDB starting: pid=4810 port=27017 dbpath=/data/db 64-bit host=Rohan
2016-08-16T13:32:14.690+0530 I CONTROL [initandlisten] db version v3.2.8
2016-08-16T13:32:14.690+0530 I CONTROL [initandlisten] git version:ed70e33130c977bda0024c125b56d159573dbaf0
2016-08-16T13:32:14.690+0530 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2g-fips 1 Mar 2016
2016-08-16T13:32:14.690+0530 I CONTROL [initandlisten] allocator: tcmalloc
2016-08-16T13:32:14.690+0530 I CONTROL [initandlisten] modules: none
2016-08-16T13:32:14.690+0530 I CONTROL [initandlisten] build environment:
2016-08-16T13:32:14.690+0530 I CONTROL [initandlisten] distmod: ubuntu1604
2016-08-16T13:32:14.690+0530 I CONTROL [initandlisten] distarch: x86_64
2016-08-16T13:32:14.690+0530 I CONTROL [initandlisten] target_arch: x86_64
2016-08-16T13:32:14.690+0530 I CONTROL [initandlisten] options: {}
2016-08-16T13:32:14.717+0530 E NETWORK [initandlisten] Failed to unlink socket file /tmp/mongodb-27017.sock errno:1 Operation not permitted
2016-08-16T13:32:14.717+0530 I - [initandlisten] Fatal Assertion 28578
2016-08-16T13:32:14.717+0530 I - [initandlisten]
***aborting after fassert() failure
Why is this happening?
I have fixed this issue myself, by deleting the mongodb-27017.sock file . I ran the service after deleting this file, which worked fine. However, I am still not sure the root cause of the issue. The output of the command ls - lat /tmp/mongodb-27017.sock is now
srwx------ 1 mongodb nogroup 0 Apr 23 06:24 /tmp/mongodb-27017.sock

"mongod" execution terminates immediately

Error that i cant figure out as Im new to using mongoDB... it says that data/db not found and then it terminates..... Do I need to create this folder?
2016-01-27T18:14:41.788+0000 I CONTROL [initandlisten] MongoDB starting : pid=8556 port=27017 dbpath=C:\data\db\ 64-bit host=andrews-hp
2016-01-27T18:14:41.796+0000 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2016-01-27T18:14:41.800+0000 I CONTROL [initandlisten] db version v3.2.1
2016-01-27T18:14:41.803+0000 I CONTROL [initandlisten] git version: a14d55980c2cdc565d4704a7e3ad37e4e535c1b2
2016-01-27T18:14:41.808+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1p-fips 9 Jul 2015
2016-01-27T18:14:41.813+0000 I CONTROL [initandlisten] allocator: tcmalloc
2016-01-27T18:14:41.817+0000 I CONTROL [initandlisten] modules: none
2016-01-27T18:14:41.820+0000 I CONTROL [initandlisten] build environment:
2016-01-27T18:14:41.825+0000 I CONTROL [initandlisten] distmod: 2008plus-ssl
2016-01-27T18:14:41.830+0000 I CONTROL [initandlisten] distarch: x86_64
2016-01-27T18:14:41.834+0000 I CONTROL [initandlisten] target_arch: x86_64
2016-01-27T18:14:41.837+0000 I CONTROL [initandlisten] options: {}
2016-01-27T18:14:41.842+0000 I STORAGE [initandlisten] exception in initAndListen: 29 Data directory C:\data\db\ not found., terminating
2016-01-27T18:14:41.849+0000 I CONTROL [initandlisten] dbexit: rc: 100
Yes you do, I have it under C:.
C:\data\db