Reconfigure a Replica Set

I am working on Reconfigure the replica set , I am stuck .

here is what i did so far .

mongo --port 27001

rs.isMaster() all the 4 nodes are running
m103-repl:PRIMARY> rs.isMaster()
{
“hosts” : [
“localhost:27001”,
“localhost:27002”,
“localhost:27003”,
“localhost:27004”

now i am trying to Connect to the replica set m103-repl and retrieve the configuration of the node localhost:27004 – Below is the command I am running to connect to M103 . Please let me know what should i do next ? should I have to add ?

m103-repl:PRIMARY> mongo --host “m103-repl/localhost:27004” -u “m103-admin” -p “m103-pass” --authenticationDatabase “admin”
2021-05-10T14:32:03.024+0000 E QUERY [js] SyntaxError: missing ; before statement @(shell):1:8

Hi @rajeshwar_dadi,

The above command should be executed in the bash shell, not in the mongo shell.
So, after m103-repl:PRIMARY> type exit

and then run this :point_down:

mongo --host "m103-repl/localhost:27004" -u "m103-admin" -p "m103-pass" --authenticationDatabase "admin" in the bash shell.

FYI: The bash shell indicates > bash-4.4# on the prompt.

Hope it helps…!
In case you have any doubts, feel free to reach out to us.

Regards,
Kushagra

Thanks @Kushagra_Kesav - It worked …!

1 Like