All Products
Search
Document Center

Database Autonomy Service:Connect databases that are not on Alibaba Cloud to DAS

Last Updated:Mar 28, 2026

Database Autonomy Service (DAS) supports connecting databases hosted outside Alibaba Cloud — including databases in your own data centers, self-managed databases on third-party cloud VMs, and databases from third-party cloud providers.

Prerequisites

Before you begin, ensure that your database is one of the supported types: MySQL, MongoDB, PostgreSQL, or Redis.

Note

Only Redis 6.0 and earlier can be connected to DAS.

Network and security requirements

DAS uses port 80 for all gateway traffic. Database gateways connect to DAS exclusively through port 80, with data encrypted in transit using gRPC and Transport Layer Security (TLS).

Important

DAS gateways can be deployed only on Linux servers. This requirement applies to centralized mode and host mode. Direct mode does not require a gateway.

Choose a connection mode

DAS provides three connection modes. Use the following table to choose the mode that matches your infrastructure and monitoring requirements, then follow the corresponding procedure.

FeatureDirect modeCentralized modeHost mode (recommended)
Database metric monitoringSupportedSupportedSupported
Real-time performance monitoringSupportedSupportedSupported
Real-time session monitoringSupportedSupportedSupported
Storage analysisSupportedSupportedSupported
Slow request analysisSupportedSupportedSupported
Host metric monitoringNot supportedNot supportedSupported
Request diagnosticsNot supportedNot supportedSupported
Full request analysisNot supportedNot supportedSupported
SQL response time analysisNot supportedNot supportedSupported
Security auditNot supportedNot supportedSupported

Direct mode: No DAS gateway (DBGateway) is required. DAS connects to your database over the Internet using only your database account and password. Supported databases: MySQL, MongoDB, and Redis.

Centralized mode: Deploy a DBGateway on at least one server. The gateway automatically discovers databases by scanning CIDR blocks. For disaster recovery, deploy on two or more servers.

Host mode (recommended): Deploy one DBGateway on every database server. DAS automatically discovers all databases on each host. This mode provides the full DAS feature set, including full request analysis, SQL response time analysis, and security audit.

DAS connection mode architecture diagram

Connect databases in direct mode

  1. Log on to the DAS console.

  2. In the left-side navigation pane, choose Intelligent O&M Center > Instance Monitoring.

  3. In the upper-right corner, click Access Instance.

  4. Click Other On-premise and Cloud Databases.

  5. Click Method 1: Direct Access.

  6. Configure the following parameters.

    ParameterDescription
    Select RegionThe region nearest to your database.
    Select EngineThe database engine type.
    Database AccountThe account used to log on to the database.
    PasswordThe password for the database account.
    InstancesThe databases to connect. Enter each database in Address:port format.
  7. Click Test Connection.

  8. If the Status column shows Verified, click Save Instance. Otherwise, correct the parameters and test again.

  9. To add another database, click Add More.

Connect databases in centralized mode

  1. Log on to the DAS console.

  2. In the left-side navigation pane, choose Intelligent O&M Center > Instance Monitoring.

  3. In the upper-right corner, click Access Instance.

  4. Click Other On-premise and Cloud Databases.

  5. Click Method 2: DBGateway in Centralized Mode.

  6. In the dialog box, select an access method based on whether you already have a DBGateway deployed.

    • Deploy a new DAS DBGateway and search for instances.

      1. Click Deploy a new DAS DBGateway and search for instances.

      2. Select a network type, then click Generate Deployment Command.

        Note

        Set Network Type based on how your host connects to Alibaba Cloud: - For self-managed databases connecting over the Internet, select Public Network (Classic Network). - For data center databases or third-party cloud databases connecting over a leased line, select Proprietary Network (VPC/Leased Line). Set Network Domain to manage databases from different environments, such as data center databases alongside third-party cloud databases.

      3. Copy the deployment command, log on to the host, and run the command.

        Note

        If the command returns successfully, the gateway is deployed and DAS will discover it automatically. If deployment fails, see Common issues about DBGateway.

      4. When the Current Status column shows Normal, click Next.

    • Use existing DAS DBGateway to scan for new instances

      1. Click Use existing DAS DBGateway to scan for new instances.

      2. In the Select DBGateway step, select the gateway and click Discover Instance.

  7. In the Discover Instance step, scan for the databases to connect. Choose one of the following discovery methods: Click Next Step when the scan is complete.

    • Automatic Scan: Enter a CIDR block in the Scanned Address field, set the Port Range, and click Scan.

    • Enter Instances: Enter each database in the Instances field, then click Scan.

  8. Configure the following parameters for each discovered database.

    ParameterDescription
    Select EngineThe database engine type.
    Database AccountThe account used to log on to the database.
    PasswordThe password for the database account.
    IP AddressThe IP address of the database server.
    Note

    The database account must have the required permissions. For details, see Permissions. - If the account already has the required permissions, enter the account and password, then click Authorize. - If you need to create an account, enter a new account name and password, click Generate Authorization Command, run the command on the database, then click Authorize.

  9. Click Authorize and check the result.

    StatusMeaning
    AccessedConnection successful.
    UnauthorizedNo account or password was provided.
    Connection FailedA network error or database downtime occurred.
    Authentication FailedThe account or password is incorrect.
    Insufficient PermissionsThe database is reachable, but the account lacks the required permissions. See Permissions.
  10. Click OK.

After the status shows Accessed, the database appears in Intelligent O&M Center > Instance Monitoring and DAS begins collecting metrics.

Connect databases in host mode

  1. Log on to the DAS console.

  2. In the left-side navigation pane, choose Intelligent O&M Center > Instance Monitoring.

  3. In the upper-right corner, click Access Instance.

  4. Click Other On-premise and Cloud Databases.

  5. Click Method 3: DBGateway in Host Mode.

  6. Select a network type, then click Generate Authorization Command.

    Note

    Set Network Type based on how your host connects to Alibaba Cloud: - For self-managed databases connecting over the Internet, select Public Network (Classic Network). - For data center databases or third-party cloud databases connecting over a leased line, select Proprietary Network (VPC/Leased Line). Set Network Domain to manage databases from different environments.

  7. Copy the deployment command, log on to the host, and run the command.

    Note

    If the command returns successful, the gateway is deployed. When the Current Status column shows Normal, click Next. If deployment fails, see Common issues about DBGateway.

  8. Configure the following parameters for each discovered database.

    ParameterDescription
    Select EngineThe database engine type.
    Database AccountThe account used to log on to the database.
    PasswordThe password for the database account.
    IP AddressThe IP address of the database server.
    Note

    The database account must have the required permissions. For details, see Permissions. - If the account already has the required permissions, enter the account and password, then click Authorize. - If you need to create an account, enter a new account name and password, click Generate Authorization Command, run the command on the database, then click Authorize.

  9. Click Authorize and check the result.

    StatusMeaning
    AccessedConnection successful.
    UnauthorizedNo account or password was provided.
    Connection FailedA network error or database downtime occurred.
    Authentication FailedThe account or password is incorrect.
    Insufficient PermissionsThe database is reachable, but the account lacks the required permissions. See Permissions.
  10. Click OK.

After the status shows Accessed, the database appears in Intelligent O&M Center > Instance Monitoring. Because host mode deploys a gateway on each database server, DAS can collect host-level metrics in addition to database metrics. Verify the connection by opening Instance Monitoring and confirming that the instance is listed and that metric data is flowing.

API reference

OperationDescription
AddHDMInstanceConnects a database instance to DAS.