---
name: "rabbitmqctl"
section: "1"
platform: "linux"
package: "rabbitmq-server"
version: "3.3.5-1.1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/rabbitmqctl"
---

# rabbitmqctl(1)

command line tool for managing a RabbitMQ broker

## NAME

rabbitmqctl - command line tool for managing a RabbitMQ broker

## SYNOPSIS

**rabbitmqctl** \[-n *node*\] \[-q\] {*command*} \[*command options*...\]

## DESCRIPTION

RabbitMQ is an implementation of AMQP, the emerging standard for high performance enterprise messaging. The RabbitMQ server is a robust and scalable implementation of an AMQP broker.

**rabbitmqctl** is a command line tool for managing a RabbitMQ broker. It performs all actions by connecting to one of the broker's nodes.

Diagnostic information is displayed if the broker was not running, could not be reached, or rejected the connection due to mismatching Erlang cookies.

## OPTIONS

\[-n *node*\]

Default node is "rabbit@server", where server is the local host. On a host named "server.example.com", the node name of the RabbitMQ Erlang node will usually be rabbit@server (unless RABBITMQ\_NODENAME has been set to some non-default value at broker startup time). The output of **hostname -s** is usually the correct suffix to use after the "@" sign. See [rabbitmq-server(1)](/rabbitmq-server/1.md) for details of configuring the RabbitMQ broker.

\[-q\]

Quiet output mode is selected with the "-q" flag. Informational messages are suppressed when quiet mode is in effect.

## COMMANDS

### Application and Cluster Management

**stop** \[*pid\_file*\]

Stops the Erlang node on which RabbitMQ is running. To restart the node follow the instructions for Running the Server in the **installation guide**\[1\].

If a **pid\_file** is specified, also waits for the process specified there to terminate. See the description of the **wait** command below for details on this file.

**stop\_app**

Stops the RabbitMQ application, leaving the Erlang node running.

This command is typically run prior to performing other management actions that require the RabbitMQ application to be stopped, e.g. **reset**.

**start\_app**

Starts the RabbitMQ application.

This command is typically run after performing other management actions that required the RabbitMQ application to be stopped, e.g. **reset**.

**wait** {*pid\_file*}

Wait for the RabbitMQ application to start.

This command will wait for the RabbitMQ application to start at the node. It will wait for the pid file to be created, then for a process with a pid specified in the pid file to start, and then for the RabbitMQ application to start in that process. It will fail if the process terminates without starting the RabbitMQ application.

A suitable pid file is created by the **rabbitmq-server** script. By default this is located in the Mnesia directory. Modify the **RABBITMQ\_PID\_FILE** environment variable to change the location.

**reset**

Return a RabbitMQ node to its virgin state.

Removes the node from any cluster it belongs to, removes all data from the management database, such as configured users and vhosts, and deletes all persistent messages.

For **reset** and **force\_reset** to succeed the RabbitMQ application must have been stopped, e.g. with **stop\_app**.

**force\_reset**

Forcefully return a RabbitMQ node to its virgin state.

The **force\_reset** command differs from **reset** in that it resets the node unconditionally, regardless of the current management database state and cluster configuration. It should only be used as a last resort if the database or cluster configuration has been corrupted.

For **reset** and **force\_reset** to succeed the RabbitMQ application must have been stopped, e.g. with **stop\_app**.

**rotate\_logs** {*suffix*}

Instruct the RabbitMQ node to rotate the log files.

The RabbitMQ broker appends the contents of its log files to files with names composed of the original name and the suffix, and then resumes logging to freshly created files at the original location. I.e. effectively the current log contents are moved to the end of the suffixed files.

When the target files do not exist they are created. When no **suffix** is specified, the empty log files are simply created at the original location; no rotation takes place.

### Cluster management

**join\_cluster** {*clusternode*} \[--ram\]

clusternode

Node to cluster with.

\[--ram\]

If provided, the node will join the cluster as a RAM node.

Instruct the node to become a member of the cluster that the specified node is in. Before clustering, the node is reset, so be careful when using this command. For this command to succeed the RabbitMQ application must have been stopped, e.g. with **stop\_app**.

Cluster nodes can be of two types: disc or RAM. Disc nodes replicate data in RAM and on disc, thus providing redundancy in the event of node failure and recovery from global events such as power failure across all nodes. RAM nodes replicate data in RAM only (with the exception of queue contents, which can reside on disc if the queue is persistent or too big to fit in memory) and are mainly used for scalability. RAM nodes are more performant only when managing resources (e.g. adding/removing queues, exchanges, or bindings). A cluster must always have at least one disc node, and usually should have more than one.

The node will be a disc node by default. If you wish to create a RAM node, provide the **--ram** flag.

After executing the **cluster** command, whenever the RabbitMQ application is started on the current node it will attempt to connect to the nodes that were in the cluster when the node went down.

To leave a cluster, **reset** the node. You can also remove nodes remotely with the **forget\_cluster\_node** command.

For more details see the **clustering guide**\[2\].

**cluster\_status**

Displays all the nodes in the cluster grouped by node type, together with the currently running nodes.

**change\_cluster\_node\_type** {disc \| ram}

Changes the type of the cluster node. The node must be stopped for this operation to succeed, and when turning a node into a RAM node the node must not be the only disc node in the cluster.

**forget\_cluster\_node** \[--offline\]

\[--offline\]

Enables node removal from an offline node. This is only useful in the situation where all the nodes are offline and the last node to go down cannot be brought online, thus preventing the whole cluster from starting. It should not be used in any other circumstances since it can lead to inconsistencies.

Removes a cluster node remotely. The node that is being removed must be offline, while the node we are removing from must be online, except when using the **--offline** flag.

When using the **--offline** flag the node you connect to will become the canonical source for cluster metadata (e.g. which queues exist), even if it was not before. Therefore you should use this command on the latest node to shut down if at all possible.

**update\_cluster\_nodes** {clusternode}

clusternode

The node to consult for up to date information.

Instructs an already clustered node to contact **clusternode** to cluster when waking up. This is different from **join\_cluster** since it does not join any cluster - it checks that the node is already in a cluster with **clusternode**.

The need for this command is motivated by the fact that clusters can change while a node is offline. Consider the situation in which node A and B are clustered. A goes down, C clusters with B, and then B leaves the cluster. When A wakes up, it'll try to contact B, but this will fail since B is not in the cluster anymore. **update\_cluster\_nodes -n A C** will solve this situation.

**sync\_queue** {queue}

queue

The name of the queue to synchronise.

Instructs a mirrored queue with unsynchronised slaves to synchronise itself. The queue will block while synchronisation takes place (all publishers to and consumers from the queue will block). The queue must be mirrored for this command to succeed.

Note that unsynchronised queues from which messages are being drained will become synchronised eventually. This command is primarily useful for queues which are not being drained.

**cancel\_sync\_queue** {queue}

queue

The name of the queue to cancel synchronisation for.

Instructs a synchronising mirrored queue to stop synchronising itself.

**set\_cluster\_name** {name}

Sets the cluster name. The cluster name is announced to clients on connection, and used by the federation and shovel plugins to record where a message has been. The cluster name is by default derived from the hostname of the first node in the cluster, but can be changed.

### User management

Note that **rabbitmqctl** manages the RabbitMQ internal user database. Users from any alternative authentication backend will not be visible to **rabbitmqctl**.

**add\_user** {*username*} {*password*}

username

The name of the user to create.

password

The password the created user will use to log in to the broker.

**delete\_user** {*username*}

username

The name of the user to delete.

**change\_password** {*username*} {*newpassword*}

username

The name of the user whose password is to be changed.

newpassword

The new password for the user.

**clear\_password** {*username*}

username

The name of the user whose password is to be cleared.

**set\_user\_tags** {*username*} {*tag* ...}

username

The name of the user whose tags are to be set.

tag

Zero, one or more tags to set. Any existing tags will be removed.

**list\_users**

Lists users. Each result row will contain the user name followed by a list of the tags set for that user.

### Access control

Note that **rabbitmqctl** manages the RabbitMQ internal user database. Permissions for users from any alternative authorisation backend will not be visible to **rabbitmqctl**.

**add\_vhost** {*vhostpath*}

vhostpath

The name of the virtual host entry to create.

Creates a virtual host.

**delete\_vhost** {*vhostpath*}

vhostpath

The name of the virtual host entry to delete.

Deletes a virtual host.

Deleting a virtual host deletes all its exchanges, queues, bindings, user permissions, parameters and policies.

**list\_vhosts** \[*vhostinfoitem* ...\]

Lists virtual hosts.

The **vhostinfoitem** parameter is used to indicate which virtual host information items to include in the results. The column order in the results will match the order of the parameters. **vhostinfoitem** can take any value from the list that follows:

name

The name of the virtual host with non-ASCII characters escaped as in C.

tracing

Whether tracing is enabled for this virtual host.

If no **vhostinfoitem**s are specified then the vhost name is displayed.

**set\_permissions** \[-p *vhostpath*\] {*user*} {*conf*} {*write*} {*read*}

vhostpath

The name of the virtual host to which to grant the user access, defaulting to **/**.

user

The name of the user to grant access to the specified virtual host.

conf

A regular expression matching resource names for which the user is granted configure permissions.

write

A regular expression matching resource names for which the user is granted write permissions.

read

A regular expression matching resource names for which the user is granted read permissions.

Sets user permissions.

**clear\_permissions** \[-p *vhostpath*\] {*username*}

vhostpath

The name of the virtual host to which to deny the user access, defaulting to **/**.

username

The name of the user to deny access to the specified virtual host.

Sets user permissions.

**list\_permissions** \[-p *vhostpath*\]

vhostpath

The name of the virtual host for which to list the users that have been granted access to it, and their permissions. Defaults to **/**.

Lists permissions in a virtual host.

**list\_user\_permissions** {*username*}

username

The name of the user for which to list the permissions.

Lists user permissions.

### Parameter Management

Certain features of RabbitMQ (such as the federation plugin) are controlled by dynamic, cluster-wide *parameters*. Each parameter consists of a component name, a name and a value, and is associated with a virtual host. The component name and name are strings, and the value is an Erlang term. Parameters can be set, cleared and listed. In general you should refer to the documentation for the feature in question to see how to set parameters.

**set\_parameter** \[-p *vhostpath*\] {*component\_name*} {*name*} {*value*}

Sets a parameter.

component\_name

The name of the component for which the parameter is being set.

name

The name of the parameter being set.

value

The value for the parameter, as a JSON term. In most shells you are very likely to need to quote this.

**clear\_parameter** \[-p *vhostpath*\] {*component\_name*} {*key*}

Clears a parameter.

component\_name

The name of the component for which the parameter is being cleared.

name

The name of the parameter being cleared.

**list\_parameters** \[-p *vhostpath*\]

Lists all parameters for a virtual host.

### Policy Management

Policies are used to control and modify the behaviour of queues and exchanges on a cluster-wide basis. Policies apply within a given vhost, and consist of a name, pattern, definition and an optional priority. Policies can be set, cleared and listed.

**set\_policy** \[-p *vhostpath*\] \[--priority *priority*\] \[--apply-to *apply-to*\] {*name*} {*pattern*} {*definition*}

Sets a policy.

name

The name of the policy.

pattern

The regular expression, which when matches on a given resources causes the policy to apply.

definition

The definition of the policy, as a JSON term. In most shells you are very likely to need to quote this.

priority

The priority of the policy as an integer. Higher numbers indicate greater precedence. The default is 0.

apply-to

Which types of object this policy should apply to - "queues", "exchanges" or "all". The default is "all".

**clear\_policy** \[-p *vhostpath*\] {*name*}

Clears a policy.

name

The name of the policy being cleared.

**list\_policies** \[-p *vhostpath*\]

Lists all policies for a virtual host.

### Server Status

The server status queries interrogate the server and return a list of results with tab-delimited columns. Some queries (**list\_queues**, **list\_exchanges**, **list\_bindings**, and **list\_consumers**) accept an optional **vhost** parameter. This parameter, if present, must be specified immediately after the query.

The list\_queues, list\_exchanges and list\_bindings commands accept an optional virtual host parameter for which to display results. The default value is "/".

**list\_queues** \[-p *vhostpath*\] \[*queueinfoitem* ...\]

Returns queue details. Queue details of the **/** virtual host are returned if the "-p" flag is absent. The "-p" flag can be used to override this default.

The **queueinfoitem** parameter is used to indicate which queue information items to include in the results. The column order in the results will match the order of the parameters. **queueinfoitem** can take any value from the list that follows:

name

The name of the queue with non-ASCII characters escaped as in C.

durable

Whether or not the queue survives server restarts.

auto\_delete

Whether the queue will be deleted automatically when no longer used.

arguments

Queue arguments.

policy

Policy name applying to the queue.

pid

Id of the Erlang process associated with the queue.

owner\_pid

Id of the Erlang process representing the connection which is the exclusive owner of the queue. Empty if the queue is non-exclusive.

exclusive\_consumer\_pid

Id of the Erlang process representing the channel of the exclusive consumer subscribed to this queue. Empty if there is no exclusive consumer.

exclusive\_consumer\_tag

Consumer tag of the exclusive consumer subscribed to this queue. Empty if there is no exclusive consumer.

messages\_ready

Number of messages ready to be delivered to clients.

messages\_unacknowledged

Number of messages delivered to clients but not yet acknowledged.

messages

Sum of ready and unacknowledged messages (queue depth).

consumers

Number of consumers.

consumer\_utilisation

Fraction of the time (between 0.0 and 1.0) that the queue is able to immediately deliver messages to consumers. This can be less than 1.0 if consumers are limited by network congestion or prefetch count.

memory

Bytes of memory consumed by the Erlang process associated with the queue, including stack, heap and internal structures.

slave\_pids

If the queue is mirrored, this gives the IDs of the current slaves.

synchronised\_slave\_pids

If the queue is mirrored, this gives the IDs of the current slaves which are synchronised with the master - i.e. those which could take over from the master without message loss.

status

The status of the queue. Normally 'running', but may be "{syncing, MsgCount}" if the queue is synchronising.

If no **queueinfoitem**s are specified then queue name and depth are displayed.

**list\_exchanges** \[-p *vhostpath*\] \[*exchangeinfoitem* ...\]

Returns exchange details. Exchange details of the **/** virtual host are returned if the "-p" flag is absent. The "-p" flag can be used to override this default.

The **exchangeinfoitem** parameter is used to indicate which exchange information items to include in the results. The column order in the results will match the order of the parameters. **exchangeinfoitem** can take any value from the list that follows:

name

The name of the exchange with non-ASCII characters escaped as in C.

type

The exchange type (such as \[**direct**, **topic**, **headers**, **fanout**\]).

durable

Whether or not the exchange survives server restarts.

auto\_delete

Whether the exchange will be deleted automatically when no longer used.

internal

Whether the exchange is internal, i.e. cannot be directly published to by a client.

arguments

Exchange arguments.

policy

Policy name for applying to the exchange.

If no **exchangeinfoitem**s are specified then exchange name and type are displayed.

**list\_bindings** \[-p *vhostpath*\] \[*bindinginfoitem* ...\]

Returns binding details. By default the bindings for the **/** virtual host are returned. The "-p" flag can be used to override this default.

The **bindinginfoitem** parameter is used to indicate which binding information items to include in the results. The column order in the results will match the order of the parameters. **bindinginfoitem** can take any value from the list that follows:

source\_name

The name of the source of messages to which the binding is attached. With non-ASCII characters escaped as in C.

source\_kind

The kind of the source of messages to which the binding is attached. Currently always exchange. With non-ASCII characters escaped as in C.

destination\_name

The name of the destination of messages to which the binding is attached. With non-ASCII characters escaped as in C.

destination\_kind

The kind of the destination of messages to which the binding is attached. With non-ASCII characters escaped as in C.

routing\_key

The binding's routing key, with non-ASCII characters escaped as in C.

arguments

The binding's arguments.

If no **bindinginfoitem**s are specified then all above items are displayed.

**list\_connections** \[*connectioninfoitem* ...\]

Returns TCP/IP connection statistics.

The **connectioninfoitem** parameter is used to indicate which connection information items to include in the results. The column order in the results will match the order of the parameters. **connectioninfoitem** can take any value from the list that follows:

pid

Id of the Erlang process associated with the connection.

name

Readable name for the connection.

port

Server port.

host

Server hostname obtained via reverse DNS, or its IP address if reverse DNS failed or was not enabled.

peer\_port

Peer port.

peer\_host

Peer hostname obtained via reverse DNS, or its IP address if reverse DNS failed or was not enabled.

ssl

Boolean indicating whether the connection is secured with SSL.

ssl\_protocol

SSL protocol (e.g. tlsv1)

ssl\_key\_exchange

SSL key exchange algorithm (e.g. rsa)

ssl\_cipher

SSL cipher algorithm (e.g. aes\_256\_cbc)

ssl\_hash

SSL hash function (e.g. sha)

peer\_cert\_subject

The subject of the peer's SSL certificate, in RFC4514 form.

peer\_cert\_issuer

The issuer of the peer's SSL certificate, in RFC4514 form.

peer\_cert\_validity

The period for which the peer's SSL certificate is valid.

state

Connection state (one of \[**starting**, **tuning**, **opening**, **running**, **flow**, **blocking**, **blocked**, **closing**, **closed**\]).

channels

Number of channels using the connection.

protocol

Version of the AMQP protocol in use (currently one of **{0,9,1}** or **{0,8,0}**). Note that if a client requests an AMQP 0-9 connection, we treat it as AMQP 0-9-1.

auth\_mechanism

SASL authentication mechanism used, such as **PLAIN**.

user

Username associated with the connection.

vhost

Virtual host name with non-ASCII characters escaped as in C.

timeout

Connection timeout / negotiated heartbeat interval, in seconds.

frame\_max

Maximum frame size (bytes).

channel\_max

Maximum number of channels on this connection.

client\_properties

Informational properties transmitted by the client during connection establishment.

recv\_oct

Octets received.

recv\_cnt

Packets received.

send\_oct

Octets send.

send\_cnt

Packets sent.

send\_pend

Send queue size.

If no **connectioninfoitem**s are specified then user, peer host, peer port, time since flow control and memory block state are displayed.

**list\_channels** \[*channelinfoitem* ...\]

Returns information on all current channels, the logical containers executing most AMQP commands. This includes channels that are part of ordinary AMQP connections, and channels created by various plug-ins and other extensions.

The **channelinfoitem** parameter is used to indicate which channel information items to include in the results. The column order in the results will match the order of the parameters. **channelinfoitem** can take any value from the list that follows:

pid

Id of the Erlang process associated with the connection.

connection

Id of the Erlang process associated with the connection to which the channel belongs.

name

Readable name for the channel.

number

The number of the channel, which uniquely identifies it within a connection.

user

Username associated with the channel.

vhost

Virtual host in which the channel operates.

transactional

True if the channel is in transactional mode, false otherwise.

confirm

True if the channel is in confirm mode, false otherwise.

consumer\_count

Number of logical AMQP consumers retrieving messages via the channel.

messages\_unacknowledged

Number of messages delivered via this channel but not yet acknowledged.

messages\_uncommitted

Number of messages received in an as yet uncommitted transaction.

acks\_uncommitted

Number of acknowledgements received in an as yet uncommitted transaction.

messages\_unconfirmed

Number of published messages not yet confirmed. On channels not in confirm mode, this remains 0.

prefetch\_count

QoS prefetch limit for new consumers, 0 if unlimited.

global\_prefetch\_count

QoS prefetch limit for the entire channel, 0 if unlimited.

If no **channelinfoitem**s are specified then pid, user, consumer\_count, and messages\_unacknowledged are assumed.

