Unable to connect to MongoDB Replica Set from other server using robo3T and in C#

Viewed 1493


I have installed mongodb Replica Set, in the file mongod.conf has added BIND_IP as below

net:
  port: 27017
  bindIp: 127.0.0.1, 100.0.192.68

When I use robo3t to connect the "replica set" type the error, but when connected to the "Direct Connection" is successful.

error TYPE="Replica Set

enter image description here

Connection string C# "mongodb://100.0.192.68:27017,100.0.192.68:27017/databasename?safe=true&connect=replicaSet&replicaSet=r0"

2 Answers

Robo 3T seems to have problems to access replica sets with authenticated connections via "Authentication". Better activate the ssh-server on all members of the replication set. Then in Robo 3T you add all members to the connection and select ssh with auth method password. This way I was able to get around this limitation.

In my case the problem was too short timeout (default 10 seconds) in Robo3T. To increase the timeout, I had to modify mongoTimeoutSec property in robo3t.json config file.

Depending on your OS, you can find robo3t.json config file in:

Windows
    C:\Users\<user>\.3T\robo-3t\1.1.1\robo3t.json

MAC
    /Users/<user>/.3T/robo-3t/1.1.1/robo3t.json

Linux
    /home/<user>/.3T/robo-3t/1.1.1/robo3t.json

Before modifying robo3t.json close Robo3T itself.

In this file, modify timeout to your needs:

"mongoTimeoutSec" : 30,

After this modification, save the file and start Robo3T.

Related