In most cases, mongos nodes of ApsaraDB for MongoDB sharded cluster instances can satisfy read and write requests. If you want to read the operation logs of shard nodes or the configuration information of Configserver nodes, you can apply for endpoints for the corresponding types of nodes.

Background information

A sharded cluster instance consists of mongos, shard, and Configserver nodes. You can configure the specifications and number of mongos and shard nodes to create ApsaraDB for MongoDB sharded cluster instances that have different performance capabilities. For more information, see Architecture of sharded cluster instances.

Precautions

  • After you apply for an endpoint for a Configserver node, the system creates endpoints for the primary and secondary nodes in the Configserver node.
  • After you apply for an endpoint for a shard node, the system creates endpoints for the primary, secondary, and read-only nodes in the shard node.
  • The network type of the endpoints must be the same as that of mongos nodes in the instance.
  • You cannot modify the endpoint of a shard or Configserver node.
  • The created endpoints can be used only for internal access. To gain Internet access, you can apply for public endpoints. For more information, see Apply for a public endpoint for a sharded cluster instance.

Procedure

  1. Log on to the ApsaraDB for MongoDB console.
  2. In the upper-left corner of the page, select the resource group and the region of the target instance.
  3. In the left-side navigation pane, click Sharded Cluster Instances.
  4. Find the target instance and click its ID.
  5. In the left-side navigation pane, click Database Connections.
  6. In the upper-right corner of the page, choose More > Apply for Shard\Configserver Endpoint.
  7. In the Apply for Shard\Configserver Endpoint panel, configure the following parameters.
    Apply for an endpoint
    Parameter Description
    Node Type Select the type of the node for which you want to apply for an endpoint.
    • Shard: the shard node.
    • CS: the Configserver node.
    Select Node ID Select the ID of the node for which you want to apply for an endpoint.
    Account Specify the name of the account based on the following rules:
    • The name must start with a lowercase letter.
    • The name can contain lowercase letters, digits, and underscores (_).
    • The name must be 4 to 16 characters in length.
    Note
    • You need only to set the account name and its password when you first apply for an endpoint for a shard or Configserver node.
    • The permissions of this account are fixed to read-only.
    Password Specify the password based on the following rules:
    • The password can contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. Special characters include

      !@#$%^&*()_+-=

    • The password must be 8 to 32 characters in length.
    Note
    Confirm Password Enter the account password again.
  8. Click Submit.
  9. On the Database Connections page, view the created endpoint.
    1. Wait until the instance state changes from Creating Connection to Running.
    2. Optional:If you have not configured a whitelist for the instance, you must first configure a whitelist. For more information, see Configure a whitelist for an ApsaraDB for MongoDB instance.
    3. In the Internal Connections section, view the created endpoint.
      Note The following section describes the node types:
      • Mongos: the mongos node.
      • Shard: the shard node.
      • CS: the Configserver node.

References

If you no longer need the endpoints of shard or Configserver nodes, you can release these endpoints. For more information about how to release endpoints, see Release the endpoint of a shard or Configserver node.