tencent cloud

Feedback

Metadata Migration

Last updated: 2023-05-16 11:01:37

    Overview

    When using a TDMQ for RocketMQ cluster, you may need to migrate your existing business, for example, from a self-built or third-party RocketMQ cluster to the TDMQ for RocketMQ cluster.
    This document describes how to migrate metadata from self-built open-source RocketMQ to TDMQ for RocketMQ.
    Note
    Both dedicated clusters and virtual clusters support metadata migration, and the migration steps are the same.

    Prerequisites

    You have created a cluster advance and a namespace in the console.

    Directions

    Step 1. Export the metadata file

    If you are using self-built open-source RocketMQ, you can export metadata in the following two ways:

    Option 1

    If your RocketMQ server can access the public network, run the following script on your server directly (if there are multiple servers in your RocketMQ cluster, you can run the script on any server as long as the network is interconnected in the cluster).
    /bin/bash -c "$(curl -fsSL https://rocketmq-1306598660.cos.ap-guangzhou.myqcloud.com/rocketmq-export.sh)"

    Option 2

    If your RocketMQ server has no permission to access the public network, follow the steps below:
    1. Download the migration tool.
    2. Upload the tool to your self-built RocketMQ cluster (if there are multiple servers in your RocketMQ cluster, you can run the tool on any server as long as the network is interconnected in the cluster).
    3. Decompress the tool and enter the directory.
    unzip rocketmq-migration.zip
    cd rocketmq-migration
    4. Run the following command for migration.
    ./bin/export.sh
    // Enter the open-source RocketMQ address, such as `localhost:9876`
    Enter name server address list:localhost:9876
    // Select a cluster to export, such as `DefaultCluster`
    Choose a cluster to export:DefaultCluster
    // Enter a directory for saving the exported metadata, which is `/tmp/rocketmq/config/rocketmq-metadata-export.json` by default.
    Enter file path to export [default /tmp/rocketmq/export]:

    Step 2. Create a migration task

    1. Log in to the TDMQ for RocketMQ console and enter the Migration to Cloud page, enter the migration task list page, and click Create Task to create a corresponding migration task.
    2. Select the migration task type:
    Cluster migration: This type of task migrates metadata from the self-built RocketMQ cluster to the TDMQ for RocketMQ cluster. The migration tool will parse the part before “%” of each topic name in the open-source dashboard as the namespace name by default, so that you can create multiple logically isolated namespaces. If no topic name can be parsed in the self-built cluster, a namespace named default will be generated automatically.
    Specified namespace import: This type of task migrates metadata from the self-built RocketMQ cluster to a specified TDMQ for RocketMQ namespace. If there are no namespaces in topics in the self-built cluster, you can select specific topics and groups you want to import, and specify the TDMQ for RocketMQ namespaces to which they are imported to distinguish between businesses or environments.
    3. Upload the metadata file obtained in step 1 and select the topics and groups you want to import.
    Note
    Up to 1,000 topics and 1,000 groups can be imported in a single task. Excess data will fail to be imported.

    Step 3. Check the task status

    After the task is successfully created, enter the task list to view the task status. If there is too much data, the task needs to load for a while. Click View Details to view the specific running status of the task.
    If the task status is Some failed or All failed, you can filter causes of the failures in the Task Status column.
    
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support