This topic describes the benefits of Message Queue for Apache Kafka instances and the working mechanism of migrating a self-managed Apache Kafka cluster to a ApsaraMQ for Kafka instance. This topic also describes the architectures, migration tools, and migration process.

Benefits

For information about the benefits of migrating a self-managed Apache Kafka cluster to ApsaraMQ for Kafka, see Benefits.

Working mechanism

When you migrate a self-managed Apache Kafka cluster to Message Queue for Apache Kafka, you must use the original consumer to consume all messages that are queued in the original Apache Kafka cluster. Producers and consumers are deployed in a cluster. You can migrate the servers that are deployed in the cluster one by one. The migration process is transparent to your upper-layer services.

Migration methods

Description

  • After the migration process is complete, new topics and groups are created in the destination ApsaraMQ for Kafka instance. The configurations of the new topics and groups are the same as the configurations of the original topics and groups. The original topics and groups are retained in the self-managed Apache Kafka cluster.
  • The topics and groups are migrated. The messages that are stored in the original topics, the subscription relationships of the original groups, and the consumer offset information of the original groups are not migrated.
  • When you migrate a self-managed Apache Kafka cluster to a Message Queue for Apache Kafka instance, you can use the migration router feature in the Message Queue for Apache Kafka console or use a migration tool. We recommend that you use the migration router feature to migrate a self-managed Apache Kafka cluster to a Message Queue for Apache Kafka instance, and use a migration tool only when the public endpoint is unavailable for a self-managed Apache Kafka cluster.

Architectures

The following figure shows the architectures before and after you migrate a self-managed Apache Kafka cluster to a ApsaraMQ for Kafka instance.

迁移前后

Migration solutions:

Use the migration router feature

  1. Obtain the public endpoint of the self-managed Apache Kafka cluster.
  2. Create a migration task in the Message Queue for Apache Kafka console.
  3. Create a consumer group in the Message Queue for Apache Kafka instance to consume messages that are sent to the instance.
  4. Create a producer in the Message Queue for Apache Kafka instance, terminate the producer in the self-managed Apache Kafka cluster, and then continue to use the original consumer group to consume messages that are queued in the self-managed Apache Kafka cluster.
  5. After all messages in the self-managed Apache Kafka cluster are consumed by the original consumer group, terminate the consumer group and the self-managed Apache Kafka cluster.

Use a migration tool

  1. Use a migration tool to migrate the data of the self-managed Apache Kafka cluster to the Message Queue for Apache Kafka instance.
  2. Create a consumer group in the Message Queue for Apache Kafka instance to consume messages that are sent to the instance.
  3. Create a producer in the Message Queue for Apache Kafka instance, terminate the producer in the self-managed Apache Kafka cluster, and then continue to use the original consumer group to consume messages that are queued in the self-managed Apache Kafka cluster.
  4. After all messages in the self-managed Apache Kafka cluster are consumed by the original consumer group, terminate the consumer group and the self-managed Apache Kafka cluster.

Use the migration router feature

ApsaraMQ for Kafka provides a fully managed and O&M-free instance migration service for data synchronization between a self-managed instance and a Message Queue for Apache Kafka instance or between Message Queue for Apache Kafka instances. You can migrate instances in the Message Queue for Apache Kafka console without using a migration tool. After the migration is complete, the metadata of the destination cluster is the same as the metadata of the source cluster. The metadata is continuously updated. For more information, see Migration router.

Use a migration tool

Migration tools

Migration toolDescriptionReferences
kafka-migration-assessment.jar
  • You can use this migration tool to export the metadata of a self-managed Apache Kafka cluster as a JSON file. In the ApsaraMQ for Kafka console, create a migration task and upload the JSON file. Then, run the task to migrate the metadata.
  • You can use this migration tool to migrate the topics and consumer groups of a self-managed Apache Kafka cluster to a destination ApsaraMQ for Kafka instance.
MirrorMakerYou can use this migration tool to copy the image of the self-managed Apache Kafka cluster to the destination ApsaraMQ for Kafka instance. Migrate data to the cloud

Migration process

MigrationProceduce
The following items describe the migration process:
  1. Optional:Evaluate instance specifications: Evaluate instance specifications: If you know the specification information about the self-managed Apache Kafka cluster that you want to migrate, such as the traffic, disk capacity, disk type, and number of partitions of the cluster, you can determine the type of ApsaraMQ for Kafka instance that you need to purchase based on the information.

    If you do not know the specification information about the self-managed Apache Kafka cluster that you want to migrate, you can skip this step. If you migrate the metadata of the self-managed Apache Kafka cluster to a new Message Queue for Apache Kafka instance, you can specify a migration tool to collect the specification information about the cluster. Message Queue for Apache Kafka automatically evaluates the specification requirements of the destination instance based on the information that is collected by the migration tool.

  2. Migrate the self-managed Apache Kafka cluster: You can run a command in your command-line interface (CLI) to migrate a specific type of resource in the self-managed Apache Kafka cluster, or create a migration task to migrate all resources in the cluster.
  3. View the migration progress: View the progress of the migration task.
  4. Verify the migration result: View the resource list after the migration is complete.