All Products
Search
Document Center

ApsaraDB for MongoDB:Apply for an endpoint for a shard or Configserver node

Last Updated:Jan 18, 2024

The mongos nodes of ApsaraDB for MongoDB sharded cluster instances can be connected to handle read and write requests. To read the oplogs of shard nodes or the configuration information of Configserver nodes, you can apply for endpoints for the corresponding types of nodes.

Prerequisites

  • The instance is a sharded cluster instance.

  • The MongoDB protocol is selected.

Background information

The sharded cluster instance contains three types of nodes: mongos, shard, and Configserver nodes. You can configure the specifications and quantity of shard and Configserver nodes to create ApsaraDB for MongoDB sharded cluster instances that have different performance capabilities. For more information, see Sharded cluster instances.

Usage notes

  • After you apply for an endpoint for a shard node, the system creates an endpoint for the primary, secondary, and read-only nodes in the shard node respectively. Each endpoint has its own IP address. Before you apply for an endpoint, make sure that you have a sufficient number of available IP addresses.

  • After you apply for an endpoint for a Configserver node, the system creates an endpoint for the primary and secondary nodes in the Configserver node respectively. Each endpoint has its own IP address. Before you apply for an endpoint, make sure that you have a sufficient number of available IP addresses.

  • The network type of an endpoint that you want to apply for must be the same as that of the current mongos node.

  • You cannot modify the endpoint that is allocated to a shard or Configserver node.

  • In this topic, the endpoint allocated to a shard or Configserver node is a private endpoint. For Internet access, apply for a public endpoint. For more information, see (Optional) Apply for a public endpoint for an ApsaraDB for MongoDB instance.

  • You can apply for an endpoint only for the shard node in an ApsaraDB for MongoDB instance that runs MongoDB 4.2 or later and uses enhanced SSDs (ESSDs).

Instances that use local disks

Note

You can also click Add Shard in the Shard List section of the Basic Information page. In the panel that appears, set Enable Shard Connection to Yes, and then configure the parameters in the Apply for Shard Private Endpoint section. For more information, see Configure the parameters.

  1. Log on to the ApsaraDB for MongoDB console .

  2. In the left-side navigation pane, click Sharded Cluster Instances.

  3. In the upper-left corner of the Sharded Cluster Instances page, select the resource group and region to which the desired instance belongs.

  4. Click the ID of the instance or click Manage in the Actions column.

  5. In the left-side navigation pane of the instance details page, click Database Connections.

  6. In the Internal Connections - VPC section, click Create-Shard-Cs-Connections.

  7. In the Create-Shard-Cs-Connections panel, configure the parameters described in the following table.

    Parameter

    Description

    Node Type

    The type of the node for which you want to apply for an endpoint. Valid values:

    • Shard: shard node

    • CS: Configserver node

    Select Node ID

    The ID of the node for which you want to apply for an endpoint.

    Account

    The account used for endpoint application. Specify the account based on the following rules:

    • The account must start with a lowercase letter.

    • The account can contain lowercase letters, digits, and underscores (_).

    • The account must be 4 to 16 characters in length.

    Note
    • Keywords cannot be used as accounts.

    • This account is granted read-only permissions.

    • The account and password are required only when you apply for an endpoint for a shard or Configserver node for the first time.

    Password

    The password of the account. Specify the password based on the following rules:

    • The password contains at least three of the following character types: uppercase letters, lowercase letters, digits, and specific special characters.

      These special characters include ! @ # $ % ^ & * ( ) _ + - =

    • The password must be 8 to 32 characters in length.

    Note

    You can reset the password of an account for a shard or Configserver node in an ApsaraDB for MongoDB instance. For more information, see Reset the password of an account for an ApsaraDB for MongoDB instance.

    Confirm Password

    Re-enter the password.

  8. Click Submit.

  9. On the Database Connections page, view the allocated endpoint.

    1. Wait until the instance state changes from Creating Connection to Running.

    2. In the Internal Connections - VPC section, view the allocated endpoint.

      Note

      The following list describes the node types:

      • Mongos: mongos node

      • Shard: shard node

      • CS: Configserver node

Instances that use cloud disks

  1. Log on to the ApsaraDB for MongoDB console .

  2. In the left-side navigation pane, click Sharded Cluster Instances.

  3. In the upper-left corner of the Sharded Cluster Instances page, select the resource group and region to which the desired instance belongs.

  4. Click the ID of the instance or click Manage in the Actions column.

  5. (Optional) Create an account for the shard node.

    You must create an account for the shard node only when you apply for an endpoint for the shard node of the current instance for the first time. To create an account for the shard node, perform the following steps:

    1. In the left-side navigation pane of the instance details page, click Accounts.

    2. On the page that appears, click Create Account.

    3. In the Create Account (Shard only) panel, enter the account and password.

      Note

      This account is granted read-only permissions.

      Parameter

      Description

      Account

      The account used for endpoint application. Specify the account based on the following rules:

      • The account must start with a lowercase letter.

      • The account can contain lowercase letters, digits, and underscores (_).

      • The account must be 4 to 16 characters in length.

      Note
      • Keywords cannot be used as accounts.

      • This account is granted read-only permissions.

      Password

      The password of the account. Specify the password based on the following rules:

      • The password contains at least three of the following character types: uppercase letters, lowercase letters, digits, and specific special characters.

        These special characters include ! @ # $ % ^ & * ( ) _ + - =

      • The password must be 8 to 32 characters in length.

      Note

      You can reset the password of an account for a shard or Configserver node in an ApsaraDB for MongoDB instance. For more information, see Reset the password of an account for an ApsaraDB for MongoDB instance.

      Confirm Password

      Re-enter the password.

    4. Click OK.

  6. Apply for an endpoint for the shard node.

    1. In the left-side navigation pane of the instance details page, click Database Connections.

    2. In the Internal Connections - VPC section, click Create-Shard-Cs-Connections.

    3. In the Create-Shard-Cs-Connections panel, configure the parameters described in the following table.

      Parameter

      Description

      Node Type

      Set the value to Shard.

      Select Node ID

      The ID of the node for which you want to apply for an endpoint.

    4. Click Submit.

  7. On the Database Connections page, view the allocated endpoint.

    1. Wait until the instance state changes from Creating Connection to Running.

    2. In the Internal Connections - VPC section, view the allocated endpoint.

      Note

      The following list describes the node types:

      • Mongos: mongos node

      • Shard: shard node

References

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