Unable to connect to Mongo Replica Sets using Robo3T

Viewed 9062

I am facing an issue to connect to the Mongo Clusters using RoboMongo. When I used same connection string in compass it works. But Compass Community Edition is not flexible like Robomongo.

Cannot connect to replica set "Employee UAT"[hhds6666:27027].

A primary with different host name [hhds6666.XXXXXXX.int:27027] found in server side. Please double check if same host names and ports are used as in server's replica set configuration.

If same set name is used for different replica sets, this configuration is supported only on different instances of Robomongo. Please open a new Robomongo instance for each replica set which has the same set name.

Reason: Different members found under same replica set name "UAT_RS"

I went through so many links like:

https://github.com/Studio3T/robomongo/issues/1422

https://github.com/Studio3T/robomongo/issues/1345

Similar issue here: Unable to connect to MongoDB Replica Set from other server using robo3T and in C#

4 Answers

First Solution :

Try removing "Replica Set" name, it works

enter image description here

Second Solution

Create a Direct connection with 'hhds6666.XXXXXXX.int:27027' with same configuration. Since, The error states

"A primary with different host name [hhds6666.XXXXXXX.int:27027] found in server side."

Either will surely work

First, check the hostname of primary & secondaries using rs.status() on primary mongo instance. As per the error the primary has different name so to change host name of primary or secondary follow the bellow steps.

cfg = rs.conf() cfg.members[0].host = "mongodb0.example.net:27017" rs.reconfig(cfg)

refer to link https://docs.mongodb.com/manual/tutorial/change-hostnames-in-a-replica-set/

Make sure the set name you specified (if you did) is case-sensitively correct.

Example: your set might be called "mySet" but you have it as "MySet".

First, set the primary and secondary members of the set. Example:

cluster-shard-00-00-zzzz.mongodb.net:27017
cluster-shard-00-02-zzzz.mongodb.net:27017
cluster-shard-00-01-zzzz.mongodb.net:27017

Then enable SSL protocol with Self-signed Certificate as the authentication method and that's it.

I also managed to make it work by using v 1.3 which has the option to specify the conf details using a Mongo SRV connection string.

Related