All Products
Search
Document Center

:Connect an on-premises database or a database hosted on a third-party cloud to Alibaba Cloud by using Database Gateway

Last Updated:Jan 19, 2024

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 in a cost-effective manner. When you configure a data migration, data synchronization, or change tracking task, you can specify the connected database as the source or destination database.

Prerequisites

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

Background information

You can connect an on-premises database or a database that is hosted on a third-party cloud to Alibaba Cloud by using one of the following methods:

  • Connect over Express Connect, VPN Gateway, or Smart Access Gateway (SAG): This method is not suitable for individual users due to high costs.

  • Connect to the service port of the database over the Internet: This method causes potential security risks.

  • Forward service requests by using a self-managed proxy: This method requires high technical costs and does not ensure high stability.

The preceding methods have disadvantages. You can connect an on-premises database or a database that is hosted on a third-party cloud to Alibaba Cloud by using Database Gateway at a lower cost. For more information about how Database Gateway works, see How it works.

Procedure

  1. Log on to the Database Gateway console.

    Note

    If you are using Database Gateway for the first time, you are navigated to the page where you can activate the service. On this page, read and agree to the terms of service, and then click Activate Now.

  2. On the Gateway List page, click Create Gateway.

  3. In the Create Gateway step of the Create Gateway wizard, enter the name and description of the database gateway that you want to create, and then click Next step.

  4. In the Install Gateway step of the Create Gateway wizard, install the Database Gateway agent.

    Important

    The server where you want to install the Database Gateway agent must meet the following requirements:

    • Performance: At least one idle CPU core and 1 GB of idle memory are available on the server.

    • Software environment: Java runtime environment (JRE) 1.7 or later is installed on the server. We recommend that you use a 64-bit operating system.

    • Network:

      • The server can connect to the database that you want to add to the database gateway. If the server and the database are deployed in the same internal network, the network latency is minimal.

      • The server can access the Internet. The service port of the server does not need to be accessible over the Internet. To improve the transmission rate and stability, make sure that the outbound bandwidth is at least 10 Mbit/s.

    1. Select the appropriate installation package based on the operating system of the server.

      • If you use the Windows operating system, click Download gateway and install the Database Gateway agent as prompted.

      • If you use other operating systems, copy and paste the command to the server where you want to install the Database Gateway agent. Then, press the Enter key to run the command.

    2. Wait for the Database Gateway agent to start.

    3. Go to the Adding a Database step of the Create Gateway wizard.

      • After the Database Gateway agent is started, you are navigated to the Adding a Database step.

      • You can also click Next step in the Install Gateway step to go to the Adding a Database step.

  5. Click Add database address to add a database to the database gateway. For more information, see Add databases.

  6. Click Complete.

    After the database is added to the database gateway, you can modify or delete the database.

What to do next

When you configure a data migration, data synchronization, or change tracking task, select Database without public IP:Port (Accessed through database gateway) from the Instance Type drop-down list. Then, select the ID of the database gateway and the database address. This way, you can select the database that is connected to Database Gateway as the source or destination database.

Note

If you select Database without public IP:Port (Accessed through database gateway) from the Instance Type drop-down list when you configure a data migration task, make sure that the source and destination databases reside in the same region. Cross-region data migration is not supported.