While connecting to secondary Node, It connects to Primary

Experts, Can you pl advice, where I am doing mistakes. I am trying to connect secondary Nodes, But It shows PRIMARY Prompt.

vagrant@m103:/data/db$ ls -lrt *.conf
-rwxrwxr-x 1 vagrant vagrant 327 Jan 17 19:21 mongod_v1.conf
-rwxrwxr-x 1 vagrant vagrant 327 Jan 17 19:23 mongod_v2.conf
-rwxrwxr-x 1 vagrant vagrant 327 Jan 17 19:23 mongod_v3.conf

mongod_v1.conf: port: 27010
mongod_v2.conf: port: 27011
mongod_v3.conf: port: 27012

am connecting this screenshot, connects Primary (27010)…No issue

image

The below connect is from from the port 27011

image

The below connect is from from the port 27012

image

Remove the name of the replica set from the host option to connect directly to the node.

3 Likes

Thank you sir.
Solved the issue and noted.

:slightly_smiling_face: :+1: