This topic describes how to access other self-managed databases from DAS, such as self-managed databases in local IDCs, of other cloud vendors, and on virtual machines of other cloud vendors.

Prerequisites

DAS can access the following types of self-managed databases:
  • MySQL
  • MongoDB
  • Redis
  • PostgreSQL

Access methods

DAS can access other self-managed databases in the following methods:
  • Direct access: No DAS gateway (DBGateway) is deployed. DAS actively accesses databases over the Internet. You can quickly access database instances after entering accounts and passwords. This method can only be used to access MySQL, MongoDB, and Redis databases.
  • Centralized-mode access: DAS gateways are deployed on at least one server (we recommend that you use two of more servers for disaster recovery scenarios) and database instances are automatically discovered.
  • Host-mode access: DAS gateways are deployed on every server and database instances are automatically discovered. In this method, all DAS features are available, such as full SQL analysis, SQL response time, and security auditing. For more information, see Features for three access methods.

Features for three access methods

Feature Direct access Centralized-mode access Host-mode access (recommended)
Database monitoring metrics Supported Supported Supported
Real-time performance Supported Supported Supported
Real-time session Supported Supported Supported
Capacity analysis Supported Supported Supported
Slow-query request analysis Supported Supported Supported
Host monitoring metrics Not supported Not supported Supported
Request diagnosis Not supported Not supported Supported
Full request analysis Not supported Not supported Supported
Request response time Not supported Not supported Supported
Security auditing Not supported Not supported Supported

Direct access

  1. Log on to the Database Autonomy Service console.
  2. In the Recommended Features section of the Overview page, click Access Instance.
  3. Click Other User-created or Cloud Databases.
  4. Click Direct Access.
  5. Configure the following parameters.
    Parameter Description
    Select Region The region for the database.
    Select Engine The type of the database.
    Account The account used to log on to the database.
    Password The password used to log on to the database.
    Instances Enter instances in the format of endpoint:port.
  6. Click Test Connection.
  7. If Status is Verified, click Save Instance. If Verified is not displayed, modify the parameters and then click Test Connection.
  8. If you want add another database, click Add More.

Centralized-mode access

  1. Log on to the Database Autonomy Service console.
  2. In the Recommended Features section of the Overview page, click Access Instance.
  3. Click Other User-created or Cloud Databases.
  4. Click DBGateway in Centralized Mode.
  5. Select an access method.
    Note If you have not deployed a DAS gateway in the corresponding VPC, click New deployment DAS Gateway (dbgateway) and scanning instance. If you have deployed a DAS gateway in the corresponding VPC, click Use existing DAS DBGateway to scan for new instances.
    • A new DAS gateway
      1. Click New deployment DAS Gateway (dbgateway) and scanning instance.
      2. Select a network type and then click Generate Deployment Command.
        • Network Type is based on the connection method between the host where DBGateway is deployed and Alibaba Cloud. Examples: 1. For a self-managed database connected over the Internet, select Public Network (Classic Network). 2. If you are connecting to databases in local IDCs or of other cloud vendors through a dedicated line or VPN, select Proprietary Network (VPC/Leased Line).
        • Network Domain is used to manage different environments such as self-managed databases in local IDCs or of other cloud vendors.
      3. Copy the deployment command. Log on to the corresponding device and run the command.
        Note If successful is returned in the command line window, the DAS gateway is deployed and will be automatically discovered by DAS. If the DAS gateway is not deployed, you can submit a ticket.
      4. If Current Status is Normal, click Next.
    • An existing DAS gateway
      1. Click Use existing DAS DBGateway to scan for new instances.
      2. In the Select DBGateway step, select the DAS gateway and then click Discover Instance.
  6. In the Discover Instance step, scan and discover the database instance.
    1. DAS can discover instances in the following ways:
      • Select Automatic Scan
        1. Enter the scanned CIDR block in the Scanned Address field.
        2. Enter the port range in the Port Range field.
        3. Click Scan.
      • Select Enter Instances
        1. Enter instances in the correct form in the Instances field.
        2. Click Scan.
          Note The DAS gateway will automatically scan and discover the database instance.
    2. Click Next.
  7. Configure the following parameters.
    Parameter Description
    Select Engine The type of the database.
    Database Account The account used to log on to the database.
    Password The password used to log on to the database.
    IP The IP address of the database.
    Note
    • If the database has an existing account with required permissions, you can enter the account and password and then click Authorize.
    • If the database does not have an existing account with required permissions, you can enter the database account and password and then click Generate Authorization Command. After you copy and run the authorization command on the database, click Authorize.
  8. Click Authorize. After you click Authorize, Accessed is displayed to indicate successful connection. The following common errors also may be displayed:
    • Unauthorized: No account or password is specified.
    • Connection Failed: indicates errors such as network failure or instance downtime.
    • Authentication Failed: indicates incorrect username or password.
    • Insufficient Permissions: The instance can be connected normally, but the permissions are insufficient. For more information, see Permissions.
  9. Click OK.

Host-mode access

  1. Log on to the Database Autonomy Service console.
  2. In the Recommended Features section of the Overview page, click Access Instance.
  3. Click Other User-created or Cloud Databases.
  4. Click DBGateway in Host Mode.
  5. Select a network type and then click Generate Deployment Command.
    Note
    • Network Type is based on the connection method between the host where DBGateway is deployed and Alibaba Cloud. In the CLI, run the following command:
      • For a self-managed database connected over the Internet, select Public Network (Classic Network).
      • If you are connecting to databases in local IDCs or of other cloud vendors through a dedicated line or VPN, select Proprietary Network (VPC/Leased Line).
    • Network Domain is used to manage different environments such as self-managed databases in local IDCs or of other cloud vendors.
  6. Copy the deployment command. Log on to the corresponding device and run the command.
    Note If successful is returned in the command line window, the DAS gateway is deployed and will be automatically discovered by DAS. If Current Status is Normal, click Next. If the DAS gateway is not deployed, you can submit a ticket.
  7. Configure the following parameters.
    Parameter Description
    Select Engine The type of the database.
    Database account The account used to log on to the database.
    Password The password used to log on to the database.
    IP The IP address of the database.
    Note If the database has an existing account with required permissions, you can enter the account and password and then click Authorize. If the database does not have an existing account with required permissions, you can enter the database account and password and then click Generate Authorization Command. After you copy and run the authorization command on the database, click Authorize.
  8. Click Authorize. After you click Authorize, Accessed is displayed to indicate successful connection. The following common errors also may be displayed:
    • Unauthorized: No account or password is specified.
    • Connection Failed: indicates errors such as network failure or instance downtime.
    • Authentication Failed: indicates incorrect username or password.
    • Insufficient Permissions: The instance can be connected normally, but the permissions are insufficient. For more information, see Permissions.
  9. Click Complete.