what I did :
went to the database directory and
mongod --dbpath .
then I got this:
2017-02-16T23:51:51.965+0800 I CONTROL [initandlisten] MongoDB starting : pid=31656 port=27017 dbpath=. 64-bit host=WIN-01604161705
2017-02-16T23:51:51.966+0800 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2017-02-16T23:51:51.968+0800 I CONTROL [initandlisten] db version v3.4.1
2017-02-16T23:51:51.969+0800 I CONTROL [initandlisten] git version: 5e103c4f5583e2566a45d740225dc250baacfbd7
2017-02-16T23:51:51.970+0800 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1t-fips 3 May 2016
2017-02-16T23:51:51.971+0800 I CONTROL [initandlisten] allocator: tcmalloc
2017-02-16T23:51:51.972+0800 I CONTROL [initandlisten] modules: none
2017-02-16T23:51:51.973+0800 I CONTROL [initandlisten] build environment:
2017-02-16T23:51:51.974+0800 I CONTROL [initandlisten] distmod: 2008plus-ssl
2017-02-16T23:51:51.975+0800 I CONTROL [initandlisten] distarch: x86_64
2017-02-16T23:51:51.975+0800 I CONTROL [initandlisten] target_arch: x86_64
2017-02-16T23:51:51.978+0800 I CONTROL [initandlisten] options: { storage: { dbPath: "." } }
2017-02-16T23:51:51.982+0800 I - [initandlisten] Detected data files in . created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2017-02-16T23:51:51.982+0800 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=3519M,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-02-16T23:51:51.992+0800 I - [initandlisten] Assertion: 28595:2: No such file or directory src\mongo\db\storage\wiredtiger\wiredtiger_kv_engine.cpp 267
2017-02-16T23:51:51.992+0800 I STORAGE [initandlisten] exception in initAndListen: 28595 2: No such file or directory, terminating
2017-02-16T23:51:51.993+0800 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2017-02-16T23:51:51.994+0800 I NETWORK [initandlisten] shutdown: going to flush diaglog...
2017-02-16T23:51:51.996+0800 I CONTROL [initandlisten] now exiting
2017-02-16T23:51:51.998+0800 I CONTROL [initandlisten] shutting down with code:100
I don't know what's going on at all.
all that I have done is just common things like revising my files in other directories, merge the branch 'master' into 'b2' using github client.
I doubt that something went wrong when I did the 'merge' operation.
I have tried using git revert to make it roll back, still getting the same error.
Should I reinstall mongodb? I'm doing so.
Related
I'm trying to run mongodb, but typing 'mongod' is giving me the error below, do you know how to fix it?
mongod
2021-05-14T15:12:30.819-0400 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2021-05-14T15:12:30.846-0400 I CONTROL [initandlisten] MongoDB starting : pid=60494 port=27017 dbpath=/data/db 64-bit host=Chris.local
2021-05-14T15:12:30.846-0400 I CONTROL [initandlisten] db version v4.2.3
2021-05-14T15:12:30.846-0400 I CONTROL [initandlisten] git version: 6874650b362138df74be53d366bbefc321ea32d4
2021-05-14T15:12:30.846-0400 I CONTROL [initandlisten] allocator: system
2021-05-14T15:12:30.846-0400 I CONTROL [initandlisten] modules: none
2021-05-14T15:12:30.846-0400 I CONTROL [initandlisten] build environment:
2021-05-14T15:12:30.846-0400 I CONTROL [initandlisten] distarch: x86_64
2021-05-14T15:12:30.846-0400 I CONTROL [initandlisten] target_arch: x86_64
2021-05-14T15:12:30.846-0400 I CONTROL [initandlisten] options: {}
2021-05-14T15:12:30.848-0400 I STORAGE [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating
2021-05-14T15:12:30.849-0400 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2021-05-14T15:12:30.849-0400 I - [initandlisten] Stopping further Flow Control ticket acquisitions.
2021-05-14T15:12:30.849-0400 I CONTROL [initandlisten] now exiting
2021-05-14T15:12:30.849-0400 I CONTROL [initandlisten] shutting down with code:100
Log file usually contains the clue to debug
You can see in the log
2021-05-14T15:12:30.848-0400 I STORAGE [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating
The directory /data/db is not found, you need to create this directory and make sure mongod has write permission to this folder.
My MongoDB server was running fine until yesterday. But then I encountered this error:
2020-03-31T10:21:25.981+0530 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-03-31T10:21:25.986+0530 I CONTROL [initandlisten] MongoDB starting : pid=7544 port=27017 dbpath=C:\data\db\ 64-bit host=DESKTOP-IP084D8
2020-03-31T10:21:25.987+0530 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2020-03-31T10:21:25.987+0530 I CONTROL [initandlisten] db version v4.2.3
2020-03-31T10:21:25.987+0530 I CONTROL [initandlisten] git version: 6874650b362138df74be53d366bbefc321ea32d4
2020-03-31T10:21:25.987+0530 I CONTROL [initandlisten] allocator: tcmalloc
2020-03-31T10:21:25.987+0530 I CONTROL [initandlisten] modules: none
2020-03-31T10:21:25.987+0530 I CONTROL [initandlisten] build environment:
2020-03-31T10:21:25.987+0530 I CONTROL [initandlisten] distmod: 2012plus
2020-03-31T10:21:25.987+0530 I CONTROL [initandlisten] distarch: x86_64
2020-03-31T10:21:25.987+0530 I CONTROL [initandlisten] target_arch: x86_64
2020-03-31T10:21:25.988+0530 I CONTROL [initandlisten] options: {}
2020-03-31T10:21:25.990+0530 I STORAGE [initandlisten] exception in initAndListen: NonExistentPath: Data directory C:\data\db\ not found., terminating
2020-03-31T10:21:25.990+0530 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2020-03-31T10:21:25.990+0530 I - [initandlisten] Stopping further Flow Control ticket acquisitions.
2020-03-31T10:21:25.990+0530 I CONTROL [initandlisten] now exiting
2020-03-31T10:21:25.991+0530 I CONTROL [initandlisten] shutting down with code:100
I do not know how the data path got changed. I have to change the MongoDB data path from C:\data\db\ to C:\Program Files\MongoDB\Server\4.2\data, so I tried changing it using the following command, but it doesn't recognize the path:
mongod --dbpath C:\Program Files\MongoDB\Server\4.2\data
What should be the format of the path to be entered here?
Use CMD as a system administrator and type
mongod --dbpath C:\myfolder\myproj\data\db"
I'm trying to build a simple CRUD app with a MEAN stack, here's my file tree so far:
-app
-node_modules
-server
-config
-db.js
-controllers
-user.api.js
-models
-user.js
-routes
-api.js
-web.js
-package.json
-server.js
When running mongod I got the following error:
2017-12-03T15:25:53.243-0500 I CONTROL [initandlisten] MongoDB starting : pid=57220 port=27017 dbpath=/data/db 64-bit host=Carloss-MacBook-Pro.local
2017-12-03T15:25:53.244-0500 I CONTROL [initandlisten] db version v3.4.10
2017-12-03T15:25:53.244-0500 I CONTROL [initandlisten] git version: 078f28920cb24de0dd479b5ea6c66c644f6326e9
2017-12-03T15:25:53.244-0500 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2m 2 Nov 2017
2017-12-03T15:25:53.244-0500 I CONTROL [initandlisten] allocator: system
2017-12-03T15:25:53.244-0500 I CONTROL [initandlisten] modules: none
2017-12-03T15:25:53.244-0500 I CONTROL [initandlisten] build environment:
2017-12-03T15:25:53.244-0500 I CONTROL [initandlisten] distarch: x86_64
2017-12-03T15:25:53.244-0500 I CONTROL [initandlisten] target_arch: x86_64
2017-12-03T15:25:53.244-0500 I CONTROL [initandlisten] options: {}
2017-12-03T15:25:53.247-0500 I STORAGE [initandlisten] exception in initAndListen: 29 Data directory /data/db not found., terminating
2017-12-03T15:25:53.247-0500 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2017-12-03T15:25:53.247-0500 I NETWORK [initandlisten] shutdown: going to flush diaglog...
2017-12-03T15:25:53.247-0500 I CONTROL [initandlisten] now exiting
2017-12-03T15:25:53.247-0500 I CONTROL [initandlisten] shutting down with code:100
So I tried to specify the path of my folder to /server/config/db but that still didn't work. Am I writing the path incorrectly?
This is what I have in my db file:
var mongoose = require('mongoose');
var connection = mongoose.connect('mongodb://localhost/mean_db');
module.exports = connection;
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
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