Updated on 2023-03-15 GMT+08:00

Changing a Database Port

This section describes how to change a database port.

Precautions

  • For security purposes, the database port cannot be modified when the instance is in any of the following statuses:
    • Frozen
    • Restarting
    • Adding node
    • Switching SSL
    • Changing instance class
    • Deleting node
    • The storage space is being expanded.
    • Abnormal
  • For a cluster instance, the instance port is the port of the mongos node. The default port is 8635. You can change the port after the instance is created. The shard node port is 8637, and the config node port is 8636, which cannot be changed.
  • For a replica set or single node instance, the default port is 8635. You can change the port after the instance is created.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page and choose Databases > Document Database Service.
  4. On the Instances page, click the instance name.
  5. In the Network Information area on the Basic Information page, click in the Database Port field to change the database port.

    In the navigation pane on the left, choose Connections and click in the Database Port field in the Basic Information area to change the database port.

    Available ports: 2100 to 9500, and 27017 to 27019

    • To submit the change, click . This process takes about 1 to 5 minutes.
    • To cancel the change, click .

  6. View the modification result.