This topic describes how to back up a read-only ApsaraDB RDS instance by using Database Backup (DBS). In this example, an ApsaraDB RDS for MySQL instance is used.

Prerequisites

  • A backup schedule is purchased. For more information, see Purchase a backup schedule.
    Note When you purchase a backup schedule, set the Data Source Type parameter to MySQL and the Backup Method parameter to Logical Backup.
  • A read-only ApsaraDB RDS for MySQL instance is created. For more information, see Create a read-only ApsaraDB RDS for MySQL instance.
  • The following requirements are met if you use Method 1: Configure a backup schedule for a read-only ApsaraDB RDS for MySQL instance by using its public endpoint:
  • The following requirements are met if you select Method 2: Configure a backup schedule for a read-only ApsaraDB RDS for MySQL instance by using its internal endpoint:
    • The internal endpoint of the read-only instance is obtained. A real-time internal IP address is obtained by running the ping command on your local device. 1
      Important The internal IP address that you obtain may change in some scenarios. If the new internal IP address of the read-only instance differs from the internal IP address that is configured in the backup schedule, the backup fails. For more information, see Usage notes.
    • The CIDR blocks of the DBS server are added to the whitelist of the read-only instance. For more information, see Configure an IP address whitelist for an ApsaraDB RDS for MySQL instance.
      Note When you configure a backup schedule, you can set the Database Location parameter to RDS Instance and click Set Whitelist to obtain the CIDR blocks of the DBS server.

Usage notes

  • If you perform a backup over the Internet, the binary logs may be delayed. We recommend that you set the Retention Period parameter to a relatively large value on the Backup and Restoration page of the read-only ApsaraDB RDS for MySQL instance. This parameter indicates the retention period of local logs. Default value: 18. Unit: hours.
  • If you use the internal endpoint to configure a backup schedule and you clone the read-only instance, migrate the instance to another zone, or change the virtual private cloud (VPC) or vSwitch of the instance, the real-time internal IP address that you obtain may change. In this case, the instance fails to be connected, and the backup fails.

    To resolve this issue, you can obtain a new real-time internal IP address and reconfigure a backup schedule. For more information, see the Prerequisites section of this topic and How do I change or modify the backup source database in a backup schedule?

Procedure

When you configure a backup schedule for a read-only ApsaraDB RDS for MySQL instance, you can set the Database Location parameter to User-Created Database with Public IP Address <IP Address:Port Number> or Express Connect DB/VPN Gateway/Intelligent Gateway.

Method 1: Configure a backup schedule for a read-only ApsaraDB RDS for MySQL instance by using its public endpoint

  1. Log on to the Database Backup (DBS) console.
  2. In the left-side navigation pane, click Backup Schedules. In the top navigation bar, select a region.
  3. 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.
  4. In the Configure Backup Source and Destination step of the Configure Backup Schedule wizard, configure the backup source and destination. Then, click Next in the lower-right corner of the page.
    Note
  5. In the Edit Backup Objects step, find the database or table that you want to back up and add it to the Selected section. Then, click Next.
    Note
    • If you selected Logical Backup when you purchased a backup schedule, DBS allows you to back up a single table, a single database, multiple databases, or an entire database instance. By default, all the incremental data is backed up during incremental backup.
      • You can click Select All in the lower-left corner of the page 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 created. 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.
    • If you selected Physical Backup when you purchased a backup schedule, you must back up an entire database instance.
  6. In the Configure Backup Time step, configure the parameters that are described in the following table. Then, click Next in the lower-right corner of the page.
    ParameterDescription
    Full-scale Backup Frequency

    The frequency of the backup schedule. Select Periodic Backup or Single Backup based on your business requirements.

    Note In scenarios where 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

    The days of the week on which DBS runs the backup schedule. This parameter must be specified if the Full-scale Backup Frequency parameter is set to Periodic Backup. Select at least one day of the week.

    Start At

    The point in time when a backup starts. This parameter must be specified if the Full-scale Backup Frequency parameter is set to Periodic Backup. We recommend that you specify a point in time during off-peak hours. Example: 01:00.

    Note If 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 database that you want to back up.

    Note
    • This parameter is displayed only if you set the Full-scale Backup Frequency parameter to Periodic Backup.
    • By default, the binary logging feature is enabled for an ApsaraDB RDS for MySQL instance. If you use a self-managed database, you must manually enable the binary logging feature.
    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 needs. Default value: 0, which indicates that the network bandwidth is unlimited.

    Note This parameter is displayed only if you set the Database Type parameter to MySQL.
  7. In the Edit Lifecycle step, configure the lifecycle for full backup data in the Configure Full Data Backup Lifecycle section.
    Note If you set the Incremental Backup parameter to Enable in Step 6, you must configure the lifecycle for incremental backup data.
  8. After the configurations are complete, click Precheck in the lower-right corner of the page.
  9. If the Precheck Passed message appears, click Start Task.
    Note
    • If 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 based on the error code. For more information, see Common Errors and Troubleshooting. If your issue persists after you use the solution that is provided in the "Common Errors and Troubleshooting" topic, contact technical support in the DBS DingTalk group whose ID is 35585947.
    After data is backed up, you can view the backup schedule or restore the backup data. For more information, see View a backup schedule or Restore a database.

