Lab - Shard a Collection

Can anyone take a look at this and tell were I am going wrong??

@Mathias_11469 you’ve potentially already created the user at some point. But first let’s see if the other members are ok by running rs.status()

this is what I get

It proves this point -->

Try and authenticate with the user:
use admin
db.auth("m103-admin", "m103-pass")

files Preformatted text

Issue that I am having

Did you try what I mentioned here?

And I don’t understand why you’re showing me these screenshots. The last one isn’t showing the full command.

In the last snapshot he is trying to connect to first replicaset m103-repl

In the first snapshot you were working on m103-repl-2 but last snapshot is for m103-repl
Did you complete rs.initiate/user creation on first replicaset?
Though your ps -ef|grep mongo shows all servers are up it says unable to reach primary?
Please double check all your config files,replicaset names etc
Check mongo.log for each one and make sure they are are all up and running
Also when you connect with local host first time it won’t show primary at prompt but in your case it is showing primary while running rs.initiate on second replica

Thanks @Ramachandra_37567. So we don’t know if @Mathias_11469 was eventually able to login to the m103-repl-2 which was his original query. @Mathias_11469 would have to confirm that too.

Hi @Mathias_11469,

Can you please confirm if you were able to authenticate or not ?

As I can see in the other screenshot, you have just started the nodes mongod-repl-4.conf, mongod-repl-5.conf, mongod-repl-6.conf which seems to be for the m103-repl-2 replica set.

Can you please confirm if the nodes in the m103-repl repica set are up and running ?

Shubham Ranjan
Curriculum Support Engineer

yes they are up and running

all my nodes are up and running and I can get mongo to start on 27004
why do I have this error when I run

Because of two things:

  1. You’ve already initiated the replica set. Can’t initiate again!
  2. You need to authenticate as the user you created on this replica set