**list\_consumers** \[-p *vhostpath*\]

List consumers, i.e. subscriptions to a queue's message stream. Each line printed shows, separated by tab characters, the name of the queue subscribed to, the id of the channel process via which the subscription was created and is managed, the consumer tag which uniquely identifies the subscription within a channel, a boolean indicating whether acknowledgements are expected for messages delivered to this consumer, an integer indicating the prefetch limit (with 0 meaning 'none'), and any arguments for this consumer.

**status**

Displays broker status information such as the running applications on the current Erlang node, RabbitMQ and Erlang versions, OS name, memory and file descriptor statistics. (See the **cluster\_status** command to find out which nodes are clustered and running.)

**environment**

Display the name and value of each variable in the application environment.

**report**

Generate a server status report containing a concatenation of all server status information for support purposes. The output should be redirected to a file when accompanying a support request.

**eval** {*expr*}

Evaluate an arbitrary Erlang expression.

### Miscellaneous

**close\_connection** {*connectionpid*} {*explanation*}

connectionpid

Id of the Erlang process associated with the connection to close.

explanation

Explanation string.

Instruct the broker to close the connection associated with the Erlang process id **connectionpid** (see also the **list\_connections** command), passing the **explanation** string to the connected client as part of the AMQP connection shutdown protocol.

**trace\_on** \[-p *vhost*\]

vhost

The name of the virtual host for which to start tracing.

Starts tracing.

**trace\_off** \[-p *vhost*\]

vhost

The name of the virtual host for which to stop tracing.

Stops tracing.

**set\_vm\_memory\_high\_watermark** {*fraction*}

fraction

The new memory threshold fraction at which flow control is triggered, as a floating point number greater than or equal to 0.

## EXAMPLES

**rabbitmqctl stop**

This command instructs the RabbitMQ node to terminate.

**rabbitmqctl stop\_app**

This command instructs the RabbitMQ node to stop the RabbitMQ application.

**rabbitmqctl start\_app**

This command instructs the RabbitMQ node to start the RabbitMQ application.

**rabbitmqctl wait /var/run/rabbitmq/pid**

This command will return when the RabbitMQ node has started up.

**rabbitmqctl reset**

This command resets the RabbitMQ node.

**rabbitmqctl force\_reset**

This command resets the RabbitMQ node.

**rabbitmqctl rotate\_logs .1**

This command instructs the RabbitMQ node to append the contents of the log files to files with names consisting of the original logs' names and ".1" suffix, e.g. rabbit@mymachine.log.1 and rabbit@mymachine-sasl.log.1. Finally, logging resumes to fresh files at the old locations.

**rabbitmqctl join\_cluster hare@elena --ram**

This command instructs the RabbitMQ node to join the cluster that **hare@elena** is part of, as a ram node.

**rabbitmqctl cluster\_status**

This command displays the nodes in the cluster.

**rabbitmqctl change\_cluster\_node\_type disc**

This command will turn a RAM node into a disc node.

**rabbitmqctl -n hare@mcnulty forget\_cluster\_node rabbit@stringer**

This command will remove the node **rabbit@stringer** from the node **hare@mcnulty**.

**rabbitmqctl set\_cluster\_name london**

This sets the cluster name to "london".

**rabbitmqctl add\_user tonyg changeit**

This command instructs the RabbitMQ broker to create a (non-administrative) user named **tonyg** with (initial) password **changeit**.

**rabbitmqctl delete\_user tonyg**

This command instructs the RabbitMQ broker to delete the user named **tonyg**.

**rabbitmqctl change\_password tonyg newpass**

This command instructs the RabbitMQ broker to change the password for the user named **tonyg** to **newpass**.

**rabbitmqctl clear\_password tonyg**

This command instructs the RabbitMQ broker to clear the password for the user named **tonyg**. This user now cannot log in with a password (but may be able to through e.g. SASL EXTERNAL if configured).

**rabbitmqctl set\_user\_tags tonyg administrator**

