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.
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.
An AccessKey that consists of an AccessKey ID and AccessKey secret is created. For more information, see Create an AccessKey.
Database Gateway is in public preview and incurs no fees.
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.
On the Gateway List page of the Database Gateway console, click Create Gateway in the upper-left corner.
In the Create Gateway dialog box that appears, enter the name and description of the database gateway, and then click Next step.
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.
Note: The following table describes the requirements that the machine or server used to deploy the gateway program must meet.
Configuration item Description 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.
- Java runtime environment (JRE) 1.7 or later is installed. We recommend that you use a 64-bit operating system.
- 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.
Start the gateway program.
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.
Select one of the following methods to start the gateway program based on your operating system:
- For Linux or macOS, run the
- For Windows, double-click the db_agent.bat file in the bin directory.
- For Linux or macOS, run the
In the command line interface (CLI), enter the AccessKey ID and AccessKey secret of your Alibaba Cloud account as instructed.
After the verification is successful, return to the Database Gateway console and click Next step to obtain a random verification code.
Enter the random verification code in the CLI of the gateway program and press Enter. Wait until the connection is established.
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.