How to run mongod command in meteor?


#1

Hi, I’m trying to create replica sets and I’m following along tutorials and I can’t seem to run the “mongod” command. (or where should I run it?)

Anyone have any idea? Thanks in advance.


#2

You can try meteor mongo console command after starting meteor instance.
Not Mongo expert, but surely you need to down & install Mongo binaries from https://www.mongodb.org/downloads, as Meteor doesnt provide Mongo utilities by default.


#3

Please post the link or links of the tutorials you’re following so it’s clear what commands specifically you’re referring to and what exactly you’re trying to accomplish.

In general:
If you don’t need it then don’t bother manually setting up your own MongoDB server/cluster. If you’re just getting started stick with the meteor command for development and access the mongo shell through calling meteor mongo once Meteor is running (i.e. in another console window/tab).
And then for production use just use either something like compose.io if you can afford it or get a $5 DigitalOcean instance with the MEAN stack on it and MongoDB will already be fully installed and running and you can then use a much simpler tutorial for production deployment where you only have to set the right MONGO_URL and that’s all regarding MongoDB.


#4

Assuming you have mongo installed on your local machine you just have to turn on mongo by running mongod and you can connect to it with meteor by running MONGO_URL=mongodb://localhost:27017/db_name meteor and you will connect your local meteor to your local mongo.


#5

Thanks all for your replies! Sorry I was busy with work so I had to stop working on my side meteor project.

I was actually trying to set up replica sets because apparently elastic search requires it. But I’ve decided that this is probably way beyond my level right now and I will get back to this once I feel more ready!

Thanks for all your help!