admin管理员组

文章数量:1388134

I'm trying to make use of the URI scheme mongodb+srv for host discovery when our apps connect to MongoDB. With a service configuration file like this on each node I can resolve this via _mongos._tcp.service.TLD just fine:

{
  "service": {
    "name": "mongos",
    "tags": [
    ],
    "port": 27017
  }
}

However, we have multiple applications with dedicated MongoDB clusters, so they don't all share the same MongoS routers. Also, MongoDB insists on resolving the SRV record for _mongodb._tcp.DOMAIN, so I can't just use different service names to discern them between applications.

Any idea how to write that service definition to allow me creating a _mongodb._tcp.APP.service.TLD kind of entry?

本文标签: mongodbSame service name in consul for multiple applicationsStack Overflow