Database Backup (DBS) allows you to back up self-managed databases in data centers that are connected to Alibaba Cloud over Express Connect to Object Storage Service (OSS) or DBS. This topic describes how to back up a self-managed MySQL database deployed in a data center that is connected to Alibaba Cloud over Express Connect to OSS or DBS.
Terms
Express Connect: an Alibaba Cloud service that helps you build private network communication channels between virtual private clouds (VPCs) or between VPCs and data centers. This service provides better flexibility for your network topology and enhances the performance and security of cross-network communication.
VPC: an Alibaba Cloud service that allows you to create private networks on Alibaba Cloud. VPCs are logically isolated from each other. You can create and manage your cloud service instances in VPCs, such as Elastic Compute Service (ECS) instances, ApsaraDB instances, and Server Load Balancer (SLB) instances.
VBR: a virtual border router (VBR) that is deployed between the customer-premises equipment (CPE) in a data center and a VPC. The VBR helps you exchange data between the VPC and data center. Similar to VPC routers, each VBR manages a route table. You can add routes to the route table of a VBR to control network traffic forwarding. For more information, see What is a VBR?
vRouter: a hub that connects vSwitches in a VPC, and a gateway that connects the VPC and other networks.
Prerequisites
A DBS backup schedule is created. For more information, see Create a backup schedule.
The data center in which a self-managed database is deployed is connected to a VPC on Alibaba Cloud by using an Express Connect circuit. For more information, see Connect an on-premises data center to a VPC by using an Express Connect circuit.
A static route is added on a machine in the data center to route traffic to a CIDR block of DBS servers. You can run the following command to add a static route:
ip route CIDR block of DBS servers {IP address of a VBR at the Alibaba Cloud side}
. For more information about the CIDR blocks of DBS servers, see the CIDR blocks of DBS servers section of this topic. Example:If the CIDR block of DBS servers is 100.104.52.0/24 and the IP address of the VBR at the Alibaba Cloud side is 10.100.0.1, run the following command to add a static route:
ip route 100.104.52.0/24 10.100.0.1
.
Configure a backup schedule
Log on to the DBS console. In the left-side navigation pane, click Backup Schedules. In the top navigation bar, select the region in which you purchased the backup schedule.
On the Backup Schedules page, find the ID of the backup schedule that you want to configure and click Configure Backup Schedule in the Actions column.
In the Configure Backup Source and Destination step of the Configure Backup Schedule wizard, configure parameters in the Backup Source Information and Backup Destination Information sections and click Next in the lower-right corner of the page.
Section
Parameter
Description
N/A
Schedule Name
The name of the backup schedule. DBS automatically generates a backup schedule name. We recommend that you enter a descriptive name that is easy to identify. Backup schedule names do not need to be unique.
Backup Source Information
Backup Mode
The method that is used to back up data. By default, the backup method that you selected when you purchased the backup schedule is used. In this example, Logical Backup is displayed.
Database Location
The location of the database. Select Express Connect DB/VPN Gateway/Intelligent Gateway.
Database Type
The type of the database that you want to back up. By default, the database type that you selected when you purchased the backup schedule is used. In this example, this parameter is set to MySQL.
Peer VPC
The VPC to which the self-managed database is connected. Select a created VPC.
Address
The connection address of the self-managed database.
Port Number
The port number of the self-managed MySQL database. Default value: 3306.
Database Account
The username of the account that is used to connect to the self-managed database. The account must have specific permissions to back up the database. For more information, see Account permissions.
Password
The password of the account that is used to connect to the self-managed database.
After you enter the username and password of the database account, click Test Connection next to the password to check whether the information about the destination database is valid. If the specified parameters are valid, the Test Passed message is displayed. If the Test Failed message is displayed, click Check next to Test Failed. Modify the information about the database that you want to back up based on the check results.
Compliance warranty regarding cross-border data transfers
Read and agree to the compliance commitment by selecting the check box.
Backup Destination Information
Backup Storage Type
The type of storage that is used to store the backup data. Valid values:
DBS Storage (recommended): Backup data is stored in DBS without requiring you to create storage space. You are charged based on the volume of your data that is stored in DBS. For more information about the billing rules, see Storage costs.
To reduce storage costs, we recommend that you use subscription storage plans. For more information, see Use storage plans.
OSS For User: You must create a bucket in OSS in advance. For more information, see Create buckets.
NoteIn this example, DBS Storage (recommended) is selected. If you select OSS For User, you must configure the OSS Bucket Name parameter. Only the Standard storage class is supported.
Storage Encryption
The method that is used to encrypt the stored data. Valid values:
Encrypted: recommended. DBS uses AES-256 to encrypt the stored data.
The server-side encryption feature is used in OSS. When you upload an object to a bucket for which server-side encryption is enabled, OSS encrypts and stores the object. When you download the encrypted object from OSS, OSS decrypts the object and returns the decrypted object to you. For more information, see Server-side encryption.
Non-encrypted: The stored data is not encrypted.
In the Edit Backup Objects step, find the database or table that you want to back up in the Available section. Click the right arrow to add the selected database or table to the Selected section. Then, click Next.
NoteLogical backup: DBS allows you to back up a single table, a single database, multiple databases, or an entire database instance. You can click Select All in the lower-left corner of the Available section to select all databases. The database objects that can be backed up vary based on the database type. For more information, see Database engines and features. By default, a backup schedule cannot be used to back up a database that is created after the backup schedule is configured. To back up the database, you can add the database to the backup schedule on the Edit Backup Objects page of the backup schedule. For more information, see Modify backup objects.
Physical backup: You must back up an entire database instance.
In the Configure Backup Time step, configure the parameters that are described in the following table and click Next.
Parameter
Description
Full-scale Backup Frequency
The frequency of the backup schedule. Valid values: Periodic Backup and Single Backup.
NoteIn scenarios in which incremental data needs to be restored, we recommend that you select Periodic Backup and perform a full backup at least once a week. Otherwise, a large number of binary logs must be replayed during restoration. This process is prone to errors and may result in a prolonged recovery time objective (RTO).
Full Data Backup Recurrence
This parameter is required if you set the Full-scale Backup Frequency parameter to Periodic Backup. You can select the days of the week on which DBS runs the backup schedule. Select at least one day of the week.
Start At
This parameter is required if you set the Full-scale Backup Frequency parameter to Periodic Backup. We recommend that you set a point in time within off-peak hours. Example: 01:00.
NoteIf a previous full data backup is not complete at the start time of the next backup, DBS skips the next backup.
Incremental Backup
Specifies whether to enable incremental backup. If you enable incremental backup, make sure that the binary logging feature is enabled for the source database.
NoteBy default, the binary logging feature is enabled for an ApsaraDB RDS for MySQL database. If you use a self-managed database, you must manually enable the binary logging feature.
This parameter is displayed only when you set the Full-scale Backup Frequency parameter to Periodic Backup.
Maximum Concurrent Threads for Full Data Backup
The maximum number of concurrent threads that are available for a full backup. You can configure this parameter to adjust the backup speed. For example, you can reduce the number of backup threads to minimize impacts on the database.
The maximum number of actual concurrent threads varies based on backup schedule specifications. For more information, see How do I change the maximum backup speed?
Backup network speed limit
The limit on the network bandwidth. Unit: MB/s. You can set the limit based on your business requirements. The default value 0 indicates that the network bandwidth is unlimited.
NoteThis parameter is displayed only when you configure a backup schedule for a MySQL database.
In the Edit Lifecycle step, configure the lifecycle for full backup data.
NoteIf you set the Incremental Backup parameter to Enable in the previous step, you must configure the lifecycle for incremental backup data.
After the configurations are complete, click Precheck in the lower-right corner of the page.
If the Precheck Passed message appears, click Start Task.
NoteIf the state of the backup schedule changes to Running, the backup schedule takes effect.
If an exception or error occurs when you start the backup schedule, troubleshoot the exception or error at the earliest opportunity. For more information, see How do I fix errors for an abnormal backup schedule in DBS? If your issue persists after you use the solution that is provided in the preceding topic, contact technical support in the DBS DingTalk group (ID: 35585947).
CIDR blocks of DBS servers
In the preceding configurations, the CIDR block of DBS servers that is used resides in the region where the data center is connected to a VPC on Alibaba Cloud by using an Express Connect circuit. The following table describes the CIDR blocks of DBS servers that are supported in various regions for connections to VPCs over Express Connect.
Region | CIDR block of DBS servers |
China (Hangzhou) | 100.104.217.0/24 |
China (Beijing) | 100.104.119.0/24 |
China (Qingdao) | 100.104.183.0/24 |
China (Shanghai) | 100.104.191.0/24 |
China (Shenzhen) | 100.104.81.0/24 |
China (Chengdu) | 100.104.133.128/26 |
China (Ulanqab) | 100.104.76.192/26 |
China (Heyuan) | 100.104.127.0/26 |
South Korea (Seoul) | 100.104.150.192/26 |
Thailand (Bangkok) | 100.104.119.128/26 |
China (Hong Kong) | 100.104.10.0/24 |
Singapore | 100.104.10.0/24 |
Japan (Tokyo) | 100.104.144.0/24 |
China (Hohhot) | 100.104.40.0/24 |
China (Zhangjiakou) | 100.104.48.0/24 |
US (Virginia) | 100.104.220.0/24 |
US (Silicon Valley) | 100.104.17.0/24 |
Germany (Frankfurt) | 100.104.133.0/24 |
Malaysia (Kuala Lumpur) | 100.104.10.0/24 |
Indonesia (Jakarta) | 100.104.209.0/24 |