Question
MEAN One click installation problem with Mongodb
I have just deployed my first droplet using MEAN one click installation. Droplet started off fine and connected with SSH. Now when I try to start the example app as given in the tutorial, it fails to start because it is unable to connect to mongodb.
Here is the error log:
+ Important warning: config.domain is empty. It should be set to the fully qualified domain of the app.
Could not connect to MongoDB!
{ MongoError: failed to connect to server [localhost:27017] on first connect
at Pool.<anonymous> (/opt/mean/node_modules/mongoose/node_modules/mongodb-core/lib/topologies/server.js:313:35)
at emitOne (events.js:96:13)
at Pool.emit (events.js:188:7)
at Connection.<anonymous> (/opt/mean/node_modules/mongoose/node_modules/mongodb-core/lib/connection/pool.js:271:12)
at Connection.g (events.js:291:16)
at emitTwo (events.js:106:13)
at Connection.emit (events.js:191:7)
at Socket.<anonymous> (/opt/mean/node_modules/mongoose/node_modules/mongodb-core/lib/connection/connection.js:165:49)
at Socket.g (events.js:291:16)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at emitErrorNT (net.js:1278:8)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
name: 'MongoError',
message: 'failed to connect to server [localhost:27017] on first connect' }
/usr/bin/nodejs[3525]: ../src/debug-agent.cc:149:void node::debugger::Agent::Stop(): Assertion `(err) == (0)' failed.
1: node::Abort() [node]
2: node::Assert(char const* const (*) [4]) [node]
3: 0x10c1bc2 [node]
4: node::debugger::Agent::~Agent() [node]
5: node::Start(int, char**) [node]
6: __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6]
7: _start [node]
Aborted (core dumped)
[16:12:37] [nodemon] app crashed - waiting for file changes before starting...code
Isn’t MongoDB supposed to be installed out of the box? What am I missing here?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
I used the
apt list --installed
command and didn’t find MongoDB installed. I am installing it now but I believe it should be installed out of the box.Also did a
sudo apt-get update
and got the following report: