Smooth scale-out

Updated at:

This topic describes the operations for smooth scale-out.

The smooth scale-out process includes four steps: configuration, migration, switchover, and cleanup. For more information about the basic principles of smooth scale-out, see Smooth scale-out.

Figure 1. Diagram456789

Configure the scale-out task

  1. Log on to the PolarDB-X console and select the region where the target instance is located.
  2. In the left-side navigation pane, click Instances.

  3. Find the instance and click the instance ID to go to the Basic Information page.

  4. In the menu on the left, click Database Management, and then click the database name.
  5. In the menu on the left, click Configuration and Management > Scale-out Management.
  6. Click Scale-out.
  7. Set Scale-out Mode to Smooth Scale-out and click Next.
  8. After a successful dry run, click Next.
  9. On the RDS Instance Selection page, select an existing RDS instance or purchase a new one. Click Next to go to the preview page.
    Important
    • To avoid affecting the production environment, purchase a new RDS instance for the smooth scale-out.
    • For a privileged RDS instance, enter the privileged account and password.
  10. On the preview page, the console evenly allocates the physical sharded databases to the new RDS instance by default. You can also manually add or delete physical sharded databases on the new RDS instance. Click the Start Scale-out button to submit the smooth scale-out task. The task then runs asynchronously.

    You can view the status of the scale-out task in the task box in the upper-right corner of the Database Management page until the task is complete.

Migration

After you add the new RDS instance, the smooth scale-out process migrates some of the physical sharded databases.

The migration task does not change the data in the original database and does not affect online services. Before the switchover, you can roll back the changes to cancel this smooth scale-out operation.

Note
  • Before the switchover, the scale-out does not affect the data in the original database. Therefore, you can roll back the changes to cancel the scale-out at any time before the switchover.
  • During the scale-out, the cleanup of binary logging (Binlog) files on the source RDS instance is stopped. This may cause insufficient disk space. Make sure to reserve enough disk space on the source RDS instance. We recommend reserving at least 30% of the total disk space.
  • The scale-out process puts read pressure on the original RDS instance. Perform this operation during off-peak hours.
  • During the scale-out, do not submit Data Definition Language (DDL) tasks in the console or execute DDL statements by directly connecting to PolarDB-X 1.0. Otherwise, the scale-out task will fail.
  • For the scale-out, ensure that all tables in the source database have primary keys. If not, add them beforehand.

After the historical data and incremental data are migrated, the migration task progress reaches 100%. At this point, you can perform the switchover or roll back the changes to cancel the scale-out.

Switchover

The switchover task switches read and write traffic to the new RDS instance. The process takes 3 to 5 minutes to complete. During the switchover, services are not affected, except for one or two transient disconnections.

Important Perform the switchover during off-peak hours.

In the task list, click the Switchover button, and then click Confirm to start the switchover. The process generates a switchover task that is displayed in the task progress.

After the switchover is complete, the Cleanup button appears in the task progress, which indicates that the switchover task is finished.

Cleanup

Warning
  • The cleanup task deletes the databases that are no longer used after the scale-out. Consider backing up the databases before you perform this operation.
  • The cleanup operation puts some pressure on the database. Perform this operation during off-peak hours.

After the switchover is complete, click the Cleanup button and then click Confirm. This step deletes the migrated sharded databases from the original RDS instance. The cleanup task is also an asynchronous task. You can view its execution status in the task progress.

After the cleanup task is complete, the entire smooth scale-out process ends. The new RDS instance becomes the new storage node for the corresponding logical database of PolarDB-X 1.0.

Currently, smooth scale-out is achieved by migrating physical sharded databases. If a sharded database exceeds the capacity of a single RDS instance after scaling out to a certain extent and you cannot perform further smooth scale-out, you can contact us to request an increase in the number of sharded databases and continue to scale out. In this case, the data is rehashed and reallocated.