When I type node server.js
it returns me this error
MongoError: failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]
at Pool.<anonymous> (/home/islam/workspace/project/node_modules/mongoose/node_modules/mongodb-core/lib/topologies/server.js:327:35)
at emitOne (events.js:96:13)
at Pool.emit (events.js:191:7)
at Connection.<anonymous> (/home/islam/workspace/project/node_modules/mongoose/node_modules/mongodb-core/lib/connection/pool.js:274:12)
at Object.onceWrapper (events.js:293:19)
at emitTwo (events.js:106:13)
at Connection.emit (events.js:194:7)
at Socket.<anonymous> (/home/islam/workspace/project/node_modules/mongoose/node_modules/mongodb-core/lib/connection/connection.js:177:49)
at Object.onceWrapper (events.js:293:19)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at emitErrorNT (net.js:1283:8)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
**
When I type in command line mongod
it returns me this
2017-05-05T23:33:06.816+0600 I CONTROL [initandlisten] MongoDB starting : pid=24805 port=27017 dbpath=/data/db 64-bit host=user
2017-05-05T23:33:06.816+0600 I CONTROL [initandlisten] db version v3.4.4
2017-05-05T23:33:06.816+0600 I CONTROL [initandlisten] git version: 888390515874a9debd1b6c5d36559ca86b44babd
2017-05-05T23:33:06.816+0600 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016
2017-05-05T23:33:06.816+0600 I CONTROL [initandlisten] allocator: tcmalloc
2017-05-05T23:33:06.816+0600 I CONTROL [initandlisten] modules: none
2017-05-05T23:33:06.816+0600 I CONTROL [initandlisten] build environment:
2017-05-05T23:33:06.816+0600 I CONTROL [initandlisten] distmod: ubuntu1604
2017-05-05T23:33:06.816+0600 I CONTROL [initandlisten] distarch: x86_64
2017-05-05T23:33:06.816+0600 I CONTROL [initandlisten] target_arch: x86_64
2017-05-05T23:33:06.816+0600 I CONTROL [initandlisten] options: {}
2017-05-05T23:33:06.816+0600 I STORAGE [initandlisten] exception in initAndListen: 29 Data directory /data/db not found., terminating
2017-05-05T23:33:06.816+0600 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2017-05-05T23:33:06.816+0600 I NETWORK [initandlisten] shutdown: going to flush diaglog...
2017-05-05T23:33:06.816+0600 I CONTROL [initandlisten] now exiting
2017-05-05T23:33:06.816+0600 I CONTROL [initandlisten] shutting down with code:100
**
However the mongo
command gives me this error
MongoDB shell version v3.4.4
connecting to: mongodb://127.0.0.1:27017
2017-05-05T23:34:21.724+0600 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused
2017-05-05T23:34:21.724+0600 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:237:13
@(connect):1:6
exception: connect failed
I need to access to my database collections,
Any help will be appreciated!
via Islam Nurdin
No comments:
Post a Comment