This topic describes how to access other self-managed databases from DAS, such as self-managed databases on data centers, of other cloud providers, and on virtual machines of other cloud providers.

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 your database over the Internet. You can quickly access database instances after you enter your database account and password. 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 or more servers for disaster recovery) 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 DAS console.
  2. In the Recommended Features section of the Overview page, click Access Instance.
  3. Click Other On-premise and 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.
    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 to add another databases, click Add More.

Centralized-mode access

  1. Log on to the DAS console.
  2. In the Recommended Features section of the Overview page, click Access Instance.
  3. Click Other On-premise and Cloud Databases.
  4. Click DBGateway in Centralized Mode.
  5. Select an access method.
    Note Note: If you have not deployed a DAS gateway in the corresponding VPC, click Deploy a new DAS Gateway and search for instance. If you have deployed a DAS gateway in the corresponding VPC, click Use existing DAS DBGateway to scan for new instances.
    • Deploy a new DAS Gateway and search for instance
      1. Click Deploy a new DAS Gateway and search for 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. For a self-managed database connected over the Internet, select Public Network (Classic Network). If you are connecting to databases on data centers or of other cloud providers 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 on data centers or of other cloud providers.
      3. Copy the deployment command. Log on to the corresponding device and run the command.
        Note If successful is returned, the DAS gateway is deployed. DAS can automatically discover the gateway. If the DAS gateway is not deployed, you can submit a ticket for technical support.
      4. If Current Status is 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 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 CIDR block to scan 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 automatically scans and discovers 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 database account 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 DAS console.
  2. In the Recommended Features section of the Overview page, click Access Instance.
  3. Click Other On-premise and 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. Example:
      • For a self-managed database connected over the Internet, select Public Network (Classic Network).
      • If you are connecting to databases on data centers or of other cloud providers 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 on data centers or of other cloud providers.
  6. Copy the deployment command. Log on to the corresponding device and run the command.
    Note If successful is returned, the DAS gateway is deployed. DAS can automatically discover the gateway. If Current Status is Normal, click Next. If the DAS gateway is not deployed, you can submit a ticket for technical support.
  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 database account or password.
    • Insufficient Permissions: The instance can be connected normally, but the permissions are insufficient. For more information, see Permissions.
  9. Click OK.