I was supposed to sync two clusters in MongoAtlas with mongomirror tools with following syntax. Unfortunately, it said source cluster is not able to connect even I checked connectivity and it was working.
Error initializing mongomirror: could not initialize source connection: could not connect to server: server selection error: server selection timeout, current topology: { Type: ReplicaSetNoPrimary, Servers: [{ Addr: source-devtestmocha.tnbhs.mongodb.net:27017, Type: Unknown, Last error: connection() error occured during connection handshake: dial tcp: lookup source-devtestmocha.tnbhs.mongodb.net: No address associated with hostname }, ] }
Are you trying to sync two Atlas clusters ? or are you trying to migrate a self-hosted MongoDB instance to Atlas?
As you stated it looks like a connectivity issue. Make sure your IP ports are open, if in atlas you can set the network open to 0.0.0.0 (open to the world) just to see if that is the issue, it is not a best practice to keep them this way.
Any updates on this? I have run into a similar issue. In my case, the source can be connected but the destination is not. I can access the nodes via mongosh with no issues, also can telnet on the port 27017, but mongomirror throws this error.