Mongo connecting with replica set

In the lecture the command to connect to the initial replica set is given by
mongo --host m103-example/ -u “m103-admin” -p "m103-pass --authenticationDatabase “admin”

I do not understand the expression for the host. It appears to be expressed as a filepath. Is m103-example really a directory containing all of the documents? The term doesn’t make any sense to me. What is it the name of? In the exercise below the lecture it appears to be the IP address and port specified in the config file.

Could you explain the host path in more detail? Thanks.
What is the the device at (a Mongo server?, THE Mongo server?)


m103-example is not a directory name
It is replicaset name
–host is one of the parameter you use while connecting to standalone mongo instance or a replicaset

mongo admin --username xyz -p --host server_ip --port 27017

To connect to a replica set (rather than an individual instance), replace the host name with the replica set name and a comma-separated list of member IP addresses like below
mongo admin --username xyz -p --host replicaset-name/server_ip-1:27017,server_ip-2:27017,… is the hostname where your mongod is running
If you have setup vagrant environment login to the Vagrant unix box by vagrant ssh
Once you are on that box
run the command hostname is IP of Vagrant Unix box/host where mongod is running
Also run ping m103 which is an alias for

Hi @Howard_84497,

I hope you found @Ramachandra_37567’s response helpful.

This hostname is just an alias for the IP address Similarly, the hostname m103 also gets mapped to

You can check this by running the following command in the vagrant prompt:


ping m103

If in case these hostnames are getting mapped to then please refer this post for fixing this issue.

Hope it helps!

Please feel free to get back to us if you have any other query.

Shubham Ranjan
Curriculum Services Engineer

Thank you very much for your help.


This is very helpful. Thank you


Closing this thread as the issue has been resolved.