ApsaraDB for MongoDB provides a connection string for each mongos node, each shard node, and the Configserver node in a sharded cluster instance. ApsaraDB for MongoDB also provides a Uniform Resource Identifier (URI) for each sharded cluster instance. The URI of a sharded cluster instance is used to establish a highly available connection between your application and the instance. This topic describes how to view the connection strings and URI of a sharded cluster instance. This topic also describes how to log on to a specific database of a sharded cluster instance.
View the connection strings and URI of a sharded cluster instance
Introduction to connection strings and URIs
Item | Description |
---|---|
Connection address type |
|
Connection string | ApsaraDB for MongoDB provides a connection string for each of the primary and secondary
nodes of the mongos nodes, shard nodes, and Configserver node in a sharded cluster
instance. A connection string is in the following format:
Example:
Note
|
URI | The URI of a sharded cluster instance is in the following format:
Example:
Note
|
Log on to a specific database of a sharded cluster instance
Common connection scenarios
- Connect to an ApsaraDB for MongoDB instance over the Internet
- How to connect an ECS instance to an ApsaraDB for MongoDB instance when their network types are different
- How to connect an ECS instance to an ApsaraDB for MongoDB instance when they are in different regions
- Connect an ECS instance with an ApsaraDB for MongoDB instance in another Alibaba Cloud account
FAQ
- How do I troubleshoot logon issues for the mongo shell?
- How to troubleshoot database connection failures after the number of connections reaches the upper limit
- How do I troubleshoot the issue of high CPU utilization in an ApsaraDB for MongoDB instance?
- How do I query and limit the number of connections?