I tired to launch mongosqld locally with the following command:
mongosqld --mongo-uri “mongodb://mongo-dev-shard-00-00.xxxxx.gcp.mongodb.net:27017,mongo-dev-shard-00-01.xxxxx.gcp.mongodb.net:27017,mongo-dev-shard-00-02.xxxxx.gcp.mongodb.net:27017/?ssl=true&replicaSet=mongo-dev-shard-0&retryWrites=true&w=majority” --auth -u username -p password --mongo-versionCompatibility 4.4.6
but ends up with an error:
unable to load MongoDB information: failed to create admin session for loading server cluster information: unable to execute command: server selection error: context deadline exceeded, current topology: { Type: ReplicaSetNoPrimary, Servers: [{ Addr: mongo-dev-shard-00-00.xxxxx.gcp.mongodb.net:27017, Type: Unknown, Average RTT: 0 }, { Addr: mongo-dev-shard-00-01.xxxxx.gcp.mongodb.net:27017, Type: Unknown, Average RTT: 0 }, { Addr: mongo-dev-shard-00-02.xxxxx.gcp.mongodb.net:27017, Type: Unknown, Average RTT: 0 }, ] }
However, I can successfully connect db with mongodb compass client,
by using uri:
mongodb://username:password@mongo-dev-shard-00-00.xxxxx.gcp.mongodb.net:27017,mongo-dev-shard-00-01.xxxxx.gcp.mongodb.net:27017,mongo-dev-shard-00-02.xxxxx.gcp.mongodb.net:27017/?ssl=true&replicaSet=mongo-dev-shard-0&retryWrites=true&w=majority
I can’t figure out what I am doing wrong. Anyone can assist me? Thanks in advance.
hosted mongodb version: 4.4.6
mongosqld version: 2.14.3