Method 2: Configure a backup schedule for a read-only ApsaraDB RDS for MySQL instance by using its internal endpoint

  1. Log on to the Database Backup (DBS) console.
  2. In the left-side navigation pane, click Backup Schedules. In the top navigation bar, select a region.
  3. 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.
  4. In the Configure Backup Source and Destination step of the Configure Backup Schedule wizard, configure the backup source and destination. Then, click Next in the lower-right corner of the page.
    Note
    • Set the Database Location parameter to Express Connect DB/VPN Gateway/Intelligent Gateway.
    • Set the Peer VPC parameter to the VPC in which the read-only ApsaraDB RDS for MySQL instance is deployed.
    • Set the Address parameter to the internal IP address that you obtain. For more information, see the Prerequisites section of this topic.
    • Set the Port Number parameter to the port number of the read-only ApsaraDB RDS for MySQL instance.
    • For more information about how to configure other parameters, see Configure a backup schedule.
  5. In the Edit Backup Objects step, find the database or table that you want to back up and add it to the Selected section. Then, click Next.
    Note
    • If you selected Logical Backup when you purchased a backup schedule, DBS allows you to back up a single table, a single database, multiple databases, or an entire database instance. By default, all the incremental data is backed up during incremental backup.
      • You can click Select All in the lower-left corner of the page 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 created. 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.
    • If you selected Physical Backup when you purchased a backup schedule, you must back up an entire database instance.
  6. In the Configure Backup Time step, configure the parameters that are described in the following table. Then, click Next in the lower-right corner of the page.
    ParameterDescription
    Full-scale Backup Frequency

    The frequency of the backup schedule. Select Periodic Backup or Single Backup based on your business requirements.

    Note In scenarios where 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

    The days of the week on which DBS runs the backup schedule. This parameter must be specified if the Full-scale Backup Frequency parameter is set to Periodic Backup. Select at least one day of the week.

    Start At

    The point in time when a backup starts. This parameter must be specified if the Full-scale Backup Frequency parameter is set to Periodic Backup. We recommend that you specify a point in time during off-peak hours. Example: 01:00.

    Note If 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 database that you want to back up.

    Note
    • This parameter is displayed only if you set the Full-scale Backup Frequency parameter to Periodic Backup.
    • By default, the binary logging feature is enabled for an ApsaraDB RDS for MySQL instance. If you use a self-managed database, you must manually enable the binary logging feature.
    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 needs. Default value: 0, which indicates that the network bandwidth is unlimited.

    Note This parameter is displayed only if you set the Database Type parameter to MySQL.
  7. In the Edit Lifecycle step, configure the lifecycle for full backup data in the Configure Full Data Backup Lifecycle section.
    Note If you set the Incremental Backup parameter to Enable in Step 6, you must configure the lifecycle for incremental backup data.
  8. After the configurations are complete, click Precheck in the lower-right corner of the page.
  9. If the Precheck Passed message appears, click Start Task.
    Note
    • If 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 based on the error code. For more information, see Common Errors and Troubleshooting. If your issue persists after you use the solution that is provided in the "Common Errors and Troubleshooting" topic, contact technical support in the DBS DingTalk group whose ID is 35585947.
    After data is backed up, you can view the backup schedule or restore the backup data. For more information, see View a backup schedule or Restore a database.

Obtain the internal and public endpoints of a read-only ApsaraDB RDS for MySQL instance

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. On the Basic Information page, click See Detail to obtain the internal and public endpoints of the read-only ApsaraDB RDS for MySQL instance.
    Note If you have not applied for a public endpoint for the read-only instance, click Apply for Public Endpoint and OK to apply for a public endpoint. After the public endpoint is applied for, you can obtain the public endpoint.

FAQ

  • Q: What are the possible causes and solutions if the source instance fails to be connected when I configure a backup schedule for the instance by using its internal endpoint?

    A: Possible cause: The internal IP address obtained in Method 2 is a real-time internal IP address. If you clone the source read-only instance, migrate the instance to another zone, or change the VPC or vSwitch of the instance, the real-time internal IP address may change. In this case, the source instance fails to be connected, and the backup fails.

    Solution: You can use the internal endpoint of the read-only instance and run the ping command on your local device to obtain a new real-time internal IP address. Then, reconfigure a backup schedule and save the configurations. 2
  • Q: Can DBS back up full data and incremental data of a read-only ApsaraDB RDS for MySQL instance?

    A: Yes. DBS can back up full data and incremental data of a read-only ApsaraDB RDS for MySQL instance.