I want to setup Master Slave config for Mongo DB on my Ubuntu Machine. I can see the setting to do this in /etc/mongodb.conf but that would make my DB either Master or Slave.
Is there any way I can run two different server on same machine and use one as Master and other as slave. I want to do this for testing purpose.
For testing purposes you can start both instances manually, take a look at this link. Quoting from the docs:
Locate the folder where the MongoDB binaries are located:
Then open up another terminal, navigate to the same folder and run this: