mongodb always down
-
@Jop-V.
It's ubuntu 14.04.
By the way, what's your average CPU usage at peak time or the moment you restart your server? Every time I restart my server, it's a terrible thing, the server failed to response for about several minutes. During that time, nodebb, nginx and mongo eats up the CPU. -
@xidui are you using multiple processes with a reverse proxy?
-
I got mongodb installed. I had no issues with it, except when my server restarts, it won't start... but I know why, I have an NFS share to another (smaller, but bigger storage) server for storage and it tries to start without the mount... something for me to look into.
But other than that, I had no issue, where mongodb would stop randomly.
-
@Adam-Poniatowski You may need a file
/etc/systemd/system/mongod.service
[Unit] Description=High-performance, schema-free document-oriented database After=network.target [Service] User=mongodb ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf [Install] WantedBy=multi-user.target
For Ubuntu 16.10... as Ubuntu no longer uses Upstart
-
@julian Thanks for that I use centos 7 though, but luckily they both use systemd, so that is fine with me.
I will try this out, hopefully it won't do the same thing as what it currently does... fails to start, because the nfs share is not mounted yet lol
Do you think I might need this:
RequiresMountsFor=/path/to/mount/ ? just in case... and my nodebb.service I just add: Requires=mongod.service ... or will this not automatically start?
-
@Adam-Poniatowski
Trysystemctl enable mongod
if you use Centos7.
It will link some scripts to the upstart dir. -
@xidui I mainly use systemctl because mongodb has a systemvinit script, it generates one (mongod.service), which I have to disable and enable again (with the new mongod.service file) to make the symlink files and I can start it. the problem is, it starts up before my nfs mount...
-
@Jop-V. MongoDB is a better option than Redis due to the high memory requirements of Redis. Most communities I know use mongo including this community.
Any case you want to convert, NodeBB core team can get it done for you for a price. Contact [email protected]