mongod facing with file permission on linux mint - node.js

what is the exact file permission for data/db?
why this problem occurs?
2016-10-18T17:19:28.378+0600 E NETWORK [initandlisten] listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:27017
2016-10-18T17:19:28.378+0600 E NETWORK [initandlisten] addr already in use
2016-10-18T17:19:28.378+0600 E STORAGE [initandlisten] Failed to set up sockets during startup.
2016-10-18T17:19:28.378+0600 I CONTROL [initandlisten] dbexit: rc: 48

Restart your computer and then try again.

Related

Impossible to connect to mongo after server shutdown

I am running a mongo cluster (v 3.4.1) on a remote Ubuntu server. This server had an unexpected shutdown yesterday. Since that, I cannot connect to mongo.
I connected by ssh to the server to check if mongo was running. It seems to be the case because if I use the mongo command, I get the following output:
MongoDB shell version v3.4.2
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.4.1
Server has startup warnings:
2017-09-28T08:01:43.906+0000 I STORAGE [initandlisten]
2017-09-28T08:01:43.906+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2017-09-28T08:01:43.906+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2017-09-28T08:01:44.204+0000 I CONTROL [initandlisten]
2017-09-28T08:01:44.204+0000 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-09-28T08:01:44.204+0000 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2017-09-28T08:01:44.204+0000 I CONTROL [initandlisten]
Now if I run "mongod" I get the exception:
...
2017-09-28T10:10:26.065+0200 I STORAGE [initandlisten] exception in initAndListen: 20 Attempted to create a lock file on a read-only directory: /data/db, terminating
2017-09-28T10:10:26.065+0200 I NETWORK [initandlisten] shutdown: going to close listening sockets...
...
I tried in sudo mode, I got:
...
2017-09-28T10:12:21.857+0200 E NETWORK [initandlisten] listen(): bind() failed Address already in use for socket: 0.0.0.0:27017
2017-09-28T10:12:21.857+0200 E NETWORK [initandlisten] addr already in use
2017-09-28T10:12:21.857+0200 E NETWORK [initandlisten] Failed to set up sockets during startup.
2017-09-28T10:12:21.857+0200 E STORAGE [initandlisten] Failed to set up listener: InternalError: Failed to set up sockets
2017-09-28T10:12:21.857+0200 I NETWORK [initandlisten] shutdown: going to close listening sockets...
...
Which would mean that an instance of mongo is already running...
Then I tried to kill mongo process, either with sudo service mongod stop or sudo pkill mongod or sudo kill <PID> after listing processes with ps -ef | grep mongo. But the process does not disappear from the list (seems that it restarts immediately).
So if I try to run sudo mongod --dbpath /data/db --repair (there is a mongod.lock file in the directory), I still get the error "Address already in use".
Any help would be really appreciated!

bitnami mean does not work using bitnami script

