Skip to content

Commit 2693c48

Browse files
committed
Merge branch 'live' of github.com:rabbitmq/rabbitmq-website into live
2 parents d492a28 + ae7a5d6 commit 2693c48

File tree

3 files changed

+35
-27
lines changed

3 files changed

+35
-27
lines changed

site/documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ for the original RabbitMQ protocol.
147147
### Replicated Queue Types, Streams, High Availability
148148

149149
* [Quorum Queues](quorum-queues.html): a modern highly available replicated queue type
150-
* [Migrating your Mirrored Classic Queues to Quorum Queues](./migrate-mcq-to-qq.html)
150+
* [Classic Mirrored Queue to Quorum Queue migration](./migrate-mcq-to-qq.html) guide
151151
* [Streams](streams.html): a messaging abstraction that allows for repeatable consumption
152152
* [RabbitMQ Stream plugin](stream.html): the plugin and binary protocol behind RabbitMQ streams
153153

site/migrate-mcq-to-qq.md

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ See the License for the specific language governing permissions and
1515
limitations under the License.
1616
-->
1717

18-
## Migrate your RabbitMQ Mirrored Classic Queues to Quorum Queues
18+
# Migrate your RabbitMQ Mirrored Classic Queues to Quorum Queues
1919

20-
Which is better: mirrored classic queues or quorum queues? Quorum Queues are the much better choice and they will be the only choice starting with RabbitMQ version 4.0. This information explains why, the reasons why you should migrate from mirrored classic queues to quorum queues, the ways to handle features during the migration, and includes procedures for some of the migration routes you can take.
20+
Which is better: mirrored classic queues or quorum queues? Quorum Queues are the much better choice and they will be [the only option starting with RabbitMQ version 4.0](https://blog.rabbitmq.com/posts/2021/08/4.0-deprecation-announcements/). This information explains why, the reasons why you should migrate from mirrored classic queues to quorum queues, the ways to handle features during the migration, and includes procedures for some of the migration routes you can take.
2121

2222
You should migrate to mirrored classic queues for the following reasons:
2323

@@ -39,9 +39,11 @@ Incompatible features can be either referenced in policies or in the source code
3939

4040
The general policies and arguments related to mirroring are:`ha-mode`, `ha-params` `ha-sync-mode`, `ha-promote-on-shutdown`, `ha-promote-on-failure`, and `queue-master-locator`.
4141

42-
The migration process you take can be one of the following:
43-
* [Migrating the Queues by Virtual Host](#migrate-the-queues-by-virtual-host) is probably the most efficient migration path you can take if it is an option for you. If all the incompatible features are cleaned up or moved to policies, the existing code should work with both mirrored classic queues and quorum queues. You only need to change the connection parameters to connect to the new virtual host that you created for the quorum queues.
44-
* [Migrating in Place](#migrate-in-place) means you re-use the same virtual host. You must be able to stop all consumers and producers for a given queue while the migration is in progress.
42+
There are several migration paths available:
43+
44+
* [Blue-Green Deployment](./blue-green-upgrade.html)
45+
* [Migrating the Queues by Virtual Host](#migrate-the-queues-by-virtual-host) is probably the most efficient migration path you can take if it is an option for you. If all the incompatible features are cleaned up or moved to policies, the existing code should work with both mirrored classic queues and quorum queues. You only need to change the connection parameters to connect to the new virtual host that you created for the quorum queues
46+
* [Migrating in Place](#migrate-in-place) means you re-use the same virtual host. You must be able to stop all consumers and producers for a given queue while the migration is in progress
4547

4648
Before deciding which migration method you can use, you must first find the mirrored classic queues and the features they are using.
4749

@@ -51,25 +53,26 @@ To find the mirrored classic queues that must be migrated, run the following scr
5153

5254
Note, the following command uses `effective_policy_definition` parameters, which are only available since RabbitMQ version 3.10.13/3.11.5. If it's not available, you can use `rabbitmqctl` from any RabbitMQ version later than 3.10.13/3.11.5, or manually match the policy name to it's definition.
5355

54-
```bash
56+
<pre class="lang-bash">
5557
#!/bin/sh
5658
printf "%s\t%s\t%s\n" vhost queue_name mirrors
5759
for vhost in $(rabbitmqctl -q list_vhosts | tail -n +2) ; do
5860
rabbitmqctl -q list_queues -p "$vhost" name durable policy effective_policy_definition arguments mirror_pids type |
5961
sed -n '/\t\[[^\t]\+\tclassic$/{s/\t\[[^\t]\+\tclassic$//; p}' |
6062
xargs -x -r -L1 -d '\n' printf "%s\t%s\n" "$vhost"
6163
done
62-
```
64+
</pre>
65+
6366
All mirrored classic queues that include `ha-mode` in their effective policy definition must be migrated to a different type of queue. All these queues are listed as mirrored classic queues in the Management UI and CLI. Find the policies that apply it by running the following script:
6467

65-
```bash
68+
<pre class="lang-bash">
6669
#!/bin/sh
6770
printf "%s\t%s\t%s\t%s\t%s\t%s\n" vhost policy_name pattern apply_to definition priority
6871
for vhost in $(rabbitmqctl -q list_vhosts | tail -n +2) ; do
6972
rabbitmqctl -q list_policies -p "$vhost" |
7073
grep 'ha-mode'
7174
done
72-
```
75+
</pre>
7376

7477
## <a id="mcq-changes-way-queue-is-used" class="anchor" href="#mcq-changes-way-queue-is-used">Mirrored Classic Queue Features that require Changes in the Way the Queue is Used</a>
7578

@@ -96,15 +99,15 @@ Global [QoS prefetch](https://rabbitmq.com/quorum-queues.html#global-qos) where
9699

97100
To find out if this feature is used, run the following command on a running system and check for non-empty output:
98101

99-
```bash
102+
<pre class="lang-bash">
100103
rabbitmqctl list_channels pid name global_prefetch_count | sed -n '/\t0$/!p'
101-
```
104+
</pre>
102105

103106
A list of channel PIDs that have global QoS turned on are returned. Then, run the following command to map the channel PID to a queue name to verify if it is a mirrored classic queue.
104107

105-
```bash
108+
<pre class="lang-bash">
106109
rabbitmqctl list_consumers queue_name channel_pid
107-
```
110+
</pre>
108111

109112
### `x-cancel-on-ha-failover` for Consumers
110113

@@ -183,11 +186,12 @@ URI pointing to the OLD\_VHOST: `amqp:///OLD_VHOST`. (Note that the
183186
default vhost URI is `amqp:///%2f`).
184187

185188
The federation upstream can be created using the management UI or the CLI:
186-
```bash
189+
190+
<pre class="lang-bash">
187191
rabbitmqctl set_parameter federation-upstream quorum-migration-upstream \
188192
--vhost NEW_VHOST \
189193
'{"uri":"amqp:///OLD_VHOST", "trust-user-id":true}'
190-
```
194+
</pre>
191195

192196
When this form of URI with an empty hostname is used, there is no
193197
need to specify credentials. Connection is only possible within
@@ -198,13 +202,13 @@ preserved as shown in the previous CLI example.
198202

199203
### Moving Definitions
200204

201-
Export the definitions from the source virtual host to a file. This is
205+
Export the [definitions](./definitions.html) from the source virtual host to a file. This is
202206
available on the **Overview** page of the management UI (don't forget to
203207
select a single virtual host). Alternatively, you can export the definitions using the CLI with the following command:
204208

205-
```bash
209+
<pre class="lang-bash">
206210
rabbitmqadmin export -V OLD_VHOST OLD_VHOST.json
207-
```
211+
</pre>
208212

209213
Make the following changes to this file before loading it back into the NEW_VHOST:
210214

@@ -232,9 +236,9 @@ Make the following changes to this file before loading it back into the NEW_VHOS
232236
Now the modified schema can be loaded into the new virtual host from the Management
233237
UI or by running the following command from the CLI:
234238

235-
```bash
239+
<pre class="lang-bash">
236240
rabbitadmin import -V NEW_VHOST NEW_VHOST.json
237-
```
241+
</pre>
238242

239243
### Point Consumers to use Quorum Queues in the New Virtual Host
240244

@@ -255,16 +259,18 @@ virtual host, and start consumers on the new virtual host.
255259

256260
For every non-empty queue in the old virtual host, a shovel needs to be configured. For example:
257261

258-
```bash
262+
<pre class="lang-bash">
259263
rabbitmqctl set_parameter shovel migrate-QUEUE_TO_MIGRATE \
260264
'{"src-protocol": "amqp091", "src-uri": "amqp:///OLD_VHOST", "src-queue": "QUEUE_TO_MIGRATE",
261265
"dest-protocol": "amqp091", "dest-uri": "amqp:///NEW_VHOST", "dest-queue": "QUEUE_TO_MIGRATE"}'
262-
```
266+
</pre>
263267

264268
After the queue is drained, the shovel can be deleted:
265-
```bash
269+
270+
<pre class="lang-bash">
266271
rabbitmqctl clear_parameter shovel migrate-QUEUE_TO_MIGRATE
267-
```
272+
</pre>
273+
268274
## <a id="migrate-in-place" class="anchor" href="#migrate-in-place">Migrate in Place</a>
269275

270276
Migrating this way trades uptime so that you can

site/quorum-queues.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ limitations under the License.
2121

2222
The quorum queue is a modern queue type for RabbitMQ implementing a durable,
2323
replicated FIFO queue based on the [Raft consensus algorithm](https://raft.github.io/).
24-
It is available as of RabbitMQ 3.8.0.
2524

26-
Quorum queues and [streams](./streams.html) now replace the original replicated [mirrored classic queues](./ha.html). Mirrored classic queues are [now deprecated and scheduled for removal](https://blog.rabbitmq.com/posts/2021/08/4.0-deprecation-announcements/). You can [Migrate your RabbitMQ Mirrored Classic Queues to Quorum Queues]() now.
25+
Quorum queues and [streams](./streams.html) replace durable [mirrored queues](ha.html), the original
26+
replicated queue type which is [now deprecated and scheduled for removal](https://blog.rabbitmq.com/posts/2021/08/4.0-deprecation-announcements/).
27+
A separate [migration guide](./migrate-mcq-to-qq.html) explains the options for installations that use
28+
classic mirrored queues.
2729

2830
Quorum queues are optimized for [set of use cases](#use-cases) where [data safety](#data-safety) is
2931
a top priority. This is covered in [Motivation](#motivation).

0 commit comments

Comments
 (0)