I have recently updated mongodb on my AWS linux server with
sudo yum install -y mongodb-org
The result was that the mongod command would no longer successfully launch the mongodb server, because I would get an error saying the directory that it does not find the data directory /data/db/, even though in mongodb.conf if says:
storage: dbPath: /var/lib/mongo
and in my init.d/mongod it points to that config file:
So I now have the following questions:
- Why do I now have to manually start mongod with mongod --dbpath /var/lib/mongo. Starting it without the -dbpath option results it in ignoring that path that is stated in /etc/mongod.conf. Why?
- What can I do to make sure that on a reboot it will look in the right data directory again, as it did before I did the update?
- Should I have done something differently when updating instead of sudo yum install -y mongodb-org?