Mongo connecting with replica set

In the lecture the command to connect to the initial replica set is given by
mongo --host m103-example/m103.mongodb.university:27011 -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 m103.mongdb.university 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 192.168.103.100? (a Mongo server?, THE Mongo server?)
Thanks

Howard

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,…
m103.mongdb.university 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

192.168.103.100 is IP of Vagrant Unix box/host where mongod is running
Also run ping m103 which is an alias for 192.168.103.100

Hi @Howard_84497,

I hope you found @Ramachandra_37567’s response helpful.

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

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

ping m103.mongodb.university

ping m103

If in case these hostnames are getting mapped to 127.0.0.1 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.

Thanks,
Shubham Ranjan
Curriculum Services Engineer

Thank you very much for your help.

Howard

This is very helpful. Thank you

Howard

Closing this thread as the issue has been resolved.