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
- 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.
- Click Create Gateway.
- In the Create Gateway dialog box, enter the name and description of the database gateway,
and then click Next step.
- 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.
- In the Create Gateway dialog box, download the gateway program for the target operating system.
- Copy the downloaded installation file to the server where you want to deploy the gateway
program, and decompress the file.
- Start the gateway program.
- Log on to the server where the gateway program is deployed, and go to the directory
where the gateway program is decompressed.
- 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.
- Enter the AccessKey ID and AccessKey secret.
- After the verification is successful, return to the Database Gateway console and click
Next step to obtain a random verification code.
- Enter the verification code in the CLI of the gateway program and press the Enter
key. Wait until the connection is established.
- Add a database.
Note You can repeat this step to add multiple databases.
- Return to the Database Gateway console and click Add database.
- 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.
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.