Search code examples
mongodbmeteornitrousio

Where to set mongodb start parameter in a meteor application on nitrous.io?


I'm studying meteor and trying some examples on nitrous.io, but the available disk space was soon consumed by the big mongo data files (including the prealloc journal files).

Unfortunately MongoDB is also new to me. I googled around and found that I can start mongoDB with some parameters like --nojournal, but I have no idea where in the nitrous.io app I can pass this parameter to mongodb at startup?

I also can't find any mongodb.conf (even *db.conf) to use the storage.smallFiles setting.

Any help would be appreciated!


Solution

  • Instead of using Meteor's builtin MongoDB instance, you can specify a custom instance (which you can configure the way you want).

    To do this Nitrous.IO, you can follow these steps:

    • Create a box with Meteor template.
    • Install MongoDB, by running parts install mongodb (Autoparts is Nitrous.IO specific package manager)
    • Open the MongoDB config located at /home/action/.parts/etc/mongodb.conf
    • Tweak it to your liking.
    • Start MongoDB instance by running parts start mongodb
    • Now you can create a new meteor project - meteor create projectname
    • Finally, when you're starting meteor on your project specify the MONGO_URL environment variable. eg: MONGO_URL=mongodb://0.0.0.0:27017 meteor.

    Hope this would be good enough to get started. You can also upgrade your Nitrous.IO account to increase the storage of your box.

    UPDATE: I just noticed that Meteor runs its MongoDB instance with --smallfiles flag set.