MongoDB Community Server URI

Hello, I hope I’m in the right place with my post

I created my own community server.
It works well so far and I can also connect
But I would like to be able to connect to +srv
SRV record was created but I still can’t connect.
Anyone have any ideas what else I might have forgotten?
Or whether the SRV record is correct at all?

Thanks for your answers!

Hi @Tobias_Horacek

In addition to SRV records you can create a TXT record for the connection options such as authSource replicaSet among others.

A mongodb+srv uri implicitly enables TLS on the client so ensure your server is setup with TLS or add tls=false to the connection options

An example of your working uri, the SRV, TXT records as well as any error messages when connecting will help us assist you with this.

3 Likes

Hi @Tobias_Horacek,

I asume you have a replicaset so, you say you already create SRV record but, just like @chris comment, I was wondering if you have created the TXT record and the A records, one per each server in your cluster.

This is an example of my config:

SRV
_mongodb._tcp.mongo.ns.company.com
0 0 30001 mongo_1.mongo.ns.company.com
0 0 30002 mongo_2.mongo.ns.company.com
0 0 30003 mongo_3.mongo.ns.company.com
TXT
mongo.ns.company.com
A
mongo_1.mongo.ns.company.com 10.0.1.21
mongo_2.mongo.ns.company.com 10.0.1.22
mongo_3.mongo.ns.company.com 10.0.1.23
1 Like