Im using bitnami 3.2.11-0, when I try to start serivce something bad occurs and neither service could be started.
root#ip-172-31-15-96:/home/bitnami/apps/api# sudo service bitnami start
resize2fs 1.42.9 (4-Feb-2014)
The filesystem is already 26212055 blocks long. Nothing to do!
/opt/bitnami/mongodb/scripts/ctl.sh : mongodb could not be started
/opt/bitnami/php/scripts/ctl.sh : php-fpm could not be started
Syntax OK
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
/opt/bitnami/apache2/scripts/ctl.sh : httpd could not be started
/opt/bitnami/var/init/post-start/040_update_ip: 17: /opt/bitnami/var/init/post-start/040_update_ip: /opt/bitnami/apps/*/bnconfig: not found
daemon with PID 1454 awakened
ERROR: child process failed, exited with error number 14
about to fork child process, waiting until server is ready for connections.
forked process: 1559
2017-10-09T21:33:01.815+0000 I CONTROL [main] ***** SERVER RESTARTED *****
2017-10-09T21:33:01.820+0000 I CONTROL [initandlisten] MongoDB starting : pid=1559 port=27017 dbpath=/opt/bitnami/mongodb/data/db 64-bit host=ip-172-31-15-96
2017-10-09T21:33:01.820+0000 I CONTROL [initandlisten] db version v3.2.11
2017-10-09T21:33:01.820+0000 I CONTROL [initandlisten] git version: 009580ad490190ba33d1c6253ebd8d91808923e4
2017-10-09T21:33:01.820+0000 I CONTROL [initandlisten] allocator: tcmalloc
2017-10-09T21:33:01.820+0000 I CONTROL [initandlisten] modules: none
2017-10-09T21:33:01.820+0000 I CONTROL [initandlisten] build environment:
2017-10-09T21:33:01.820+0000 I CONTROL [initandlisten] distarch: x86_64
2017-10-09T21:33:01.820+0000 I CONTROL [initandlisten] target_arch: x86_64
2017-10-09T21:33:01.820+0000 I CONTROL [initandlisten] options: { config: "/opt/bitnami/mongodb/mongodb.conf", net: { bindIp: "127.0.0.1", port: 27017, unixDomainSocket: { filePermissions: 502, pathPrefix: "/opt/bitnami/mongodb/tmp" } }$
2017-10-09T21:33:01.842+0000 I - [initandlisten] Detected data files in /opt/bitnami/mongodb/data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2017-10-09T21:33:01.842+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=sn$
2017-10-09T21:33:02.088+0000 E STORAGE [initandlisten] WiredTiger (1) [1507584782:87985][1559:0x7fb7a2216cc0], file:collection-51-8988087643268075125.wt, WT_SESSION.open_cursor: /opt/bitnami/mongodb/data/db/collection-51-898808764326807$
2017-10-09T21:33:02.088+0000 I - [initandlisten] Invariant failure: ret resulted in status UnknownError: 1: Operation not permitted at src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp 79
2017-10-09T21:33:02.097+0000 I CONTROL [initandlisten]
0x1313f62 0x12be9c8 0x12a6ced 0x10910e4 0x108f9e0 0x108ba02 0x108a40d 0x107afbb 0xfda4b4 0xfe0252 0x1079838 0xf9d4c8 0x96270e 0x964cb0 0x967ebd 0x7fb7a1117f45 0x95f0c9
----- BEGIN BACKTRACE -----
{"backtrace":[{"b":"400000","o":"F13F62","s":"_ZN5mongo15printStackTraceERSo"},{"b":"400000","o":"EBE9C8","s":"_ZN5mongo10logContextEPKc"},{"b":"400000","o":"EA6CED","s":"_ZN5mongo17invariantOKFailedEPKcRKNS_6StatusES1_j"},{"b":"400000",$
mongod(_ZN5mongo15printStackTraceERSo+0x32) [0x1313f62]
mongod(_ZN5mongo10logContextEPKc+0x138) [0x12be9c8]
mongod(_ZN5mongo17invariantOKFailedEPKcRKNS_6StatusES1_j+0xAD) [0x12a6ced]
mongod(_ZN5mongo17WiredTigerSession9getCursorERKSsmb+0xE4) [0x10910e4]
mongod(_ZN5mongo16WiredTigerCursorC1ERKSsmbPNS_16OperationContextE+0x50) [0x108f9e0]
mongod(_ZN5mongo21WiredTigerRecordStore6CursorC1EPNS_16OperationContextERKS0_b+0x92) [0x108ba02]
mongod(_ZN5mongo21WiredTigerRecordStoreC1EPNS_16OperationContextENS_10StringDataES3_SsbbllPNS_14CappedCallbackEPNS_20WiredTigerSizeStorerE+0x3ED) [0x108a40d]
mongod(_ZN5mongo18WiredTigerKVEngine14getRecordStoreEPNS_16OperationContextENS_10StringDataES3_RKNS_17CollectionOptionsE+0x1AB) [0x107afbb]
mongod(_ZN5mongo22KVDatabaseCatalogEntry14initCollectionEPNS_16OperationContextERKSsb+0x204) [0xfda4b4]
mongod(_ZN5mongo15KVStorageEngineC1EPNS_8KVEngineERKNS_22KVStorageEngineOptionsE+0x6D2) [0xfe0252]
mongod(+0xC79838) [0x1079838]
mongod(_ZN5mongo20ServiceContextMongoD29initializeGlobalStorageEngineEv+0x598) [0xf9d4c8]
mongod(+0x56270E) [0x96270e]
mongod(_ZN5mongo13initAndListenEi+0x10) [0x964cb0]
mongod(main+0x15D) [0x967ebd]
libc.so.6(__libc_start_main+0xF5) [0x7fb7a1117f45]
mongod(+0x55F0C9) [0x95f0c9]
----- END BACKTRACE -----
2017-10-09T21:33:02.097+0000 I - [initandlisten]
***aborting after invariant() failure
ERROR: child process failed, exited with error number 14
If I try using bin command it'll run.
root#ip-172-31-15-96:/home/bitnami/apps/api# mongod
2017-10-09T19:13:48.550+0000 I CONTROL [initandlisten] MongoDB starting : pid=15830 port=27017 dbpath=/data/db 64-bit host=ip-172-31-15-96
2017-10-09T19:13:48.550+0000 I CONTROL [initandlisten] db version v3.2.11
2017-10-09T19:13:48.550+0000 I CONTROL [initandlisten] git version: 009580ad490190ba33d1c6253ebd8d91808923e4
2017-10-09T19:13:48.550+0000 I CONTROL [initandlisten] allocator: tcmalloc
2017-10-09T19:13:48.550+0000 I CONTROL [initandlisten] modules: none
2017-10-09T19:13:48.550+0000 I CONTROL [initandlisten] build environment:
2017-10-09T19:13:48.550+0000 I CONTROL [initandlisten] distarch: x86_64
2017-10-09T19:13:48.550+0000 I CONTROL [initandlisten] target_arch: x86_64
2017-10-09T19:13:48.550+0000 I CONTROL [initandlisten] options: {}
2017-10-09T19:13:48.572+0000 I - [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2017-10-09T19:13:48.572+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1G,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-10-09T19:13:48.724+0000 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2017-10-09T19:13:48.724+0000 I CONTROL [initandlisten]
2017-10-09T19:13:48.724+0000 I CONTROL [initandlisten]
2017-10-09T19:13:48.724+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2017-10-09T19:13:48.724+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2017-10-09T19:13:48.724+0000 I CONTROL [initandlisten]
2017-10-09T19:13:48.724+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2017-10-09T19:13:48.724+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2017-10-09T19:13:48.724+0000 I CONTROL [initandlisten]
2017-10-09T19:13:48.725+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2017-10-09T19:13:48.725+0000 I NETWORK [initandlisten] waiting for connections on port 27017
2017-10-09T19:13:48.725+0000 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
Has anyone experienced this before?
In bitnami stacks the following script is used:
sudo /opt/bitnami/ctlscript.sh start
I advise you to use that one but like this
sudo /opt/bitnami/ctlscript.sh restart
Finally i've reinstalled bitnami mean stack using wget.
$ wget https://bitnami.com/redirect/to/159963/bitnami-meanstack-3.4.9-0-linux-x64-installer.run
$ chmod +x ./bitnami-meanstack-3.4.9-0-linux-x64-installer.run
I followed the installer steps and then run $ sudo service bitnami start mongodb.
Thanks.

Mongodb won't start - reason: errno:111 Connection refused

All of a sudden I can't get mongodb to work.
Usually I will start with
mongo
however I get this when trying to start.
MongoDB shell version: 3.0.6
connecting to: test
2016-10-11T15:36:56.462+0100 W NETWORK Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2016-10-11T15:36:56.464+0100 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 haven't updated anything on the server or even logged into it until the website broke. Any ideas why this is happening? I have tried to comment out the bind_ip but I don't get why it would just stop working and failing to start.
I have also tried
sudo service mongo start
mongod start/running, process 1529
Then when I tried -
sudo service mongod status
mongod stop/waiting.
I can't start my nodejs app because it returns
/node_modules/mongoose/node_modules/mongodb/lib/server.js:22‌​8 process.nextTick(function() { throw err; }) ^ Error: connect ECONNREFUSED at exports._errnoException (util.js:746:11) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1010:19)
I think that is because mongodb isn't starting correctly but not sure.
The error produces this
2016-10-11T15:40:30.400+0100 E JOURNAL [initandlisten] Insufficient free space for journal files
2016-10-11T15:40:30.400+0100 I JOURNAL [initandlisten] Please make at least 3379MB available in /var/lib/mongodb/journal or use --smallfiles
2016-10-11T15:40:30.400+0100 I JOURNAL [initandlisten]
2016-10-11T15:40:30.402+0100 I STORAGE [initandlisten] exception in initAndListen: 15926 Insufficient free space for journals, terminating
2016-10-11T15:40:30.402+0100 I CONTROL [initandlisten] now exiting
2016-10-11T15:40:30.402+0100 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2016-10-11T15:40:30.402+0100 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2016-10-11T15:40:30.402+0100 I NETWORK [initandlisten] shutdown: going to flush diaglog...
2016-10-11T15:40:30.402+0100 I NETWORK [initandlisten] shutdown: going to close sockets...
2016-10-11T15:40:30.402+0100 I STORAGE [initandlisten] shutdown: waiting for fs preallocator...
2016-10-11T15:40:30.402+0100 I STORAGE [initandlisten] shutdown: final commit...
2016-10-11T15:40:30.402+0100 I STORAGE [initandlisten] shutdown: closing all files...
2016-10-11T15:40:30.402+0100 I STORAGE [initandlisten] closeAllFiles() finished
2016-10-11T15:40:30.402+0100 I CONTROL [initandlisten] dbexit: rc: 100
2016-10-11T15:45:36.614+0100 I CONTROL ***** SERVER RESTARTED *****
2016-10-11T15:45:36.642+0100 E NETWORK [initandlisten] Failed to unlink socket file /tmp/mongodb-27017.sock errno:1 Operation not permitted
2016-10-11T15:45:36.642+0100 I - [initandlisten] Fatal Assertion 28578
2016-10-11T15:45:36.642+0100 I - [initandlisten]
***aborting after fassert() failure
2016-10-11T15:46:21.636+0100 I CONTROL ***** SERVER RESTARTED *****
2016-10-11T15:46:21.663+0100 E NETWORK [initandlisten] Failed to unlink socket file /tmp/mongodb-27017.sock errno:1 Operation not permitted
2016-10-11T15:46:21.663+0100 I - [initandlisten] Fatal Assertion 28578
2016-10-11T15:46:21.663+0100 I - [initandlisten]
I broswed to that dir and saw this!!! Why are those files so huge?
It seems that your error is similar to this
Removing the /tmp/mongodb-27017.sock file should do the trick.
Also check your disk space, as it seems the process is not starting because you are missing space for the journal files (check #dave-v comment below)
i open file /etc/mongodb.conf and put a # in begin of line bind_ip = 127.0.0.1 (#bind_ip = 127.0.0.1) .Then restart mongodb, it's work fine again !
Warning: If you use mongodb in online server, please don't do that. Hacker can attack for this port !
I faced same issue , solution is here
1) Once the mongo installation done by downloading or yum install
2) Create folder db under /home/scc-dev/data/db/
3)Goto mongo folder under bin , open terminal run the below command
sudo ./mongod dbpath /home/scc-dev/data/db
4)Check few lines command running in the console
5)open new terminal under bin run the below command
sudo ./mongo
6) type command -> show dbs (it should show default dbs like local..) then it is working fine
7) if you get error like Failed to connect to 127.0.0.1:27017, reason: errno: 61 Connection refused then
8) restart the linux m/c command - > /sbin/reboot (do the steps from 3 - issue will be resolved )
To open the any ports in linux m/c
sudo iptables -I INPUT -p tcp -m tcp --dport 27017 -j ACCEPT
sudo iptables-save

Error run mongod

when run command "mongod" in terminal. Cant access localhost:28017
my log
2016-07-08T11:31:15.479-0300 I CONTROL [initandlisten] MongoDB starting : pid=12891 port=27017 dbpath=/data/db 64-bit host=lucaspc
2016-07-08T11:31:15.479-0300 I CONTROL [initandlisten] db version v3.2.7
2016-07-08T11:31:15.479-0300 I CONTROL [initandlisten] git version: 4249c1d2b5999ebbf1fdf3bc0e0e3b3ff5c0aaf2
2016-07-08T11:31:15.479-0300 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014
2016-07-08T11:31:15.479-0300 I CONTROL [initandlisten] allocator: tcmalloc
2016-07-08T11:31:15.479-0300 I CONTROL [initandlisten] modules: none
2016-07-08T11:31:15.479-0300 I CONTROL [initandlisten] build environment:
2016-07-08T11:31:15.480-0300 I CONTROL [initandlisten] distmod: ubuntu1404
2016-07-08T11:31:15.480-0300 I CONTROL [initandlisten] distarch: x86_64
2016-07-08T11:31:15.480-0300 I CONTROL [initandlisten] target_arch: x86_64
2016-07-08T11:31:15.480-0300 I CONTROL [initandlisten] options: {}
2016-07-08T11:31:15.531-0300 E NETWORK [initandlisten] listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:27017
2016-07-08T11:31:15.531-0300 E NETWORK [initandlisten] addr already in use
2016-07-08T11:31:15.531-0300 E STORAGE [initandlisten] Failed to set up sockets during startup.
2016-07-08T11:31:15.531-0300 I CONTROL [initandlisten] dbexit: rc: 48
There is already a process using the interface and port you want to use. You can find out what process that is using
sudo netstat -lpn | grep 27017
Then use
sudo kill <pid>
to stop it
Address already in use for socket: 0.0.0.0:27017
You already have an instance running on port 27017, change the port or kill the existing process.

Can't start mongodb on AWS instance

I have worked on mongodb database. I have installed this in my server & worked on this. But currently I am facing a problem. My mongodb database is not responding. When I am giving this command : mongo
MongoDB shell version: 2.6.10
connecting to: test
2015-07-02T06:22:11.363+0000 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2015-07-02T06:22:11.364+0000 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
I have already delete the lock file, then repair mongodb then restart mongodb. But cant solve my problem.
Here is my mongodb.log file:
2015-07-02T06:30:48.789+0000 [initandlisten] MongoDB starting : pid=5551 port=27017 dbpath=/var/lib/mongodb 64-bit host=ip-172-31-5-213
2015-07-02T06:30:48.789+0000 [initandlisten] db version v2.6.10
2015-07-02T06:30:48.789+0000 [initandlisten] git version: 5901dbfb49d16eaef6f2c2c50fba534d23ac7f6c
2015-07-02T06:30:48.789+0000 [initandlisten] build info: Linux build18.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2015-07-02T06:30:48.789+0000 [initandlisten] allocator: tcmalloc
2015-07-02T06:30:48.789+0000 [initandlisten] options: { config: "/etc/mongod.conf", net: { bindIp: "127.0.0.1" }, storage: { dbPath: "/var/lib/mongodb" }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } }
2015-07-02T06:30:48.800+0000 [initandlisten] journal dir=/var/lib/mongodb/journal
2015-07-02T06:30:48.800+0000 [initandlisten] recover : no journal files present, no recovery needed
2015-07-02T06:30:48.800+0000 [initandlisten]
2015-07-02T06:30:48.800+0000 [initandlisten] ERROR: Insufficient free space for journal files
2015-07-02T06:30:48.800+0000 [initandlisten] Please make at least 3379MB available in /var/lib/mongodb/journal or use --smallfiles
2015-07-02T06:30:48.800+0000 [initandlisten]
2015-07-02T06:30:48.800+0000 [initandlisten] exception in initAndListen: 15926 Insufficient free space for journals, terminating
2015-07-02T06:30:48.800+0000 [initandlisten] dbexit:
2015-07-02T06:30:48.800+0000 [initandlisten] shutdown: going to close listening sockets...
2015-07-02T06:30:48.800+0000 [initandlisten] shutdown: going to flush diaglog...
2015-07-02T06:30:48.800+0000 [initandlisten] shutdown: going to close sockets...
2015-07-02T06:30:48.800+0000 [initandlisten] shutdown: waiting for fs preallocator...
2015-07-02T06:30:48.800+0000 [initandlisten] shutdown: lock for final commit...
2015-07-02T06:30:48.801+0000 [initandlisten] shutdown: final commit...
2015-07-02T06:30:48.801+0000 [initandlisten] shutdown: closing all files...
2015-07-02T06:30:48.801+0000 [initandlisten] closeAllFiles() finished
2015-07-02T06:30:48.801+0000 [initandlisten] journalCleanup...
2015-07-02T06:30:48.801+0000 [initandlisten] removeJournalFiles
2015-07-02T06:30:48.802+0000 [initandlisten] shutdown: removing fs lock...
2015-07-02T06:30:48.803+0000 [initandlisten] dbexit: really exiting now
According to your mongodb.log file:
ERROR: Insufficient free space for journal files
Please make at least 3379MB available in /var/lib/mongodb/journal or use --smallfiles
You don't have enough disk space to start your MongoDB service. MongoDB fails to allocate disk space for its Journal Files.
I can see four possible solutions for your problem:
Add more disk space (cleanup something, or use larger storage). If you're using AWS, you could expand your EBS Storage Space keeping all existing data.
Reduce journal size using --smallfiles key or by setting storage.mmapv1.smallFiles to true.
Disable Journaling using --nojournal key or by setting storage.journal.enabled to false (not recommended).
Upgrade your MongoDB to 3.x and change your storage engine to WiredTiger, it'll reduce your overall database size and free some disk space. But you'll need additional disk space for data migration.
Error has been rised typically it was mongodb crash.
Solution :
sudo rm /var/lib/mongodb/mongod.lock
sudo service mongod restart
sudo service mongod stop
sudo service mongod start

Resources