1RABBITMQCTL(8) BSD System Manager's Manual RABBITMQCTL(8)
2
4 rabbitmqctl — tool for managing RabbitMQ nodes
5
7 rabbitmqctl [-q] [-s] [-l] [-n node] [-t timeout] command
8 [command_options]
9
11 RabbitMQ is an open source multi-protocol messaging broker.
12
13 rabbitmqctl is the main command line tool for managing a RabbitMQ server
14 node, together with rabbitmq-diagnostics , rabbitmq-upgrade , and others.
15
16 It performs all actions by connecting to the target RabbitMQ node on a
17 dedicated CLI tool communication port and authenticating using a shared
18 secret (known as the cookie file).
19
20 Diagnostic information is displayed if connection failed, the target node
21 was not running, or rabbitmqctl could not authenticate to the target node
22 successfully.
23
24 To learn more, see the RabbitMQ CLI Tools guide:
25 https://rabbitmq.com/cli.html
26
28 -n node
29 Default node is "rabbit@target-hostname", where target-hostname
30 is the local host. On a host named "myserver.example.com", the
31 node name will usually be "rabbit@myserver" (unless
32 RABBITMQ_NODENAME has been overridden). The output of "hostname
33 -s" is usually the correct suffix to use after the "@" sign. See
34 rabbitmq-server(8) for details of configuring a RabbitMQ node.
35
36 -q, --quiet
37 Quiet output mode is selected. Informational messages are re‐
38 duced when quiet mode is in effect.
39
40 -s, --silent
41 Silent output mode is selected. Informational messages are re‐
42 duced and table headers are suppressed when silent mode is in ef‐
43 fect.
44
45 --no-table-headers
46 Do not output headers for tabular data.
47
48 --dry-run
49 Do not run the command. Only print information message.
50
51 -t timeout, --timeout timeout
52 Operation timeout in seconds. Not all commands support timeouts.
53 Default is infinity.
54
55 -l, --longnames
56 Must be specified when the cluster is configured to use long
57 (FQDN) node names. To learn more, see the RabbitMQ Clustering
58 guide: https://www.rabbitmq.com/clustering.html
59
60 --erlang-cookie cookie
61 Shared secret to use to authenticate to the target node. Prefer
62 using a local file or the RABBITMQ_ERLANG_COOKIE environment
63 variable instead of specifying this option on the command line.
64 To learn more, see the RabbitMQ CLI Tools guide:
65 https://www.rabbitmq.com/cli.html
66
68 help [-l] [command_name]
69
70 Prints usage for all available commands.
71
72 -l, --list-commands
73 List command usages only, without parameter explanation.
74
75 command_name
76 Prints usage for the specified command.
77
78 version
79
80 Displays CLI tools version
81
82 Nodes
83 await_startup
84
85 Waits for the RabbitMQ application to start on the target node
86
87 For example, to wait for the RabbitMQ application to start:
88
89 rabbitmqctl await_startup
90
91 reset
92
93 Returns a RabbitMQ node to its virgin state.
94
95 Removes the node from any cluster it belongs to, removes all data
96 from the management database, such as configured users and
97 vhosts, and deletes all persistent messages.
98
99 For reset and force_reset to succeed the RabbitMQ application
100 must have been stopped, e.g. with stop_app.
101
102 For example, to reset the RabbitMQ node:
103
104 rabbitmqctl reset
105
106 rotate_logs
107
108 Instructs the RabbitMQ node to perform internal log rotation.
109
110 Log rotation is performed according to the logging settings spec‐
111 ified in the configuration file. The rotation operation is asyn‐
112 chronous, there is no guarantee that it has completed when this
113 command returns.
114
115 Note that there is no need to call this command in case of exter‐
116 nal log rotation (e.g. from logrotate(8)).
117
118 For example, to initial log rotation:
119
120 rabbitmqctl rotate_logs
121
122 shutdown
123
124 Shuts down the node, both RabbitMQ and its runtime. The command
125 is blocking and will return after the runtime process exits. If
126 RabbitMQ fails to stop, it will return a non-zero exit code.
127 This command infers the OS PID of the target node and therefore
128 can only be used to shut down nodes running on the same host (or
129 broadly speaking, in the same operating system, e.g. in the same
130 VM or container)
131
132 Unlike the stop command, the shutdown command:
133
134 • does not require a pid_file to wait for the runtime process
135 to exit
136
137 • returns a non-zero exit code if RabbitMQ node is not running
138
139 For example, this will shut down a locally running RabbitMQ node
140 with default node name:
141
142 rabbitmqctl shutdown
143
144 start_app
145
146 Starts the RabbitMQ application.
147
148 This command is typically run after performing other management
149 actions that required the RabbitMQ application to be stopped,
150 e.g. reset.
151
152 For example, to instruct the RabbitMQ node to start the RabbitMQ
153 application:
154
155 rabbitmqctl start_app
156
157 stop [pid_file]
158
159 Stops the Erlang node on which RabbitMQ is running. To restart
160 the node follow the instructions for "Running the Server" in the
161 installation guide: https://rabbitmq.com/download.html
162
163 If a pid_file is specified, also waits for the process specified
164 there to terminate. See the description of the wait command for
165 details on this file.
166
167 For example, to instruct the RabbitMQ node to terminate:
168
169 rabbitmqctl stop
170
171 stop_app
172
173 Stops the RabbitMQ application, leaving the runtime (Erlang VM)
174 running.
175
176 This command is typically run prior to performing other manage‐
177 ment actions that require the RabbitMQ application to be stopped,
178 e.g. reset.
179
180 For example, to instruct the RabbitMQ node to stop the RabbitMQ
181 application:
182
183 rabbitmqctl stop_app
184
185 wait pid_file, wait --pid pid
186
187 Waits for the RabbitMQ application to start.
188
189 This command will wait for the RabbitMQ application to start at
190 the node. It will wait for the pid file to be created if pidfile
191 is specified, then for a process with a pid specified in the pid
192 file or the --pid argument, and then for the RabbitMQ application
193 to start in that process. It will fail if the process terminates
194 without starting the RabbitMQ application.
195
196 If the specified pidfile is not created or erlang node is not
197 started within --timeout the command will fail. Default timeout
198 is 10 seconds.
199
200 A suitable pid file is created by the rabbitmq-server(8) script.
201 By default this is located in the Mnesia directory. Modify the
202 RABBITMQ_PID_FILE environment variable to change the location.
203
204 For example, this command will return when the RabbitMQ node has
205 started up:
206
207 rabbitmqctl wait /var/run/rabbitmq/pid
208
209 Cluster management
210 await_online_nodes count
211
212 Waits for count nodes to join the cluster
213
214 For example, to wait for two RabbitMQ nodes to start:
215
216 rabbitmqctl await_online_nodes 2
217
218 change_cluster_node_type type
219
220 Changes the type of the cluster node.
221
222 The type must be one of the following:
223 • disc
224 • ram
225
226 The node must be stopped for this operation to succeed, and when
227 turning a node into a RAM node the node must not be the only disc
228 node in the cluster.
229
230 For example, this command will turn a RAM node into a disc node:
231
232 rabbitmqctl change_cluster_node_type disc
233
234 cluster_status
235
236 Displays all the nodes in the cluster grouped by node type, to‐
237 gether with the currently running nodes.
238
239 For example, this command displays the nodes in the cluster:
240
241 rabbitmqctl cluster_status
242
243 force_boot
244
245 Ensures that the node will start next time, even if it was not
246 the last to shut down.
247
248 Normally when you shut down a RabbitMQ cluster altogether, the
249 first node you restart should be the last one to go down, since
250 it may have seen things happen that other nodes did not. But
251 sometimes that's not possible: for instance if the entire cluster
252 loses power then all nodes may think they were not the last to
253 shut down.
254
255 In such a case you can invoke force_boot while the node is down.
256 This will tell the node to unconditionally start next time you
257 ask it to. If any changes happened to the cluster after this
258 node shut down, they will be lost.
259
260 If the last node to go down is permanently lost then you should
261 use forget_cluster_node --offline in preference to this command,
262 as it will ensure that mirrored queues which had their leader
263 replica on the lost node get promoted.
264
265 For example, this will force the node not to wait for other nodes
266 next time it is started:
267
268 rabbitmqctl force_boot
269
270 force_reset
271
272 Forcefully returns a RabbitMQ node to its virgin state.
273
274 The force_reset command differs from reset in that it resets the
275 node unconditionally, regardless of the current management data‐
276 base state and cluster configuration. It should only be used as
277 a last resort if the database or cluster configuration has been
278 corrupted.
279
280 For reset and force_reset to succeed the RabbitMQ application
281 must have been stopped, e.g. with stop_app.
282
283 For example, to reset the RabbitMQ node:
284
285 rabbitmqctl force_reset
286
287 forget_cluster_node [--offline]
288
289 --offline
290 Enables node removal from an offline node. This is only
291 useful in the situation where all the nodes are offline
292 and the last node to go down cannot be brought online,
293 thus preventing the whole cluster from starting. It
294 should not be used in any other circumstances since it
295 can lead to inconsistencies.
296
297 Removes a cluster node remotely. The node that is being removed
298 must be offline, while the node we are removing from must be on‐
299 line, except when using the --offline flag.
300
301 When using the --offline flag , rabbitmqctl will not attempt to
302 connect to a node as normal; instead it will temporarily become
303 the node in order to make the change. This is useful if the node
304 cannot be started normally. In this case the node will become
305 the canonical source for cluster metadata (e.g. which queues ex‐
306 ist), even if it was not before. Therefore you should use this
307 command on the latest node to shut down if at all possible.
308
309 For example, this command will remove the node "rabbit@stringer"
310 from the node "hare@mcnulty":
311
312 rabbitmqctl -n hare@mcnulty forget_cluster_node
313 rabbit@stringer
314
315 join_cluster seed-node [--ram]
316
317 seed-node
318 Existing cluster member (seed node) to cluster with.
319
320 --ram If provided, the node will join the cluster as a RAM
321 node. RAM node use is discouraged. Use only if you un‐
322 derstand why exactly you need to use them.
323
324 Instructs the node to become a member of the cluster that the
325 specified node is in. Before clustering, the node is reset, so
326 be careful when using this command. For this command to succeed
327 the RabbitMQ application must have been stopped, e.g. with
328 stop_app.
329
330 Cluster nodes can be of two types: disc or RAM. Disc nodes
331 replicate data in RAM and on disc, thus providing redundancy in
332 the event of node failure and recovery from global events such as
333 power failure across all nodes. RAM nodes replicate data in RAM
334 only (with the exception of queue contents, which can reside on
335 disc if the queue is persistent or too big to fit in memory) and
336 are mainly used for scalability. RAM nodes are more performant
337 only when managing resources (e.g. adding/removing queues, ex‐
338 changes, or bindings). A cluster must always have at least one
339 disc node, and usually should have more than one.
340
341 The node will be a disc node by default. If you wish to create a
342 RAM node, provide the --ram flag.
343
344 After executing the join_cluster command, whenever the RabbitMQ
345 application is started on the current node it will attempt to
346 connect to the nodes that were in the cluster when the node went
347 down.
348
349 To leave a cluster, reset the node. You can also remove nodes
350 remotely with the forget_cluster_node command.
351
352 For example, this command instructs the RabbitMQ node to join the
353 cluster that "hare@elena" is part of, as a ram node:
354
355 rabbitmqctl join_cluster hare@elena --ram
356
357 To learn more, see the RabbitMQ Clustering guide:
358 https://www.rabbitmq.com/clustering.html
359
360 rename_cluster_node oldnode1 newnode1 [oldnode2 newnode2 ...]
361
362 Supports renaming of cluster nodes in the local database.
363
364 This subcommand causes rabbitmqctl to temporarily become the node
365 in order to make the change. The local cluster node must there‐
366 fore be completely stopped; other nodes can be online or offline.
367
368 This subcommand takes an even number of arguments, in pairs rep‐
369 resenting the old and new names for nodes. You must specify the
370 old and new names for this node and for any other nodes that are
371 stopped and being renamed at the same time.
372
373 It is possible to stop all nodes and rename them all simultane‐
374 ously (in which case old and new names for all nodes must be
375 given to every node) or stop and rename nodes one at a time (in
376 which case each node only needs to be told how its own name is
377 changing).
378
379 For example, this command will rename the node
380 "rabbit@misshelpful" to the node "rabbit@cordelia"
381
382 rabbitmqctl rename_cluster_node rabbit@misshelpful
383 rabbit@cordelia
384
385 Note that this command only changes the local database. It may
386 also be necessary to rename the local database directories, and
387 to configure the new node name. For example:
388
389 1. Stop the node:
390
391 rabbitmqctl stop rabbit@misshelpful
392
393 2. Rename the node in the local database:
394
395 rabbitmqctl rename_cluster_node rabbit@misshelpful
396 rabbit@cordelia
397
398 3. Rename the local database directories (note, you do not need
399 to do this if you have set the RABBITMQ_MNESIA_DIR environ‐
400 ment variable):
401
402 mv \
403 /var/lib/rabbitmq/mnesia/rabbit\@misshelpful \
404 /var/lib/rabbitmq/mnesia/rabbit\@cordelia
405 mv \
406 /var/lib/rabbitmq/mnesia/rabbit\@misshelpful-rename \
407 /var/lib/rabbitmq/mnesia/rabbit\@cordelia-rename
408 mv \
409 /var/lib/rabbitmq/mnesia/rabbit\@misshelpful-plugins-expand \
410 /var/lib/rabbitmq/mnesia/rabbit\@cordelia-plugins-expand
411
412 4. If node name is configured e.g. using
413 /etc/rabbitmq/rabbitmq-env.conf it has also be updated
414 there.
415
416 5. Start the node when ready
417
418 update_cluster_nodes clusternode
419
420 clusternode
421 The node to consult for up-to-date information.
422
423 Instructs an already clustered node to contact clusternode to
424 cluster when booting up. This is different from join_cluster
425 since it does not join any cluster - it checks that the node is
426 already in a cluster with clusternode.
427
428 The need for this command is motivated by the fact that clusters
429 can change while a node is offline. Consider a situation where
430 node rabbit@A and rabbit@B are clustered. rabbit@A goes down,
431 rabbit@C clusters with rabbit@B, and then rabbit@B leaves the
432 cluster. When rabbit@A starts back up, it'll try to contact
433 rabbit@B, but this will fail since rabbit@B is not in the cluster
434 anymore. The following command will rename node rabbit@B to
435 rabbit@C on node rabbitA
436
437 update_cluster_nodes -n rabbit@A rabbit@B rabbit@C
438
439 To learn more, see the RabbitMQ Clustering guide:
440 https://www.rabbitmq.com/clustering.html
441
442 Replication
443 sync_queue [-p vhost] queue
444
445 queue The name of the queue to synchronise.
446
447 Instructs a mirrored queue with unsynchronised mirrors (follower
448 replicas) to synchronise them. The queue will block while syn‐
449 chronisation takes place (all publishers to and consumers using
450 the queue will block or temporarily see no activity). This com‐
451 mand can only be used with mirrored queues. To learn more, see
452 the RabbitMQ Mirroring guide: https://www.rabbitmq.com/ha.html
453
454 Note that queues with unsynchronised replicas and active con‐
455 sumers will become synchronised eventually (assuming that con‐
456 sumers make progress). This command is primarily useful for
457 queues which do not have active consumers.
458
459 cancel_sync_queue [-p vhost] queue
460
461 queue The name of the queue to cancel synchronisation for.
462
463 Instructs a synchronising mirrored queue to stop synchronising
464 itself.
465
466 User Management
467 Note that all user management commands rabbitmqctl only can manage users
468 in the internal RabbitMQ database. Users from any alternative authenti‐
469 cation backends such as LDAP cannot be inspected or managed with those
470 commands. rabbitmqctl.
471
472 add_user username password
473
474 username
475 The name of the user to create.
476
477 password
478 The password the created user will use to log in to the
479 broker.
480
481 For example, this command instructs the RabbitMQ broker to create
482 a (non-administrative) user named "janeway" with (initial) pass‐
483 word "changeit":
484
485 rabbitmqctl add_user janeway changeit
486
487 authenticate_user username password
488
489 username
490 The name of the user.
491
492 password
493 The password of the user.
494
495 For example, this command instructs the RabbitMQ broker to au‐
496 thenticate the user named "janeway" with password "verifyit":
497
498 rabbitmqctl authenticate_user janeway verifyit
499
500 change_password username newpassword
501
502 username
503 The name of the user whose password is to be changed.
504
505 newpassword
506 The new password for the user.
507
508 For example, this command instructs the RabbitMQ broker to change
509 the password for the user named "janeway" to "newpass":
510
511 rabbitmqctl change_password janeway newpass
512
513 clear_password username
514
515 username
516 The name of the user whose password is to be cleared.
517
518 For example, this command instructs the RabbitMQ broker to clear
519 the password for the user named "janeway":
520
521 rabbitmqctl clear_password janeway
522
523 This user now cannot log in with a password (but may be able to
524 through e.g. SASL EXTERNAL if configured).
525
526 delete_user username
527
528 username
529 The name of the user to delete.
530
531 For example, this command instructs the RabbitMQ broker to delete
532 the user named "janeway":
533
534 rabbitmqctl delete_user janeway
535
536 list_users
537
538 Lists users. Each result row will contain the user name followed
539 by a list of the tags set for that user.
540
541 For example, this command instructs the RabbitMQ broker to list
542 all users:
543
544 rabbitmqctl list_users
545
546 set_user_tags username [tag ...]
547
548 username
549 The name of the user whose tags are to be set.
550
551 tag Zero, one or more tags to set. Any existing tags will be
552 removed.
553
554 For example, this command instructs the RabbitMQ broker to ensure
555 the user named "janeway" is an administrator:
556
557 rabbitmqctl set_user_tags janeway administrator
558
559 This has no effect when the user authenticates using a messaging
560 protocol, but can be used to permit the user to manage users,
561 virtual hosts and permissions when the user logs in via some
562 other means (for example with the management plugin).
563
564 This command instructs the RabbitMQ broker to remove any tags
565 from the user named "janeway":
566
567 rabbitmqctl set_user_tags janeway
568
569 Access control
570 clear_permissions [-p vhost] username
571
572 vhost The name of the virtual host to which to deny the user
573 access, defaulting to "/".
574
575 username
576 The name of the user to deny access to the specified vir‐
577 tual host.
578
579 Sets user permissions.
580
581 For example, this command instructs the RabbitMQ broker to deny
582 the user named "janeway" access to the virtual host called
583 "my-vhost":
584
585 rabbitmqctl clear_permissions -p my-vhost janeway
586
587 clear_topic_permissions [-p vhost] username [exchange]
588
589 vhost The name of the virtual host to which to clear the topic
590 permissions, defaulting to "/".
591
592 username
593 The name of the user to clear topic permissions to the
594 specified virtual host.
595
596 exchange
597 The name of the topic exchange to clear topic permis‐
598 sions, defaulting to all the topic exchanges the given
599 user has topic permissions for.
600
601 Clear user topic permissions.
602
603 For example, this command instructs the RabbitMQ broker to remove
604 topic permissions for user named "janeway" for the topic exchange
605 "amq.topic" in the virtual host called "my-vhost":
606
607 rabbitmqctl clear_topic_permissions -p my-vhost janeway
608 amq.topic
609
610 list_permissions [-p vhost]
611
612 vhost The name of the virtual host for which to list the users
613 that have been granted access to it, and their permis‐
614 sions. Defaults to "/".
615
616 Lists permissions in a virtual host.
617
618 For example, this command instructs the RabbitMQ broker to list
619 all the users which have been granted access to the virtual host
620 called "my-vhost", and the permissions they have for operations
621 on resources in that virtual host. Note that an empty string
622 means no permissions granted:
623
624 rabbitmqctl list_permissions -p my-vhost
625
626 list_topic_permissions [-p vhost]
627
628 vhost The name of the virtual host for which to list the users
629 topic permissions. Defaults to "/".
630
631 Lists topic permissions in a virtual host.
632
633 For example, this command instructs the RabbitMQ broker to list
634 all the users which have been granted topic permissions in the
635 virtual host called "my-vhost:"
636
637 rabbitmqctl list_topic_permissions -p my-vhost
638
639 list_user_permissions username
640
641 username
642 The name of the user for which to list the permissions.
643
644 Lists user permissions.
645
646 For example, this command instructs the RabbitMQ broker to list
647 all the virtual hosts to which the user named "janeway" has been
648 granted access, and the permissions the user has for operations
649 on resources in these virtual hosts:
650
651 rabbitmqctl list_user_permissions janeway
652
653 list_user_topic_permissions username
654
655 username
656 The name of the user for which to list the topic permis‐
657 sions.
658
659 Lists user topic permissions.
660
661 For example, this command instructs the RabbitMQ broker to list
662 all the virtual hosts to which the user named "janeway" has been
663 granted access, and the topic permissions the user has in these
664 virtual hosts:
665
666 rabbitmqctl list_user_topic_permissions janeway
667
668 list_vhosts [vhostinfoitem ...]
669
670 Lists virtual hosts.
671
672 The vhostinfoitem parameter is used to indicate which virtual
673 host information items to include in the results. The column or‐
674 der in the results will match the order of the parameters.
675 vhostinfoitem can take any value from the list that follows:
676
677 name The name of the virtual host with non-ASCII characters
678 escaped as in C.
679
680 tracing
681 Whether tracing is enabled for this virtual host.
682
683 default_queue_type
684 Default queue type for this vhost.
685
686 description
687 Virtual host description.
688
689 tags Virtual host tags.
690
691 cluster_state
692 Virtual host state: nodedown, running, stopped.
693
694 If no vhostinfoitem are specified then the vhost name is dis‐
695 played.
696
697 For example, this command instructs the RabbitMQ broker to list
698 all virtual hosts:
699
700 rabbitmqctl list_vhosts name tracing
701
702 set_permissions [-p vhost] user conf write read
703
704 vhost The name of the virtual host to which to grant the user
705 access, defaulting to "/".
706
707 user The name of the user to grant access to the specified
708 virtual host.
709
710 conf A regular expression matching resource names for which
711 the user is granted configure permissions.
712
713 write A regular expression matching resource names for which
714 the user is granted write permissions.
715
716 read A regular expression matching resource names for which
717 the user is granted read permissions.
718
719 Sets user permissions.
720
721 For example, this command instructs the RabbitMQ broker to grant
722 the user named "janeway" access to the virtual host called
723 "my-vhost", with configure permissions on all resources whose
724 names starts with "janeway-", and write and read permissions on
725 all resources:
726
727 rabbitmqctl set_permissions -p my-vhost janeway
728 "^janeway-.*" ".*" ".*"
729
730 set_topic_permissions [-p vhost] user exchange write read
731
732 vhost The name of the virtual host to which to grant the user
733 access, defaulting to "/".
734
735 user The name of the user the permissions apply to in the tar‐
736 get virtual host.
737
738 exchange
739 The name of the topic exchange the authorisation check
740 will be applied to.
741
742 write A regular expression matching the routing key of the pub‐
743 lished message.
744
745 read A regular expression matching the routing key of the con‐
746 sumed message.
747
748 Sets user topic permissions.
749
750 For example, this command instructs the RabbitMQ broker to let
751 the user named "janeway" publish and consume messages going
752 through the "amp.topic" exchange of the "my-vhost" virtual host
753 with a routing key starting with "janeway-":
754
755 rabbitmqctl set_topic_permissions -p my-vhost janeway
756 amq.topic "^janeway-.*" "^janeway-.*"
757
758 Topic permissions support variable expansion for the following
759 variables: username, vhost, and client_id. Note that client_id is
760 expanded only when using MQTT. The previous example could be
761 made more generic by using "^{username}-.*":
762
763 rabbitmqctl set_topic_permissions -p my-vhost janeway
764 amq.topic "^{username}-.*" "^{username}-.*"
765
766 Monitoring, observability and health checks
767 environment
768
769 Displays the name and value of each variable in the application
770 environment for each running application.
771
772 list_bindings [-p vhost] [bindinginfoitem ...]
773
774 Returns binding details. By default the bindings for the "/"
775 virtual host are returned. The -p flag can be used to override
776 this default.
777
778 The bindinginfoitem parameter is used to indicate which binding
779 information items to include in the results. The column order in
780 the results will match the order of the parameters.
781 bindinginfoitem can take any value from the list that follows:
782
783 source_name
784 The name of the source of messages to which the binding
785 is attached. With non-ASCII characters escaped as in C.
786
787 source_kind
788 The kind of the source of messages to which the binding
789 is attached. Currently always exchange. With non-ASCII
790 characters escaped as in C.
791
792 destination_name
793 The name of the destination of messages to which the
794 binding is attached. With non-ASCII characters escaped
795 as in C.
796
797 destination_kind
798 The kind of the destination of messages to which the
799 binding is attached. With non-ASCII characters escaped
800 as in C.
801
802 routing_key
803 The binding's routing key, with non-ASCII characters es‐
804 caped as in C.
805
806 arguments
807 The binding's arguments.
808
809 If no bindinginfoitem are specified then all above items are dis‐
810 played.
811
812 For example, this command displays the exchange name and queue
813 name of the bindings in the virtual host named "my-vhost"
814
815 rabbitmqctl list_bindings -p my-vhost exchange_name
816 queue_name
817
818 list_channels [channelinfoitem ...]
819
820 Returns information on all current channels, the logical contain‐
821 ers executing most AMQP commands. This includes channels that
822 are part of ordinary AMQP connections, and channels created by
823 various plug-ins and other extensions.
824
825 The channelinfoitem parameter is used to indicate which channel
826 information items to include in the results. The column order in
827 the results will match the order of the parameters.
828 channelinfoitem can take any value from the list that follows:
829
830 pid Id of the Erlang process associated with the connection.
831
832 connection
833 Id of the Erlang process associated with the connection
834 to which the channel belongs.
835
836 name Readable name for the channel.
837
838 number The number of the channel, which uniquely identifies it
839 within a connection.
840
841 user Username associated with the channel.
842
843 vhost Virtual host in which the channel operates.
844
845 transactional
846 True if the channel is in transactional mode, false oth‐
847 erwise.
848
849 confirm
850 True if the channel is in confirm mode, false otherwise.
851
852 consumer_count
853 Number of logical AMQP consumers retrieving messages via
854 the channel.
855
856 messages_unacknowledged
857 Number of messages delivered via this channel but not yet
858 acknowledged.
859
860 messages_uncommitted
861 Number of messages received in an as yet uncommitted
862 transaction.
863
864 acks_uncommitted
865 Number of acknowledgements received in an as yet uncom‐
866 mitted transaction.
867
868 messages_unconfirmed
869 Number of published messages not yet confirmed. On chan‐
870 nels not in confirm mode, this remains 0.
871
872 prefetch_count
873 QoS prefetch limit for new consumers, 0 if unlimited.
874
875 global_prefetch_count
876 QoS prefetch limit for the entire channel, 0 if unlim‐
877 ited.
878
879 If no channelinfoitem are specified then pid, user, con‐
880 sumer_count, and messages_unacknowledged are assumed.
881
882 For example, this command displays the connection process and
883 count of unacknowledged messages for each channel:
884
885 rabbitmqctl list_channels connection
886 messages_unacknowledged
887
888 list_ciphers
889
890 Lists cipher suites supported by encoding commands.
891
892 For example, this command instructs the RabbitMQ broker to list
893 all cipher suites supported by encoding commands:
894
895 rabbitmqctl list_ciphers
896
897 list_connections [connectioninfoitem ...]
898
899 Returns TCP/IP connection statistics.
900
901 The connectioninfoitem parameter is used to indicate which con‐
902 nection information items to include in the results. The column
903 order in the results will match the order of the parameters.
904 connectioninfoitem can take any value from the list that follows:
905
906 pid Id of the Erlang process associated with the connection.
907
908 name Readable name for the connection.
909
910 port Server port.
911
912 host Server hostname obtained via reverse DNS, or its IP ad‐
913 dress if reverse DNS failed or was turned off.
914
915 peer_port
916 Peer port.
917
918 peer_host
919 Peer hostname obtained via reverse DNS, or its IP address
920 if reverse DNS failed or was not enabled.
921
922 ssl Boolean indicating whether the connection is secured with
923 SSL.
924
925 ssl_protocol
926 SSL protocol (e.g. "tlsv1").
927
928 ssl_key_exchange
929 SSL key exchange algorithm (e.g. "rsa").
930
931 ssl_cipher
932 SSL cipher algorithm (e.g. "aes_256_cbc").
933
934 ssl_hash
935 SSL hash function (e.g. "sha").
936
937 peer_cert_subject
938 The subject of the peer's SSL certificate, in RFC4514
939 form.
940
941 peer_cert_issuer
942 The issuer of the peer's SSL certificate, in RFC4514
943 form.
944
945 peer_cert_validity
946 The period for which the peer's SSL certificate is valid.
947
948 state Connection state; one of:
949 • starting
950 • tuning
951 • opening
952 • running
953 • flow
954 • blocking
955 • blocked
956 • closing
957 • closed
958
959 channels
960 Number of channels using the connection.
961
962 protocol
963 Version of the AMQP protocol in use; currently one of:
964 • {0,9,1}
965 • {0,8,0}
966
967 Note that if a client requests an AMQP 0-9 connection, we
968 treat it as AMQP 0-9-1.
969
970 auth_mechanism
971 SASL authentication mechanism used, such as "PLAIN".
972
973 user Username associated with the connection.
974
975 vhost Virtual host name with non-ASCII characters escaped as in
976 C.
977
978 timeout
979 Connection timeout / negotiated heartbeat interval, in
980 seconds.
981
982 frame_max
983 Maximum frame size (bytes).
984
985 channel_max
986 Maximum number of channels on this connection.
987
988 client_properties
989 Informational properties transmitted by the client during
990 connection establishment.
991
992 recv_oct
993 Octets received.
994
995 recv_cnt
996 Packets received.
997
998 send_oct
999 Octets send.
1000
1001 send_cnt
1002 Packets sent.
1003
1004 send_pend
1005 Send queue size.
1006
1007 connected_at
1008 Date and time this connection was established, as time‐
1009 stamp.
1010
1011 If no connectioninfoitem are specified then user, peer host, peer
1012 port, time since flow control and memory block state are dis‐
1013 played.
1014
1015 For example, this command displays the send queue size and server
1016 port for each connection:
1017
1018 rabbitmqctl list_connections send_pend port
1019
1020 list_consumers [-p vhost]
1021
1022 Lists consumers, i.e. subscriptions to a queue´s message stream.
1023 Each line printed shows, separated by tab characters, the name of
1024 the queue subscribed to, the id of the channel process via which
1025 the subscription was created and is managed, the consumer tag
1026 which uniquely identifies the subscription within a channel, a
1027 boolean indicating whether acknowledgements are expected for mes‐
1028 sages delivered to this consumer, an integer indicating the
1029 prefetch limit (with 0 meaning "none"), and any arguments for
1030 this consumer.
1031
1032 list_exchanges [-p vhost] [exchangeinfoitem ...]
1033
1034 Returns exchange details. Exchange details of the "/" virtual
1035 host are returned if the -p flag is absent. The -p flag can be
1036 used to override this default.
1037
1038 The exchangeinfoitem parameter is used to indicate which exchange
1039 information items to include in the results. The column order in
1040 the results will match the order of the parameters.
1041 exchangeinfoitem can take any value from the list that follows:
1042
1043 name The name of the exchange with non-ASCII characters es‐
1044 caped as in C.
1045
1046 type The exchange type, such as:
1047 • direct
1048 • topic
1049 • headers
1050 • fanout
1051
1052 durable
1053 Whether or not the exchange survives server restarts.
1054
1055 auto_delete
1056 Whether the exchange will be deleted automatically when
1057 no longer used.
1058
1059 internal
1060 Whether the exchange is internal, i.e. cannot be directly
1061 published to by a client.
1062
1063 arguments
1064 Exchange arguments.
1065
1066 policy Policy name for applying to the exchange.
1067
1068 If no exchangeinfoitem are specified then exchange name and type
1069 are displayed.
1070
1071 For example, this command displays the name and type for each ex‐
1072 change of the virtual host named "my-vhost":
1073
1074 rabbitmqctl list_exchanges -p my-vhost name type
1075
1076 list_hashes
1077
1078 Lists hash functions supported by encoding commands.
1079
1080 For example, this command instructs the RabbitMQ broker to list
1081 all hash functions supported by encoding commands:
1082
1083 rabbitmqctl list_hashes
1084
1085 list_queues [-p vhost] [--offline | --online | --local] [queueinfoitem
1086 ...]
1087
1088 Returns queue details. Queue details of the "/" virtual host are
1089 returned if the -p flag is absent. The -p flag can be used to
1090 override this default.
1091
1092 Displayed queues can be filtered by their status or location us‐
1093 ing one of the following mutually exclusive options:
1094
1095 --offline
1096 List only those durable queues that are not currently
1097 available (more specifically, their leader node isn't).
1098
1099 --online
1100 List queues that are currently available (their leader
1101 node is).
1102
1103 --local
1104 List only those queues whose leader replica is located on
1105 the current node.
1106
1107 The queueinfoitem parameter is used to indicate which queue in‐
1108 formation items to include in the results. The column order in
1109 the results will match the order of the parameters.
1110 queueinfoitem can take any value from the list that follows:
1111
1112 name The name of the queue with non-ASCII characters escaped
1113 as in C.
1114
1115 durable
1116 Whether or not the queue survives server restarts.
1117
1118 auto_delete
1119 Whether the queue will be deleted automatically when no
1120 longer used.
1121
1122 arguments
1123 Queue arguments.
1124
1125 policy Name of the user policy that is applied to the queue.
1126
1127 operator_policy
1128 Name of the operator policy that is applied to the queue.
1129
1130 effective_policy_definition
1131 Effective policy definition for the queue: both user and
1132 operator policy definitions merged.
1133
1134 pid Erlang process identifier of the queue.
1135
1136 owner_pid
1137 Id of the Erlang process of the connection which is the
1138 exclusive owner of the queue. Empty if the queue is non-
1139 exclusive.
1140
1141 exclusive
1142 True if queue is exclusive (i.e. has owner_pid), false
1143 otherwise.
1144
1145 exclusive_consumer_pid
1146 Id of the Erlang process representing the channel of the
1147 exclusive consumer subscribed to this queue. Empty if
1148 there is no exclusive consumer.
1149
1150 exclusive_consumer_tag
1151 Consumer tag of the exclusive consumer subscribed to this
1152 queue. Empty if there is no exclusive consumer.
1153
1154 messages_ready
1155 Number of messages ready to be delivered to clients.
1156
1157 messages_unacknowledged
1158 Number of messages delivered to clients but not yet ac‐
1159 knowledged.
1160
1161 messages
1162 Sum of ready and unacknowledged messages (queue depth).
1163
1164 messages_ready_ram
1165 Number of messages from messages_ready which are resident
1166 in ram.
1167
1168 messages_unacknowledged_ram
1169 Number of messages from messages_unacknowledged which are
1170 resident in ram.
1171
1172 messages_ram
1173 Total number of messages which are resident in ram.
1174
1175 messages_persistent
1176 Total number of persistent messages in the queue (will
1177 always be 0 for transient queues).
1178
1179 message_bytes
1180 Sum of the size of all message bodies in the queue. This
1181 does not include the message properties (including head‐
1182 ers) or any overhead.
1183
1184 message_bytes_ready
1185 Like message_bytes but counting only those messages ready
1186 to be delivered to clients.
1187
1188 message_bytes_unacknowledged
1189 Like message_bytes but counting only those messages de‐
1190 livered to clients but not yet acknowledged.
1191
1192 message_bytes_ram
1193 Like message_bytes but counting only those messages which
1194 are currently held in RAM.
1195
1196 message_bytes_persistent
1197 Like message_bytes but counting only those messages which
1198 are persistent.
1199
1200 head_message_timestamp
1201 The timestamp property of the first message in the queue,
1202 if present. Timestamps of messages only appear when they
1203 are in the paged-in state.
1204
1205 disk_reads
1206 Total number of times messages have been read from disk
1207 by this queue since it started.
1208
1209 disk_writes
1210 Total number of times messages have been written to disk
1211 by this queue since it started.
1212
1213 consumers
1214 Number of consumers.
1215
1216 consumer_utilisation
1217 Fraction of the time (between 0.0 and 1.0) that the queue
1218 is able to immediately deliver messages to consumers.
1219 This can be less than 1.0 if consumers are limited by
1220 network congestion or prefetch count.
1221
1222 memory Bytes of memory allocated by the runtime for the queue,
1223 including stack, heap and internal structures.
1224
1225 mirror_pids
1226 If the queue is mirrored, this lists the IDs of the mir‐
1227 rors (follower replicas). To learn more, see the
1228 RabbitMQ Mirroring guide:
1229 https://www.rabbitmq.com/ha.html
1230
1231 synchronised_mirror_pids
1232 If the queue is mirrored, this gives the IDs of the mir‐
1233 rors (follower replicas) which are in sync with the
1234 leader replica. To learn more, see the RabbitMQ Mirroring
1235 guide: https://www.rabbitmq.com/ha.html
1236
1237 state The state of the queue. Normally "running", but may be
1238 "{syncing, message_count}" if the queue is synchronising.
1239
1240 Queues which are located on cluster nodes that are cur‐
1241 rently down will be shown with a status of "down" (and
1242 most other queueinfoitem will be unavailable).
1243
1244 type Queue type, one of: quorum, stream, classic.
1245
1246 If no queueinfoitem are specified then queue name and depth are
1247 displayed.
1248
1249 For example, this command displays the depth and number of con‐
1250 sumers for each queue of the virtual host named "my-vhost"
1251
1252 rabbitmqctl list_queues -p my-vhost messages consumers
1253
1254 list_unresponsive_queues [--local] [--queue-timeout milliseconds]
1255 [queueinfoitem ...] [--no-table-headers]
1256
1257 Tests queue leader replicas to respond within the given timeout.
1258 Lists those which did not respond in time.
1259
1260 Displayed queues can be filtered by their status or location us‐
1261 ing one of the following mutually exclusive options:
1262
1263 --all List all queues.
1264
1265 --local
1266 List only those queues whose leader replica is located on
1267 the current node.
1268
1269 The queueinfoitem parameter is used to indicate which queue in‐
1270 formation items to include in the results. The column order in
1271 the results will match the order of the parameters.
1272 queueinfoitem can take any value from the list that follows:
1273
1274 name The name of the queue with non-ASCII characters escaped
1275 as in C.
1276
1277 durable
1278 Whether or not the queue should survive server restarts.
1279
1280 auto_delete
1281 Whether the queue will be deleted automatically when all
1282 of its explicit bindings are deleted.
1283
1284 arguments
1285 Queue arguments.
1286
1287 policy Effective policy name for the queue.
1288
1289 pid Erlang process identifier of the leader replica.
1290
1291 recoverable_mirrors
1292 Erlang process identifiers of the mirror replicas that
1293 are considered reachable (available).
1294
1295 type Queue type, one of: quorum, stream, classic.
1296
1297 For example, this command lists only those unresponsive queues
1298 whose leader replica is hosted on the target node.
1299 rabbitmqctl list_unresponsive_queues --local name
1300
1301 ping
1302
1303 Checks that the node OS process is up, registered with EPMD and
1304 CLI tools can authenticate with it
1305
1306 Example:
1307 rabbitmqctl ping -n rabbit@hostname
1308
1309 report
1310
1311 Generate a server status report containing a concatenation of all
1312 server status information for support purposes. The output
1313 should be redirected to a file when accompanying a support re‐
1314 quest.
1315
1316 For example, this command creates a server report which may be
1317 attached to a support request email:
1318
1319 rabbitmqctl report > server_report.txt
1320
1321 schema_info [--no-table-headers] [column ...]
1322
1323 Lists schema database tables and their properties
1324
1325 For example, this command lists the table names and their active
1326 replicas:
1327
1328 rabbitmqctl schema_info name active_replicas
1329
1330 status
1331
1332 Displays broker status information such as the running applica‐
1333 tions on the current Erlang node, RabbitMQ and Erlang versions,
1334 OS name, memory and file descriptor statistics. (See the
1335 cluster_status command to find out which nodes are clustered and
1336 running.)
1337
1338 For example, this command displays information about the RabbitMQ
1339 broker:
1340
1341 rabbitmqctl status
1342
1343 Runtime Parameters and Policies
1344 Certain features of RabbitMQ (such as the Federation plugin) are con‐
1345 trolled by dynamic, cluster-wide parameters. There are 2 kinds of parame‐
1346 ters: parameters scoped to a virtual host and global parameters. Each
1347 vhost-scoped parameter consists of a component name, a name and a value.
1348 The component name and name are strings, and the value is a valid JSON
1349 document. A global parameter consists of a name and value. The name is
1350 a string and the value is an arbitrary Erlang data structure. Parameters
1351 can be set, cleared and listed. In general you should refer to the docu‐
1352 mentation for the feature in question to see how to set parameters.
1353
1354 Policies is a feature built on top of runtime parameters. Policies are
1355 used to control and modify the behaviour of queues and exchanges on a
1356 cluster-wide basis. Policies apply within a given vhost, and consist of
1357 a name, pattern, definition and an optional priority. Policies can be
1358 set, cleared and listed.
1359
1360 clear_global_parameter name
1361
1362 Clears a global runtime parameter. This is similar to
1363 clear_parameter but the key-value pair isn't tied to a virtual
1364 host.
1365
1366 name The name of the global runtime parameter being cleared.
1367
1368 For example, this command clears the global runtime parameter
1369 "mqtt_default_vhosts":
1370
1371 rabbitmqctl clear_global_parameter mqtt_default_vhosts
1372
1373 clear_parameter [-p vhost] component_name key
1374
1375 Clears a parameter.
1376
1377 component_name
1378 The name of the component for which the parameter is be‐
1379 ing cleared.
1380
1381 name The name of the parameter being cleared.
1382
1383 For example, this command clears the parameter "node01" for the
1384 "federation-upstream" component in the default virtual host:
1385
1386 rabbitmqctl clear_parameter federation-upstream node01
1387
1388 list_global_parameters
1389
1390 Lists all global runtime parameters. This is similar to
1391 list_parameters but the global runtime parameters are not tied to
1392 any virtual host.
1393
1394 For example, this command lists all global parameters:
1395
1396 rabbitmqctl list_global_parameters
1397
1398 list_parameters [-p vhost]
1399
1400 Lists all parameters for a virtual host.
1401
1402 For example, this command lists all parameters in the default
1403 virtual host:
1404
1405 rabbitmqctl list_parameters
1406
1407 set_global_parameter name value
1408
1409 Sets a global runtime parameter. This is similar to
1410 set_parameter but the key-value pair isn't tied to a virtual
1411 host.
1412
1413 name The name of the global runtime parameter being set.
1414
1415 value The value for the global runtime parameter, as a JSON
1416 document. In most shells you are very likely to need to
1417 quote this.
1418
1419 For example, this command sets the global runtime parameter
1420 "mqtt_default_vhosts" to the JSON document
1421 {"O=client,CN=guest":"/"}:
1422
1423 rabbitmqctl set_global_parameter mqtt_default_vhosts
1424 '{"O=client,CN=guest":"/"}'
1425
1426 set_parameter [-p vhost] component_name name value
1427
1428 Sets a parameter.
1429
1430 component_name
1431 The name of the component for which the parameter is be‐
1432 ing set.
1433
1434 name The name of the parameter being set.
1435
1436 value The value for the parameter, as a JSON document. In most
1437 shells you are very likely to need to quote this.
1438
1439 For example, this command sets the parameter "node01" for the
1440 "federation-upstream" component in the default virtual host to
1441 the following JSON "guest":
1442
1443 rabbitmqctl set_parameter federation-upstream node01
1444 '{"uri":"amqp://user:password@server/%2F","ack-mode":"on-publish"}'
1445
1446 list_policies [-p vhost]
1447
1448 Lists all policies for a virtual host.
1449
1450 For example, this command lists all policies in the default vir‐
1451 tual host:
1452
1453 rabbitmqctl list_policies
1454
1455 set_operator_policy [-p vhost] [--priority priority] [--apply-to
1456 apply-to] name pattern definition
1457
1458 Sets an operator policy that overrides a subset of arguments in
1459 user policies. Arguments are identical to those of set_policy.
1460
1461 Supported arguments are:
1462 • expires
1463 • message-ttl
1464 • max-length
1465 • max-length-bytes
1466
1467 set_policy [-p vhost] [--priority priority] [--apply-to apply-to] name
1468 pattern definition
1469
1470 Sets a policy.
1471
1472 name The name of the policy.
1473
1474 pattern
1475 The regular expression, which when matches on a given re‐
1476 sources causes the policy to apply.
1477
1478 definition
1479 The definition of the policy, as a JSON document. In
1480 most shells you are very likely to need to quote this.
1481
1482 priority
1483 The priority of the policy as an integer. Higher numbers
1484 indicate greater precedence. The default is 0.
1485
1486 apply-to
1487 Which types of object this policy should apply to. Pos‐
1488 sible values are:
1489 • queues
1490 • exchanges
1491 • all
1492 The default is all ..
1493
1494 For example, this command sets the policy "federate-me" in the
1495 default virtual host so that built-in exchanges are federated:
1496
1497 rabbitmqctl set_policy federate-me ^amq.
1498 '{"federation-upstream-set":"all"}'
1499
1500 clear_policy [-p vhost] name
1501
1502 Clears a policy.
1503
1504 name The name of the policy being cleared.
1505
1506 For example, this command clears the "federate-me" policy in the
1507 default virtual host:
1508
1509 rabbitmqctl clear_policy federate-me
1510
1511 clear_operator_policy [-p vhost] name
1512
1513 Clears an operator policy. Arguments are identical to those of
1514 clear_policy.
1515
1516 list_operator_policies [-p vhost]
1517
1518 Lists operator policy overrides for a virtual host. Arguments
1519 are identical to those of list_policies.
1520
1521 Virtual hosts
1522 Note that rabbitmqctl manages the RabbitMQ internal user database. Per‐
1523 missions for users from any alternative authorisation backend will not be
1524 visible to rabbitmqctl.
1525
1526 add_vhost vhost [--description desc --tags tags --default-queue-type
1527 default-q-type]
1528
1529 vhost The name of the virtual host entry to create.
1530
1531 desc Arbitrary virtual host description, e.g. its purpose, for
1532 operator's convenience.
1533
1534 tags A comma-separated list of virtual host tags for opera‐
1535 tor's convenient
1536
1537 default-q-type
1538 If clients do not specify queue type explicitly, this
1539 type will be used. One of: quorum, stream.
1540
1541 Creates a virtual host.
1542
1543 For example, this command instructs the RabbitMQ broker to create
1544 a new virtual host called "project9_dev_18":
1545
1546 rabbitmqctl add_vhost project9_dev_18 --description 'Dev
1547 environment no. 18' --tags dev,project9
1548
1549 clear_vhost_limits [-p vhost]
1550
1551 Clears virtual host limits.
1552
1553 For example, this command clears vhost limits in vhost "qa_env":
1554
1555 rabbitmqctl clear_vhost_limits -p qa_env
1556
1557 delete_vhost vhost
1558
1559 vhost The name of the virtual host entry to delete.
1560
1561 Deletes a virtual host.
1562
1563 Deleting a virtual host deletes all its exchanges, queues, bind‐
1564 ings, user permissions, parameters and policies.
1565
1566 For example, this command instructs the RabbitMQ broker to delete
1567 the virtual host called "test":
1568
1569 rabbitmqctl delete_vhost a-vhost
1570
1571 list_vhost_limits [-p vhost] [--global] [--no-table-headers]
1572
1573 Displays configured virtual host limits.
1574
1575 --global
1576 Show limits for all vhosts. Suppresses the -p parameter.
1577
1578 restart_vhost [-p vhost]
1579
1580 vhost The name of the virtual host entry to restart, defaulting
1581 to "/".
1582
1583 Restarts a failed vhost data stores and queues.
1584
1585 For example, this command instructs the RabbitMQ broker to
1586 restart a virtual host called "test":
1587
1588 rabbitmqctl restart_vhost test
1589
1590 set_vhost_limits [-p vhost] definition
1591
1592 Sets virtual host limits.
1593
1594 definition
1595 The definition of the limits, as a JSON document. In
1596 most shells you are very likely to need to quote this.
1597
1598 Recognised limits are:
1599 • max-connections
1600 • max-queues
1601
1602 Use a negative value to specify "no limit".
1603
1604 For example, this command limits the max number of concurrent
1605 connections in vhost "qa_env" to 64:
1606
1607 rabbitmqctl set_vhost_limits -p qa_env '{"max-connections":
1608 64}'
1609
1610 This command limits the max number of queues in vhost "qa_env" to
1611 256:
1612
1613 rabbitmqctl set_vhost_limits -p qa_env '{"max-queues":
1614 256}'
1615
1616 This command clears the max number of connections limit in vhost
1617 "qa_env":
1618
1619 rabbitmqctl set_vhost_limits -p qa_env '{"max-connections":
1620 -1}'
1621
1622 This command disables client connections in vhost "qa_env":
1623
1624 rabbitmqctl set_vhost_limits -p qa_env '{"max-connections":
1625 0}'
1626 ] username
1627 ] definition
1628
1629 set_user_limits
1630
1631 Sets user limits.
1632
1633 username
1634 The name of the user to apply limits to
1635
1636 definition
1637 The definition of the limits, as a JSON document. In
1638 most shells you are very likely to need to quote this.
1639
1640 Recognised limits are:
1641 • max-connections
1642 • max-channels
1643
1644 Use a negative value to specify "no limit".
1645
1646 For example, this command limits the max number of concurrent
1647 connections a user is allowed to open "limited_user" to 64:
1648
1649 rabbitmqctl set_user_limits limited_user
1650 '{"max-connections": 64}'
1651
1652 This command limits the max number of channels a user is allowed
1653 to open on a connection "limited_user" to 16:
1654
1655 rabbitmqctl set_user_limits limited_user '{"max-channels":
1656 16}'
1657
1658 This command clears the max number of connections limit for user
1659 "limited_user":
1660
1661 rabbitmqctl clear_user_limits limited_user
1662 'max-connections'
1663
1664 This command disables client connections for user "limited_user":
1665
1666 rabbitmqctl set_user_limits limited_user
1667 '{"max-connections": 0}'
1668 ] username
1669 ] limit
1670
1671 clear_user_limits
1672
1673 Clears user limits.
1674
1675 username
1676 The name of the user to clear limits of
1677
1678 limit The name of the limit or "all" to clear all limits at
1679 once.
1680
1681 Recognised limits are:
1682 • max-connections
1683 • max-channels
1684
1685 For example, this command clears max connection limits of user
1686 "limited_user":
1687
1688 rabbitmqctl clear_user_limits limited_user
1689 'max-connections'
1690
1691 This command clears all limits of user "limited_user":
1692
1693 rabbitmqctl clear_user_limits limited_user all
1694
1695 trace_off [-p vhost]
1696
1697 vhost The name of the virtual host for which to stop tracing.
1698
1699 Stops tracing.
1700
1701 trace_on [-p vhost]
1702
1703 vhost The name of the virtual host for which to start tracing.
1704
1705 Starts tracing. Note that the trace state is not persistent; it
1706 will revert to being off if the node is restarted.
1707
1708 Configuration
1709 decode value passphrase [--cipher cipher] [--hash hash] [--iterations
1710 iterations]
1711
1712 value passphrase
1713 Value to decrypt (as produced by the encode command) and
1714 passphrase.
1715
1716 For example:
1717
1718 rabbitmqctl decode '{encrypted, <<"...">>}'
1719 mypassphrase
1720
1721 --cipher cipher --hash hash --iterations iterations
1722 Options to specify the decryption settings. They can be
1723 used independently.
1724
1725 For example:
1726
1727 rabbitmqctl decode --cipher blowfish_cfb64 --hash
1728 sha256 --iterations 10000 '{encrypted,<<"...">>}
1729 mypassphrase
1730
1731 encode value passphrase [--cipher cipher] [--hash hash] [--iterations
1732 iterations]
1733
1734 value passphrase
1735 Value to encrypt and passphrase.
1736
1737 For example:
1738
1739 rabbitmqctl encode '<<"guest">>' mypassphrase
1740
1741 --cipher cipher --hash hash --iterations iterations
1742 Options to specify the encryption settings. They can be
1743 used independently.
1744
1745 For example:
1746
1747 rabbitmqctl encode --cipher blowfish_cfb64 --hash
1748 sha256 --iterations 10000 '<<"guest">>'
1749 mypassphrase
1750
1751 set_cluster_name name
1752
1753 Sets the cluster name to name. The cluster name is announced to
1754 clients on connection, and used by the federation and shovel
1755 plugins to record where a message has been. The cluster name is
1756 by default derived from the hostname of the first node in the
1757 cluster, but can be changed.
1758
1759 For example, this sets the cluster name to "london":
1760
1761 rabbitmqctl set_cluster_name london
1762
1763 set_disk_free_limit disk_limit
1764
1765 disk_limit
1766 Lower bound limit as an integer in bytes or a string with
1767 memory unit symbols (see vm_memory_high_watermark), e.g.
1768 512M or 1G. Once free disk space reaches the limit, a
1769 disk alarm will be set.
1770
1771 set_disk_free_limit mem_relative fraction
1772
1773 fraction
1774 Limit relative to the total amount available RAM as a
1775 non-negative floating point number. Values lower than
1776 1.0 can be dangerous and should be used carefully.
1777
1778 set_log_level [log_level]
1779
1780 Sets log level in the running node
1781
1782 Supported log_level values are:
1783 • debug
1784 • info
1785 • warning
1786 • error
1787 • critical
1788 • none
1789
1790 Example:
1791 rabbitmqctl set_log_level debug
1792
1793 set_vm_memory_high_watermark fraction
1794
1795 fraction
1796 The new memory threshold fraction at which flow control
1797 is triggered, as a floating point number greater than or
1798 equal to 0.
1799
1800 set_vm_memory_high_watermark [absolute] memory_limit
1801
1802 memory_limit
1803 The new memory limit at which flow control is triggered,
1804 expressed in bytes as an integer number greater than or
1805 equal to 0 or as a string with memory unit symbol(e.g.
1806 512M or 1G). Available unit symbols are:
1807
1808 k, kiB kibibytes (2^10 bytes)
1809
1810 M, MiB mebibytes (2^20 bytes)
1811
1812 G, GiB gibibytes (2^30 bytes)
1813
1814 kB kilobytes (10^3 bytes)
1815
1816 MB megabytes (10^6 bytes)
1817
1818 GB gigabytes (10^9 bytes)
1819
1820 Feature flags
1821 enable_feature_flag feature_flag
1822
1823 Enables a feature flag on the target node.
1824
1825 Example:
1826 rabbitmqctl enable_feature_flag quorum_queue
1827
1828 You can also enable all feature flags by specifying "all":
1829 rabbitmqctl enable_feature_flag all
1830
1831 list_feature_flags [column ...]
1832
1833 Lists feature flags
1834
1835 Supported column values are:
1836 • name
1837 • state
1838 • stability
1839 • provided_by
1840 • desc
1841 • doc_url
1842
1843 Example:
1844 rabbitmqctl list_feature_flags name state
1845
1846 Connection Operations
1847 close_all_connections [-p vhost] [--global] [--per-connection-delay
1848 delay] [--limit limit] explanation
1849
1850 -p vhost
1851 The name of the virtual host for which connections should
1852 be closed. Ignored when --global is specified.
1853
1854 --global
1855 If connections should be close for all vhosts. Overrides
1856 -p
1857
1858 --per-connection-delay delay
1859 Time in milliseconds to wait after each connection clos‐
1860 ing.
1861
1862 --limit limit
1863 Number of connection to close. Only works per vhost.
1864 Ignored when --global is specified.
1865
1866 explanation
1867 Explanation string.
1868
1869 Instructs the broker to close all connections for the specified
1870 vhost or entire RabbitMQ node.
1871
1872 For example, this command instructs the RabbitMQ broker to close
1873 10 connections on "qa_env" vhost, passing the explanation "Please
1874 close":
1875
1876 rabbitmqctl close_all_connections -p qa_env --limit 10
1877 'Please close'
1878
1879 This command instructs broker to close all connections to the
1880 node:
1881
1882 rabbitmqctl close_all_connections --global
1883
1884
1885 close_connection connectionpid explanation
1886
1887 connectionpid
1888 Id of the Erlang process associated with the connection
1889 to close.
1890
1891 explanation
1892 Explanation string.
1893
1894 Instructs the broker to close the connection associated with the
1895 Erlang process id connectionpid (see also the list_connections
1896 command), passing the explanation string to the connected client
1897 as part of the AMQP connection shutdown protocol.
1898
1899 For example, this command instructs the RabbitMQ broker to close
1900 the connection associated with the Erlang process id
1901 "<rabbit@tanto.4262.0>", passing the explanation "go away" to the
1902 connected client:
1903
1904 rabbitmqctl close_connection "<rabbit@tanto.4262.0>" "go
1905 away"
1906
1907 Misc
1908 eval expression
1909
1910 Evaluates an Erlang expression on the target node
1911
1912 Queue Operations
1913 delete_queue queue_name [--if-empty | -e] [--if-unused | -u]
1914
1915 queue_name
1916 The name of the queue to delete.
1917
1918 --if-empty
1919 Delete the queue if it is empty (has no messages
1920 ready for delivery)
1921
1922 --if-unused
1923 Delete the queue only if it has no consumers
1924
1925 Deletes a queue.
1926
1927 purge_queue [-p vhost] queue
1928
1929 queue The name of the queue to purge.
1930
1931 Purges a queue (removes all messages in it).
1932
1934 RabbitMQ plugins can extend rabbitmqctl tool to add new commands when en‐
1935 abled. Currently available commands can be found in rabbitmqctl help
1936 output. Following commands are added by RabbitMQ plugins, available in
1937 default distribution:
1938
1939 Shovel plugin
1940 shovel_status
1941 Prints a list of configured Shovels
1942
1943 delete_shovel [-p vhost] name
1944 Instructs the RabbitMQ node to delete the configured shovel by
1945 name.
1946
1947 Federation plugin
1948 federation_status [--only-down]
1949 Prints a list of federation links.
1950
1951 --only-down
1952 Only list federation links which are not running.
1953
1954 restart_federation_link link_id
1955 Instructs the RabbitMQ node to restart the federation link with
1956 specified link_id.
1957
1958 AMQP 1.0 plugin
1959 list_amqp10_connections [amqp10_connectioninfoitem ...]
1960 Similar to the list_connections command, but returns fields which
1961 make sense for AMQP-1.0 connections. amqp10_connectioninfoitem
1962 parameter is used to indicate which connection information items
1963 to include in the results. The column order in the results will
1964 match the order of the parameters. amqp10_connectioninfoitem can
1965 take any value from the list that follows:
1966
1967 pid Id of the Erlang process associated with the connection.
1968
1969 auth_mechanism
1970 SASL authentication mechanism used, such as "PLAIN".
1971
1972 host Server hostname obtained via reverse DNS, or its IP ad‐
1973 dress if reverse DNS failed or was turned off.
1974
1975 frame_max
1976 Maximum frame size (bytes).
1977
1978 timeout
1979 Connection timeout / negotiated heartbeat interval, in
1980 seconds.
1981
1982 user Username associated with the connection.
1983
1984 state Connection state; one of:
1985 • starting
1986 • waiting_amqp0100
1987 • securing
1988 • running
1989 • blocking
1990 • blocked
1991 • closing
1992 • closed
1993
1994 recv_oct
1995 Octets received.
1996
1997 recv_cnt
1998 Packets received.
1999
2000 send_oct
2001 Octets send.
2002
2003 send_cnt
2004 Packets sent.
2005
2006 ssl Boolean indicating whether the connection is secured with
2007 SSL.
2008
2009 ssl_protocol
2010 SSL protocol (e.g. "tlsv1").
2011
2012 ssl_key_exchange
2013 SSL key exchange algorithm (e.g. "rsa").
2014
2015 ssl_cipher
2016 SSL cipher algorithm (e.g. "aes_256_cbc").
2017
2018 ssl_hash
2019 SSL hash function (e.g. "sha").
2020
2021 peer_cert_subject
2022 The subject of the peer's SSL certificate, in RFC4514
2023 form.
2024
2025 peer_cert_issuer
2026 The issuer of the peer's SSL certificate, in RFC4514
2027 form.
2028
2029 peer_cert_validity
2030 The period for which the peer's SSL certificate is valid.
2031
2032 node The node name of the RabbitMQ node to which connection is
2033 established.
2034
2035 MQTT plugin
2036 list_mqtt_connections [mqtt_connectioninfoitem]
2037 Similar to the list_connections command, but returns fields which
2038 make sense for MQTT connections. mqtt_connectioninfoitem parame‐
2039 ter is used to indicate which connection information items to in‐
2040 clude in the results. The column order in the results will match
2041 the order of the parameters. mqtt_connectioninfoitem can take
2042 any value from the list that follows:
2043
2044 host Server hostname obtained via reverse DNS, or its IP ad‐
2045 dress if reverse DNS failed or was turned off.
2046
2047 port Server port.
2048
2049 peer_host
2050 Peer hostname obtained via reverse DNS, or its IP address
2051 if reverse DNS failed or was not enabled.
2052
2053 peer_port
2054 Peer port.
2055
2056 protocol
2057 MQTT protocol version, which can be on of the following:
2058 • {'MQTT', N/A}
2059 • {'MQTT', 3.1.0}
2060 • {'MQTT', 3.1.1}
2061
2062 channels
2063 Number of channels using the connection.
2064
2065 channel_max
2066 Maximum number of channels on this connection.
2067
2068 frame_max
2069 Maximum frame size (bytes).
2070
2071 client_properties
2072 Informational properties transmitted by the client during
2073 connection establishment.
2074
2075 ssl Boolean indicating whether the connection is secured with
2076 SSL.
2077
2078 ssl_protocol
2079 SSL protocol (e.g. "tlsv1").
2080
2081 ssl_key_exchange
2082 SSL key exchange algorithm (e.g. "rsa").
2083
2084 ssl_cipher
2085 SSL cipher algorithm (e.g. "aes_256_cbc").
2086
2087 ssl_hash
2088 SSL hash function (e.g. "sha").
2089
2090 conn_name
2091 Readable name for the connection.
2092
2093 connection_state
2094 Connection state; one of:
2095 • starting
2096 • running
2097 • blocked
2098
2099 connection
2100 Id of the Erlang process associated with the internal
2101 amqp direct connection.
2102
2103 consumer_tags
2104 A tuple of consumer tags for QOS0 and QOS1.
2105
2106 message_id
2107 The last Packet ID sent in a control message.
2108
2109 client_id
2110 MQTT client identifier for the connection.
2111
2112 clean_sess
2113 MQTT clean session flag.
2114
2115 will_msg
2116 MQTT Will message sent in CONNECT frame.
2117
2118 exchange
2119 Exchange to route MQTT messages configured in rab‐
2120 bitmq_mqtt application environment.
2121
2122 ssl_login_name
2123 SSL peer cert auth name
2124
2125 retainer_pid
2126 Id of the Erlang process associated with retain storage
2127 for the connection.
2128
2129 user Username associated with the connection.
2130
2131 vhost Virtual host name with non-ASCII characters escaped as in
2132 C.
2133
2134 STOMP plugin
2135 list_stomp_connections [stomp_connectioninfoitem]
2136 Similar to the list_connections command, but returns fields which
2137 make sense for STOMP connections. stomp_connectioninfoitem pa‐
2138 rameter is used to indicate which connection information items to
2139 include in the results. The column order in the results will
2140 match the order of the parameters. stomp_connectioninfoitem can
2141 take any value from the list that follows:
2142
2143 conn_name
2144 Readable name for the connection.
2145
2146 connection
2147 Id of the Erlang process associated with the internal
2148 amqp direct connection.
2149
2150 connection_state
2151 Connection state; one of:
2152 • running
2153 • blocking
2154 • blocked
2155
2156 session_id
2157 STOMP protocol session identifier
2158
2159 channel
2160 AMQP channel associated with the connection
2161
2162 version
2163 Negotiated STOMP protocol version for the connection.
2164
2165 implicit_connect
2166 Indicates if the connection was established using im‐
2167 plicit connect (without CONNECT frame)
2168
2169 auth_login
2170 Effective username for the connection.
2171
2172 auth_mechanism
2173 STOMP authorization mechanism. Can be one of:
2174 • config
2175 • ssl
2176 • stomp_headers
2177
2178 port Server port.
2179
2180 host Server hostname obtained via reverse DNS, or its IP ad‐
2181 dress if reverse DNS failed or was not enabled.
2182
2183 peer_port
2184 Peer port.
2185
2186 peer_host
2187 Peer hostname obtained via reverse DNS, or its IP address
2188 if reverse DNS failed or was not enabled.
2189
2190 protocol
2191 STOMP protocol version, which can be on of the following:
2192 • {'STOMP', 0}
2193 • {'STOMP', 1}
2194 • {'STOMP', 2}
2195
2196 channels
2197 Number of channels using the connection.
2198
2199 channel_max
2200 Maximum number of channels on this connection.
2201
2202 frame_max
2203 Maximum frame size (bytes).
2204
2205 client_properties
2206 Informational properties transmitted by the client during
2207 connection
2208
2209 ssl Boolean indicating whether the connection is secured with
2210 SSL.
2211
2212 ssl_protocol
2213 TLS protocol (e.g. "tlsv1").
2214
2215 ssl_key_exchange
2216 TLS key exchange algorithm (e.g. "rsa").
2217
2218 ssl_cipher
2219 TLS cipher algorithm (e.g. "aes_256_cbc").
2220
2221 ssl_hash
2222 SSL hash function (e.g. "sha").
2223
2224 Management agent plugin
2225 reset_stats_db [--all]
2226 Reset management stats database for the RabbitMQ node.
2227
2228 --all Reset stats database for all nodes in the cluster.
2229
2231 rabbitmq-diagnostics(8), rabbitmq-plugins(8), rabbitmq-server(8),
2232 rabbitmq-queues(8), rabbitmq-streams(8), rabbitmq-upgrade(8),
2233 rabbitmq-service(8), rabbitmq-env.conf(5), rabbitmq-echopid(8)
2234
2236 The RabbitMQ Team <info@rabbitmq.com>
2237
2238RabbitMQ Server October 26, 2022 RabbitMQ Server