Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails - Where MongoDB (Mongoid) stores db and logs?

I am new to MongoDB and Mongoid and I am using Debian testing(jessie/sid).

When I open /etc/mongodb.conf there is no information about where Mongoid stores db and logs.

It just mentions logpath=/var/log/mongodb/mongodb.log

Also in config/mongoid.yml there is no useful info:

development:
  sessions:
    default:
      hosts:
        - localhost:27017
      database: project_development

How to locate project_development db on disk and logs for that db? Is there a settings somewhere for that?

like image 264
nothing-special-here Avatar asked Jun 16 '13 10:06

nothing-special-here


People also ask

Where are MongoDB logs stored?

MongoDB logs can be found in the MongoDB log files at /var/log/mongodb/mongodb. log. If you can't find the log files from this location, you can check the mongodb.

How MongoDB stores the data?

MongoDB stores the data on the disk as BSON in your data path directory, which is usually /data/db. There should be two files per collection there, collection. 0, which stores the data (and that integer is then incremented as needs be) and collection. ns which stores the namespacing metadata for the collection.

Can you use MongoDB with Ruby on Rails?

Read More: How to install and use MongoDB with Rails 6Create a new rails application to use Ruby MongoDB. Make sure that you add –skip-active-record. If you notice, there is no database. yml and no sqlite3 gem is added automatically.


2 Answers

usually the log files should be at /var/log/mongodb.log or try find / -name mongodb.log.

usually it keeps data at /data/db.

To know more about where does it store data please visit How is the data in a MongoDB database stored on disk?

like image 144
Muntasim Avatar answered Sep 19 '22 09:09

Muntasim


Databases are under:

/var/lib/mongodb

MongoDB stores all logs (for each database) in one file by default. It is located under:

/var/log/mongodb/mongodb.log


More info :

/etc/mongodb.conf

  • (Using XUbuntu 13.04)
like image 31
nothing-special-here Avatar answered Sep 21 '22 09:09

nothing-special-here