All Products
Search
Document Center

Use a database gateway to back up a database in an on-premises data center or a third-party cloud to Alibaba Cloud

Last Updated: Jun 11, 2020

Database Backup (DBS) allows you to use a database gateway to back up a database that is deployed on the internal network of an on-premises data center or a third-party cloud to Alibaba Cloud. You can connect the database to Alibaba Cloud at low costs through some simple configurations. Then, you can directly use the connected database as the backup source when you configure a logical backup schedule. This topic describes how to use a database gateway to back up a database that is deployed in an on-premises data center or a third-party cloud to Alibaba Cloud.

Background

You can connect a database in an on-premises data center or a third-party cloud to Alibaba Cloud by using one of the following methods. However, these methods have certain disadvantages.

  • Connect over Express Connect, VPN Gateway, or Smart Access Gateway: This method is not suitable for individual users because it requires high costs.
  • Connect to the service port of the database over the Internet: This method incurs potential security risks.
  • Forward service requests by using a user-created proxy: This method requires high costs and does not ensure high stability.

To resolve the preceding issues, Alibaba Cloud allows you to use a database gateway for the connection. This method has the following advantages:

  • Encryption technologies are used to protect the security of backup data.
  • Data can be transmitted in a compressed format or in shards to improve the transmission efficiency.
  • Geo-disaster recovery and automatic restoration for exceptions are supported to guarantee the transmission reliability.
  • No firewall configuration is required, which simplifies the service use. For more information about Database Gateway, see How it works.

Prerequisites

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

Pricing

Database Gateway is in public preview and incurs no fees.

Procedure

  1. Log on to the Database Gateway console.

    Note: If you are using Database Gateway for the first time, you need to activate the service. On the page where you can activate the service, read and agree to the Database Gateway Terms of Service, and then click Activate Now.

  2. On the Gateway List page of the Database Gateway console, click Create Gateway in the upper-left corner.

  3. In the Create Gateway dialog box that appears, enter the name and description of the database gateway, and then click Next step.

  4. In the Download Gateway step, set the Which OS parameter based on your operating system. Download and install the gateway program on your local machine or virtual server as instructed. After the installation, return to the Database Gateway console and click Next step.
    19

    Note: The following table describes the requirements that the machine or server used to deploy the gateway program must meet.

    Configuration itemDescription
    System resources
    • A single-core CPU and 1 GB memory are available. You can also use a machine or server with more available system resources.
    Software environment
    • Java runtime environment (JRE) 1.7 or later is installed. We recommend that you use a 64-bit operating system.
    Network connection
    • The machine or server can connect to the destination database. If the machine or server and the database are deployed on the same internal network, the network latency is minimal.
    • The machine or server can access the Internet. The service port of the machine or server does not need to be open to the Internet. To ensure the channel rate and stability, the outbound bandwidth must be at least 10 Mbit/s.
  5. Start the gateway program.

    1. Go to the directory where the gateway program is decompressed. If you are using a virtual server, you need to log on to the server where the gateway program is deployed first.

    2. Select one of the following methods to start the gateway program based on your operating system:

      • For Linux or macOS, run the bin/start.bat command.
      • For Windows, double-click the db_agent.bat file in the bin directory.
    3. In the command line interface (CLI), enter the AccessKey ID and AccessKey secret of your Alibaba Cloud account as instructed.

    4. After the verification is successful, return to the Database Gateway console and click Next step to obtain a random verification code.
      20

    5. Enter the random verification code in the CLI of the gateway program and press Enter. Wait until the connection is established.

What to do next

When you configure a backup schedule in the DBS console, set Database Location to No public network IP: Port’s self-built database (accessed through the database gateway), select the ID of the target backup gateway, and then specify the database connected through the database gateway as the backup source. The follow-up steps are the same as those of configuring a backup schedule for other types of databases. For more information, see Configure a backup schedule.

Note: If you set Database Location to No public network IP: Port’s self-built database (accessed through the database gateway), you cannot back up the destination database across regions. That is, you must specify an Object Storage Service (OSS) bucket that is deployed in the same region as the destination database.

21