I suddenly cannot connect to my database! This issue occurred out of nowhere just the other day and I have not been able to figure out why.
I have pm2 processes running that are using the database and are working correctly. However, if I restart one of the process's, it will stop working with the database. This and the fact that I am unable to connect through atlas/compass are my issues.
I did recently start a mastodon on my VPS which could be (I think it is) the reason why my mongodb has encountered issues. I messed with a lot of different settings including some port stuff; I think this is where my issue may lie.
A friend of mine believes this is a port issue so he had me enable the default mongo port (27017) with ufw using the commands below:
sudo ufw allow 27017
sudo ufw allow 27017/tcp
After some in depth research, I have not yet been able to find an answer to this issue; I am praying someone here may be of help.
My mongo.conf
file has not changed at all and can the start of it can be seen below:
# mongodb.conf
# Where to store the data.
dbpath=/var/lib/mongodb
#where to log
logpath=/var/log/mongodb/mongodb.log
logappend=true
bind_ip = 127.0.0.1,23.29.118.167
port = 27017
# Enable journaling, http://www.mongodb.org/display/DOCS/Journaling
journal=true
# Enables periodic logging of CPU utilization and I/O wait
#cpu = true
# Turn on/off security. Off is currently the default
#noauth = true
auth = true