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.
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).
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.
| Feature | Direct mode | Centralized mode | Host mode (recommended) |
|---|---|---|---|
| Database metric monitoring | Supported | Supported | Supported |
| Real-time performance monitoring | Supported | Supported | Supported |
| Real-time session monitoring | Supported | Supported | Supported |
| Storage analysis | Supported | Supported | Supported |
| Slow request analysis | Supported | Supported | Supported |
| Host metric monitoring | Not supported | Not supported | Supported |
| Request diagnostics | Not supported | Not supported | Supported |
| Full request analysis | Not supported | Not supported | Supported |
| SQL response time analysis | Not supported | Not supported | Supported |
| Security audit | Not supported | Not supported | Supported |
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.

Connect databases in direct mode
Log on to the DAS console.
In the left-side navigation pane, choose Intelligent O&M Center > Instance Monitoring.
In the upper-right corner, click Access Instance.
Click Other On-premise and Cloud Databases.
Click Method 1: Direct Access.
Configure the following parameters.
Parameter Description Select Region The region nearest to your database. Select Engine The database engine type. Database Account The account used to log on to the database. Password The password for the database account. Instances The databases to connect. Enter each database in Address:portformat.Click Test Connection.
If the Status column shows Verified, click Save Instance. Otherwise, correct the parameters and test again.
To add another database, click Add More.
Connect databases in centralized mode
Log on to the DAS console.
In the left-side navigation pane, choose Intelligent O&M Center > Instance Monitoring.
In the upper-right corner, click Access Instance.
Click Other On-premise and Cloud Databases.
Click Method 2: DBGateway in Centralized Mode.
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.
Click Deploy a new DAS DBGateway and search for instances.
Select a network type, then click Generate Deployment Command.
NoteSet 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.
Copy the deployment command, log on to the host, and run the command.
NoteIf the command returns
successfully, the gateway is deployed and DAS will discover it automatically. If deployment fails, see Common issues about DBGateway.When the Current Status column shows Normal, click Next.
Use existing DAS DBGateway to scan for new instances
Click Use existing DAS DBGateway to scan for new instances.
In the Select DBGateway step, select the gateway and click Discover Instance.
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.
Configure the following parameters for each discovered database.
Parameter Description Select Engine The database engine type. Database Account The account used to log on to the database. Password The password for the database account. IP Address The IP address of the database server. NoteThe 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.
Click Authorize and check the result.
Status Meaning Accessed Connection successful. Unauthorized No account or password was provided. Connection Failed A network error or database downtime occurred. Authentication Failed The account or password is incorrect. Insufficient Permissions The database is reachable, but the account lacks the required permissions. See Permissions. 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
Log on to the DAS console.
In the left-side navigation pane, choose Intelligent O&M Center > Instance Monitoring.
In the upper-right corner, click Access Instance.
Click Other On-premise and Cloud Databases.
Click Method 3: DBGateway in Host Mode.
Select a network type, then click Generate Authorization Command.
NoteSet 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.
Copy the deployment command, log on to the host, and run the command.
NoteIf 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.Configure the following parameters for each discovered database.
Parameter Description Select Engine The database engine type. Database Account The account used to log on to the database. Password The password for the database account. IP Address The IP address of the database server. NoteThe 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.
Click Authorize and check the result.
Status Meaning Accessed Connection successful. Unauthorized No account or password was provided. Connection Failed A network error or database downtime occurred. Authentication Failed The account or password is incorrect. Insufficient Permissions The database is reachable, but the account lacks the required permissions. See Permissions. 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
| Operation | Description |
|---|---|
| AddHDMInstance | Connects a database instance to DAS. |