Pankaj
Pankaj

Reputation: 2558

Mongo Db data lost

It is development environment, Ubuntu 12.04 . Usually I start my mongodb server using the following command.

sudo mongod --dbpath /data/db/ --fork --logpath /var/log/mongodb.log --logappend

Today I tried starting it using

sudo mongod --fork

and then

sudo mongod --fork --logpath /var/log/mongodb.log --logappend

It was not starting.

Then I gave the full command. Still it did not start.

I realized that the directory /data/db was missing(It was existing till yesterday). So I had to create it, and all my data was lost. Other developers in my team has experienced similar problems earlier. I am not sure why the problem is occurring. Is this not the proper way of starting the server?(Even then the data should not be lost).

How to ensure that this will not repeat on the production environment.

Upvotes: 2

Views: 4768

Answers (1)

Joe
Joe

Reputation: 3160

Are you sure it was lost?

I also thought mine was lost, but I started checking around and found it in the area where you will find the folders:

  • /bin
  • /boot
  • /etc
  • /media
  • ...

Basically, it looks like it exists where "File System" is.

I also see that you're using the "--fork..." command, although I'm not sure it will affect it.

Tell me if you find it where I specified and we can take things from there.

Upvotes: 1

Related Questions