Lab: Deploy a Replica Set/ Adding members to replica set

Hi guys,
I am confused and stuck at adding members to replica set. Please help!

Please check syntax of rs.add()
Should be like
rs.add (hostname : PORT)

2 Likes

Yes yes, I’m aware of that. I am confused with hostname and port. I know it is a simple question, but I’m somehow not able to figure this out.

Hi @Arpita_Naganur,

Yes yes, I’m aware of that. I am confused with hostname and port. I know it is a simple question, but I’m somehow not able to figure this out.

Is "localhost:27002" the member in which you wish to add to the replicaSet?

If so, have you tried:
rs.add("localhost:27002")

If you have attempted the above, are you able to send a screenshot of the output when running that command?

There are some further examples listed on the rs.add() documentation which may be of use.

4 Likes

Oh yes, it worked! Thank you so much Jason!

2 Likes