This command instructs the RabbitMQ broker to ensure the user named **tonyg** is an administrator. This has no effect when the user logs in via AMQP, but can be used to permit the user to manage users, virtual hosts and permissions when the user logs in via some other means (for example with the management plugin).

**rabbitmqctl set\_user\_tags tonyg**

This command instructs the RabbitMQ broker to remove any tags from the user named **tonyg**.

**rabbitmqctl list\_users**

This command instructs the RabbitMQ broker to list all users.

**rabbitmqctl add\_vhost test**

This command instructs the RabbitMQ broker to create a new virtual host called **test**.

**rabbitmqctl delete\_vhost test**

This command instructs the RabbitMQ broker to delete the virtual host called **test**.

**rabbitmqctl list\_vhosts name tracing**

This command instructs the RabbitMQ broker to list all virtual hosts.

**rabbitmqctl set\_permissions -p /myvhost tonyg "^tonyg-.\*" ".\*" ".\*"**

This command instructs the RabbitMQ broker to grant the user named **tonyg** access to the virtual host called **/myvhost**, with configure permissions on all resources whose names starts with "tonyg-", and write and read permissions on all resources.

**rabbitmqctl clear\_permissions -p /myvhost tonyg**

This command instructs the RabbitMQ broker to deny the user named **tonyg** access to the virtual host called **/myvhost**.

**rabbitmqctl list\_permissions -p /myvhost**

This command instructs the RabbitMQ broker to list all the users which have been granted access to the virtual host called **/myvhost**, and the permissions they have for operations on resources in that virtual host. Note that an empty string means no permissions granted.

**rabbitmqctl list\_user\_permissions tonyg**

This command instructs the RabbitMQ broker to list all the virtual hosts to which the user named **tonyg** has been granted access, and the permissions the user has for operations on resources in these virtual hosts.

**rabbitmqctl set\_parameter federation local\_username '"guest"'**

This command sets the parameter **local\_username** for the **federation** component in the default virtual host to the JSON term **"guest"**.

**rabbitmqctl clear\_parameter federation local\_username**

This command clears the parameter **local\_username** for the **federation** component in the default virtual host.

**rabbitmqctl list\_parameters**

This command lists all parameters in the default virtual host.

**rabbitmqctl set\_policy federate-me "^amq." '{"federation-upstream-set":"all"}'**

This command sets the policy **federate-me** in the default virtual host so that built-in exchanges are federated.

**rabbitmqctl clear\_policy federate-me**

This command clears the **federate-me** policy in the default virtual host.

**rabbitmqctl list\_policies**

This command lists all policies in the default virtual host.

**rabbitmqctl list\_queues -p /myvhost messages consumers**

This command displays the depth and number of consumers for each queue of the virtual host named **/myvhost**.

**rabbitmqctl list\_exchanges -p /myvhost name type**

This command displays the name and type for each exchange of the virtual host named **/myvhost**.

**rabbitmqctl list\_bindings -p /myvhost exchange\_name queue\_name**

This command displays the exchange name and queue name of the bindings in the virtual host named **/myvhost**.

**rabbitmqctl list\_connections send\_pend port**

This command displays the send queue size and server port for each connection.

**rabbitmqctl list\_channels connection messages\_unacknowledged**

This command displays the connection process and count of unacknowledged messages for each channel.

**rabbitmqctl status**

This command displays information about the RabbitMQ broker.

**rabbitmqctl report \> server\_report.txt**

This command creates a server report which may be attached to a support request email.

**rabbitmqctl eval 'node().'**

This command returns the name of the node to which rabbitmqctl has connected.

**rabbitmqctl close\_connection "\<rabbit@tanto.4262.0\>" "go away"**

This command instructs the RabbitMQ broker to close the connection associated with the Erlang process id **\<rabbit@tanto.4262.0\>**, passing the explanation **go away** to the connected client.

## AUTHOR

**The RabbitMQ Team \<\<info@rabbitmq.com\>\>**

## NOTES

- 1\.

  installation guide

  http://www.rabbitmq.com/install.html

- 2\.

  clustering guide

  http://www.rabbitmq.com/clustering.html
