You got Address already in use. You have another process, probably another mongod, listening to the same port. The commands ps -aef | grep [m]ongod and ss -tlnp can help finding the culprit.
Here is the output, should I just kill the process:
johann@dis002-truservcomm-jhb1-001:/var/lib/mongodb$ ps -aef | grep [m]ongod
root 15977 1 0 13:41 ? 00:00:13 mongod --dbpath=/var/lib/mongodb
johann@dis002-truservcomm-jhb1-001:/var/lib/mongodb$
johann@dis002-truservcomm-jhb1-001:/var/lib/mongodb$ ss -tlnp
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 127.0.0.1:27017 0.0.0.0:*
Thanks.
Damn, I got it started (mongodb) but now the site is still down : https://jcleroux.co.za
The previous guys used monit, what should I check in the config.
Thanks.
I do not know what the purpose of the server but killing it is now the best way to terminate it. If it is safe to terminate the server I would do it with https://docs.mongodb.com/manual/reference/command/shutdown/.
I got 502 Bad Gateway from your nginx server. The site is down but I do not think it is mongo related.
If you say terminate the server, it’s just gracefully shutting down mongodb not deleting it right?
I’m looking into this, the site uses a mongodb to operate and that was what I struggled with, got mongodb up again. Monit was setup, could it be something with monit?
A graceful shutdown is always the preferred method as all the files are closed and all locks removed.
Sorry, I know nothing about monit.
What can I run to "repair " the current mongodb?
Nothing suggest that the current mongod needs to be repaired. You were trying to start a new mongod while another one was already running. By terminating the one already running you are able to start the new one.
Okay, what other options do I have not to fix the website
I would first look in the nginx log files. And then
https://www.google.com/search?q=502+Bad+Gateway+nginx&oq=502+Bad+Gateway++nginx&aqs=chrome..69i57.9174j0j7&sourceid=chrome&ie=UTF-8
Could be running as a reverse proxy. There could then be an app that is not started and/or requires mongod to be running.
This is not an unexpected scenario.
Take a long hard look at monit and decide if you want to keep it or not.