4

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#

Community
  • 1
  • 1
PAA
  • 1
  • 46
  • 174
  • 282

4 Answers4

1

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

Saumyajit
  • 678
  • 8
  • 10
1

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/

  • Could you please explain more on this? – PAA Jan 16 '21 at 15:17
  • @Pra_A login to mongo shell on on primary node, execute command rs.status() and check host name of all nodes including primary & secondaries. It seems there is some different name for primary node or secondary. To fix the issue, follow below steps. cfg = rs.conf() cfg.members[0].host = ":27017" rs.reconfig(cfg) – Wajahat Lateef Jan 17 '21 at 17:55
  • I had same issue and found that matching the "name" of the cluster members fixed the issue. so you can do it in two way either change Robo3T names or change mongo db cluster names. – Vlad Apr 23 '21 at 13:04
0

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".

Ivaylo Novakov
  • 775
  • 6
  • 18
-1

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.

  • Could you please refer this : https://github.com/Studio3T/robomongo/issues/1725 ? – PAA Jun 11 '20 at 06:37