All in One, Easy to understand – production ready guide for beginners and professionals.
NodeJS, MongoDB, PM2 and NGINX installation and configuration for production server — ubuntu 16.04
@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
[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?
systemctl 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...
Is there any way to convert a MongoDB database to Redis? Maybe that could fix it for @xidui.
@xidui they don't deal with it coz they don't have that issue. Check mongo logs if there is anything there.
@xidui just a friendly offer here. Maybe you want someone to host your Mongo database (PM me). Otherwise I suggest to scale horizontatally. Meaning to have a seperate machine for all your tasks.
@pichalite the only reason to use MongoDB is a financial one. Meaning that you cannot afford more RAM. However, considering you want to achieve the best UX you want to target the greatest speed possible. Therefore Redis should always be your first choice. Especially as it could be replaced by SSDB for example. A drop in replacement for Redis.