You can migrate metadata to the cloud by exporting it from your open source RabbitMQ cluster and importing it into an ApsaraMQ for RabbitMQ instance. After a successful import, ApsaraMQ for RabbitMQ uses the metadata to create the corresponding vhosts, queues, exchanges, and bindings in the destination ApsaraMQ for RabbitMQ instance. You can export metadata for all vhosts or for a specific vhost from your open source RabbitMQ cluster.
Prerequisites
-
Create an ApsaraMQ for RabbitMQ instance and a vhost to serve as the migration destination. For more information, see Create an instance and Create a vhost.
NoteWe recommend selecting a Serverless dedicated instance. This instance type supports open source authentication and permissions, enabling a seamless migration from open source RabbitMQ.
Background
RabbitMQ cluster metadata includes information such as users, vhosts, queues, exchanges, routing keys, permissions, and parameters. This metadata is stored in the internal database of the RabbitMQ cluster and automatically replicated across all nodes. The metadata on each node in the cluster is identical.
Limitations
Different limitations apply based on the instance's authentication and permission model. We recommend using an instance with the open source authentication and permission model for your migration.
-
Open source authentication and permission management
-
Due to certain differences between open source RabbitMQ and ApsaraMQ for RabbitMQ, the
rabbit_version,parameters,global_parameters, andpoliciesmetadata are not supported for import into ApsaraMQ for RabbitMQ instances and are automatically ignored during the import. -
Importing the guest user is not supported. If the metadata contains the guest user, the user and its permissions are ignored during import.
-
You can import users without passwords, but they cannot establish a connection.
-
Because ApsaraMQ for RabbitMQ does not support permission management by user tags, the
tagsattribute in theusersdata will not be imported.
-
-
Resource Access Management (RAM)
Due to the differences in permission management between open source RabbitMQ and Alibaba Cloud's Resource Access Management (RAM), the
rabbit_version,users,permissions,parameters,global_parameters, andpoliciesmetadata cannot be imported into an ApsaraMQ for RabbitMQ instance and is automatically ignored during the import process.
Export metadata from open source RabbitMQ
You can export metadata for all vhosts or for a specific vhost.
Open source console
-
In a web browser, open the open source RabbitMQ console.
Open source RabbitMQ console URL:
http://<Your RabbitMQ IP address>:15672/ -
On the login page, enter your username in the Username field and your password in the Password field, and then click Login.
-
On the Overview tab, click Export definitions. From the Virtual host drop-down list, select All or a specific vhost name, and then click Download broker definitions.
The following options are available in the Virtual host list:
-
All: Exports metadata for all vhosts.
-
Vhost name: Exports metadata for the specified vhost.
-
-
Save the downloaded metadata file to your local computer.
Open source API
-
Open your terminal.
-
Run the appropriate command to export the metadata file.
-
Export metadata for all vhosts
wget --user <Your RabbitMQ username> --password <Your RabbitMQ password> http://<Your RabbitMQ IP address>:15672/api/definitions -O <Path to save your metadata file> -
Export metadata for a specific vhost
wget --user <Your RabbitMQ username> --password <Your RabbitMQ password> http://<Your RabbitMQ IP address>:15672/api/definitions -O <Path to save your metadata file> --vhost <Vhost name>
-
Import metadata into ApsaraMQ for RabbitMQ
-
Log in to the ApsaraMQ for RabbitMQ console. In the left-side navigation pane, click Migration to Cloud.
-
On the Migration to Cloud page, select a region in the top navigation bar. Then, in the upper-left corner of the page, click Create Task.
-
In the Create Task panel, configure the parameters and click OK.
Parameter
Description
Example
Instance
The destination instance for the metadata migration.
amqp-cn-7mz2cjgk****
Import Method
-
ALL: Imports all vhost metadata from an open source RabbitMQ to an ApsaraMQ for RabbitMQ instance.
-
Vhost: Import metadata from a specified vhost of open source RabbitMQ into a vhost of the ApsaraMQ for RabbitMQ instance.
Vhost
vhost
The destination vhost in the ApsaraMQ for RabbitMQ instance. This parameter appears only when you set Import Method to Vhost.
test-vhost****
Metadata
The metadata file to import. Click Select File, choose the metadata file from your local computer, and then click Open.
NoteThe metadata file cannot exceed 20 MB in size.
rabbit_mq-amqp-load-test011122063****
After creating a migration task, you can view the details of the imported metadata and the causes of any task failures.
-
View the imported metadata
-
On the Migration to Cloud page, find the target task and click the instance name in the Destination Instance column.
-
In the left-side navigation pane, click Vhosts. Find the target vhost and click Details in the Actions column to view detailed information about the vhost.
For more information, see View vhost connection details.
-
-
View the details of a failed task
-
On the Migration to Cloud page, find the target task and click Details in the Actions column.
Alternatively, on the Migration to Cloud page, you can click the synchronized metadata count for the target task.
-
On the Migration Details page, click the Vhost, Exchange, Queue, or Binding tab to view the reason for the failure.
-
-