This topic describes how to migrate the metadata of an open source RabbitMQ cluster to a Message Queue for RabbitMQ instance or a vhost on the instance.
Prerequisites
- Export the metadata that you want to migrate. For more information, see Export the metadata of all vhosts or a specified vhost.
- Create a Message Queue for RabbitMQ instance and a vhost to which you want to migrate the metadata.
- To migrate the metadata of all vhosts in a cluster, create a Message Queue for RabbitMQ instance. For more information, see Create a Message Queue for RabbitMQ instance.
- To migrate the metadata of a vhost in a cluster, create a Message Queue for RabbitMQ instance and a vhost on the instance. For more information, see Create a Message Queue for RabbitMQ instance and Create a vhost.
Background information
Metadata migration is the process of migrating the metadata of an open source RabbitMQ cluster to a Message Queue for RabbitMQ instance. Message Queue for RabbitMQ is a fully managed message queuing service provided by Alibaba Cloud. This service is compatible with open source RabbitMQ. After you export the metadata file of a RabbitMQ cluster and import the file to a Message Queue for RabbitMQ instance, Message Queue for RabbitMQ creates vhosts, queues, exchanges, and bindings in the Message Queue for RabbitMQ instance based on the imported metadata. This way, the metadata of the cluster is migrated to Alibaba Cloud. You can import the metadata of all vhosts to the Message Queue for RabbitMQ instance or import the metadata of a vhost to a vhost on the Message Queue for RabbitMQ instance based on your business requirements.
Note
- If you want to import the metadata of all vhosts, make sure that the imported metadata
file in the JSON format contains the
vhost
data and theexchange
,queue
, andbinding
data in which thevhost
information is included. For more information, see A sample JSON file. - The data of vhosts, exchanges, queues, and bindings in the imported metadata file must comply with the limits on the resource quotas and the limits on the characters that can be used to name resources in Message Queue for RabbitMQ. For more information, see Limits.
- A Message Queue for RabbitMQ instance can run only one task at a time. After the previous task is completed, you can create a new task for the instance.
Metadata compatibility
Message Queue for RabbitMQ is different from open source RabbitMQ in aspects such as access control. Specific metadata of RabbitMQ clusters cannot be imported to Message Queue for RabbitMQ instances. The metadata that cannot be imported is automatically ignored when you import the metadata to Message Queue for RabbitMQ instances. The following table describes the metadata compatibility between RabbitMQ clusters and Message Queue for RabbitMQ instances.
Metadata | Description | Whether the metadata can be imported to Message Queue for RabbitMQ instances |
---|---|---|
rabbit_version | The version of a RabbitMQ cluster. | No |
users | The users of a RabbitMQ cluster. | No
Notice If the metadata file of your RabbitMQ cluster contains the data of users, you can
use Resource Access Management (RAM) to implement the corresponding user management
mechanism after the metadata of the cluster is migrated to a Message Queue for RabbitMQ instance. For more information, see Create a RAM user.
|
vhosts | The vhosts in a RabbitMQ cluster. | Yes |
permissions | The permissions that are granted to users to manage vhosts in a RabbitMQ cluster. | No
Notice If the users of your RabbitMQ cluster are granted permissions to manage vhosts, you
can use RAM to grant the users the required permissions to manage vhosts after the
metadata of the cluster is migrated to a Message Queue for RabbitMQ instance. For more information, see RAM policies.
|
parameters | The runtime parameters for a RabbitMQ cluster. | No |
global_parameters | The global runtime parameters for a RabbitMQ cluster. | No |
policies | The vhost runtime parameters for a RabbitMQ cluster. These parameters include the optional parameters that can be used for exchanges and queues in a vhost. | No
Notice If your RabbitMQ cluster is configured based on the vhost runtime parameters, you
can specify the corresponding optional parameters when you create exchanges and queues
in the Message Queue for RabbitMQ console. After an exchange or a queue is created, you cannot modify the optional
parameters. If you want to modify the optional parameters for an exchange or a queue,
you must delete the exchange or the queue and create another exchange or queue. For
more information, see Create an exchange and Create a queue.
|
queues | The queues of a RabbitMQ cluster. | Yes |
exchanges | The exchanges of a RabbitMQ cluster. | Yes |
bindings | The bindings between the exchanges and queues of a RabbitMQ cluster. | Yes |
Migrate metadata
Related operations
After you create a task to migrate metadata, you can view the details of the imported metadata. If the task fails, you can view the cause of the failure.
- View the imported metadata
- On the Migration to Cloud page, find the migration task that you want to view and click the instance name in the Destination Instance column.
- In the left-side navigation pane, click vhosts. On the page that appears, find the vhost to which you migrate the metadata and click
Details in the Actions column. Then, you can view the vhost details.
For more information, see View details about a vhost.
- View the cause of a failed task
- On the Migration to Cloud page, find the migration task that you want to view and click Details in the Actions column.
You can also perform the following operation: On the Migration to Cloud page, find the migration task that you want to view and click the value in the vhosts for Synchronization, Exchanges for Synchronization, Queues for Synchronization, or Bindings for Synchronization column.
- On the Migration Details page, click the Failed vhosts, Failed Exchanges, Failed Queues, and Failed Bindings tabs to view the failure cause.
- On the Migration to Cloud page, find the migration task that you want to view and click Details in the Actions column.