Can't connect to MongoDB
-
The problem happened after I reboot my server by using:
sudo reboot
After I reconnect, I <cd> to the NodeBB dictionary:
cd /home/NodeBB
And then I input:
./nodebb start
And I see the log by typing./nodebb log
I saw this:
I type
mongo
and I met this
I cannot start my server now ,it is 502
Who can help me solve it?
Thanks! -
It sounds like MongoDB was installed but not enabled, so it is not turned on when the server is started.
Can you try running
systemctl start mongod
, and then typemongo
again to verify that it is working?If all's well, then
systemctl enable mongod
to have it set up to turn on automatically. -
Then you need to figure out how you installed MongoDB, and turn it on. That's all.
I can't help you any further because this is a configuration issue, and not with NodeBB itself. Not trying to be mean, I literally just can't help you because I don't know how you set up your server.
-
which mongo
could help you find it -