This topic describes how to connect an on-premises database or a database that is hosted on a third-party cloud to Alibaba Cloud by using Database Gateway. Then, you can specify the connected database as the source or target in your tasks of data migration, data synchronization, or change tracking.

Prerequisites

An AccessKey pair is created. The AccessKey pair consists of an AccessKey ID and AccessKey secret. For more information, see Create an AccessKey pair.

Background information

Database Gateway helps you connect your non-Alibaba Cloud databases to Alibaba Cloud. This option is more affordable than other networking solutions, such as Express Connect and Cloud Enterprise Network. This service works with either an on-premises database or a database that is hosted on a third-party cloud. For more information about the design concept of Database Gateway, see How it works.

Precautions

Database Gateway is in public preview and is available only in the following regions:

  • China (Hangzhou)
  • Singapore
  • Indonesia (Jakarta)
  • UK (London)
  • US (Virginia)

Billing

Database Gateway incurs no fees while it is in public preview.

Procedure

  1. Log on to the Database Gateway console.
    Note You are prompted to activate the service the first time that you log on to the Database Gateway console. On the Enable Service page, select the check box to confirm that you agree to the Terms of Service, and then click Enable Now.
  2. Click Create Gateway.
  3. In the Create Gateway dialog box, enter the name and description of the database gateway, and then click Next step.
  4. Download the gateway program.
    Notice The server that runs the gateway program must meet the following requirements:
    • Performance: 1 CPU core, 1 GB memory
    • Software environment: JRE 1.7 or later. We recommend that you use a 64-bit operating system.
    • Network:
      • The server can connect to the target database. You can minimize the network latency by placing the server and the database in the same internal network.
      • The server can access the Internet. The service port of the server does not need to be accessible over the Internet. For an optimal transmission rate, make sure that the outbound bandwidth is 10 Mbit/s or higher.
    1. In the Create Gateway dialog box, download the gateway program for the target operating system.
      Download the gateway program
    2. Copy the downloaded installation file to the server where you want to deploy the gateway program, and decompress the file.
  5. Start the gateway program.
    1. Log on to the server where the gateway program is deployed, and go to the directory where the gateway program is decompressed.
    2. Select one of the following methods to start the gateway program, depending on your operating system:
      • For Linux or Mac, run the bin/start.bat command.
      • For Windows, double-click the db_agent.bat file in the bin directory.
    3. Enter the AccessKey ID and AccessKey secret.
      Install Database Gateway
    4. After the verification is successful, return to the Database Gateway console and click Next step to obtain a random verification code.
      Obtain a verification code
    5. Enter the verification code in the CLI of the gateway program and press the Enter key. Wait until the connection is established.
      Start Database Gateway
  6. Add a database.
    Note You can repeat this step to add multiple databases.
    1. Return to the Database Gateway console and click Add database.
    2. In the dialog box that appears, enter the address and port number of the database server, enter a description for the server connection, and then click OK. The address must be reachable from the server that is running the gateway program. If the gateway program is running on the same server as the database server, set the address to 127.0.0.1.
      Add a database

What to do next

You can select the database that is connected over Database Gateway as either the source database or target database when you create a task. To do this, select Database without public IP:Port (Accessed through database gateway) as the instance type, and then select the database address from the drop-down list.
Note If you select Database without public IP:Port (Accessed through database gateway) as the instance type when you configure data migration, the source and target instances must reside in the same region.
Select an instance type