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