Provided by: rabbitmq-server_1.7.2-1ubuntu1_all
rabbitmqctl - command line tool for managing a RabbitMQ broker
rabbitmqctl [-n node] <command> [command options]
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.
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) 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.
APPLICATION AND CLUSTER MANAGEMENT
Stop the Erlang node on which RabbitMQ broker is running.
Stop 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.
Start the RabbitMQ application. This command is typically run
prior to performing other management actions that require the
RabbitMQ application to be stopped, e.g. reset.
Display various information about the RabbitMQ broker, such as
whether the RabbitMQ application on the current node, its version
number, what nodes are part of the broker, which of these are
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, vhosts and deletes all
The same as reset command, but 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.
Instruct the RabbitMQ node to rotate the log files. The RabbitMQ
broker will attempt to append the current contents of the log file
to the file with the name composed of the original name and the
suffix. It will create a new file if such a file does not already
exist. When no suffix is specified, the empty log file is simply
created at the original location; no rotation takes place. When an
error occurs while appending the contents of the old log file, the
operation behaves in the same way as if no suffix was specified.
This command might be helpful when you are e.g. writing your own
logrotate script and you do not want to restart the RabbitMQ node.
cluster clusternode ...
Instruct the node to become member of a cluster with the specified
nodes determined by clusternode option(s). See
<http://www.rabbitmq.com/clustering.html> for more information
close_connection connectionpid explanation
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.
add_user username password
Create a user named username with (initial) password password.
Delete the user named username.
change_password username newpassword
Change the password for the user named username to newpassword.
List all users, one per line.
Create a new virtual host called vhostpath.
Delete a virtual host vhostpath. This command deletes also all its
exchanges, queues and user mappings.
List all virtual hosts, one per line.
set_permissions [-p vhostpath] username regexp regexp regexp
Set the permissions for the user named username in the virtual host
vhostpath, granting configure, write and read access to resources
with names matching the first, second and third regexp,
clear_permissions [-p vhostpath] username
Remove the permissions for the user named username in the virtual
list_permissions [-p vhostpath]
List all the users and their permissions in the virtual host
vhostpath. Each output line contains the username and their
configure, write and read access regexps, separated by tab
List the permissions of the user named username across all virtual
list_queues [-p vhostpath] [queueinfoitem ...]
List queue information by virtual host. Each line printed describes
a queue, with the requested queueinfoitem values separated by tab
characters. If no queueinfoitems are specified then name and
messages are assumed.
Queue information items
name of the queue
whether the queue survives server restarts
whether the queue will be deleted when no longer used
pid id of the Erlang process associated with the queue
id of the Erlang process representing the connection which is the
exclusive owner of the queue, or empty if the queue is non-
id of the Erlang process representing the channel of the exclusive
consumer subscribed to this queue, or empty if there is no
consumer tag of the exclusive consumer subscribed to this queue, or
empty if there is no exclusive consumer
number of messages ready to be delivered to clients
number of messages delivered to clients but not yet acknowledged
number of messages published in as yet uncommitted transactions
sum of ready, unacknowledged and uncommitted messages
number of acknowledgements received in as yet uncommitted
number of consumers
number of transactions
bytes of memory consumed by the Erlang process for the queue,
including stack, heap and internal structures
list_exchanges [-p vhostpath] [exchangeinfoitem ...]
List queue information by virtual host. Each line printed describes
an exchange, with the requested exchangeinfoitem values separated
by tab characters. If no exchangeinfoitems are specified then name
and type are assumed.
Exchange information items
name of the exchange
exchange type (direct, topic, fanout, or headers)
whether the exchange survives server restarts
whether the exchange is deleted when no longer used
list_bindings [-p vhostpath]
List bindings by virtual host. Each line printed describes a
binding, with the exchange name, queue name, routing key and
arguments, separated by tab characters.
list_connections [connectioninfoitem ...]
List current AMQP connections. Each line printed describes a
connection, with the requested connectioninfoitem values separated
by tab characters. If no connectioninfoitems are specified then
user, peer_address, peer_port and state are assumed.
Connection information items
pid id of the Erlang process associated with the connection
server IP number
connection state (pre-init, starting, tuning, opening, running,
number of channels using the connection
username associated with the connection
maximum frame size (bytes)
informational properties transmitted by the client during
send queue size
list_channels [channelinfoitem ...]
List channel information. Each line printed describes a channel,
with the requested channelinfoitem values separated by tab
characters. If no channelinfoitems are specified then pid, user,
transactional, consumer_count, and messages_unacknowledged are
The list includes channels which are part of ordinary AMQP
connections (as listed by list_connections) and channels created by
various plug-ins and other extensions.
Channel information items
pid id of the Erlang process associated with the channel
id of the Erlang process associated with the connection to which
the channel belongs
the number of the channel, which uniquely identifies it within a
username associated with the channel
virtual host in which the channel operates
true if the channel is in transactional mode, false otherwise
number of logical AMQP consumers retrieving messages via the
number of messages delivered via this channel but not yet
number of acknowledgements received in an as yet uncommitted
QoS prefetch count limit in force, 0 if unlimited
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, and a
boolean indicating whether acknowledgements are expected for
messages delivered to this consumer.
The list_queues, list_exchanges, list_bindings and list_consumers
commands accept an optional virtual host parameter for which to display
results, defaulting to "/". The default can be overridden with the -p
Various items that may appear in the output of rabbitmqctl can contain
arbitrary octets. If a octet corresponds to a non-printing ASCII
character (values 0 to 31, and 127), it will be escaped in the output,
using a sequence consisting of a backslash character followed by three
octal digits giving the octet’s value (i.e., as used in string literals
in the C programming language). An octet corresponding to the
backslash character (i.e. with value 92) will be escaped using a
sequence of two backslash characters. Octets with a value of 128 or
above are not escaped, in order to preserve strings encoded with UTF-8.
The items to which this escaping scheme applies are:
· Virtual host names
· Queue names
· Exchange names
· Regular expressions used for access control
Create a user named foo with (initial) password bar at the Erlang node
rabbitmqctl -n rabbit@test add_user foo bar
Grant user named foo access to the virtual host called test at the
default Erlang node:
rabbitmqctl map_user_vhost foo test
Append the current logs’ content to the files with ".1" suffix and
rabbitmqctl rotate_logs .1
rabbitmq.conf(5), rabbitmq-multi(1), rabbitmq-server(1)
The RabbitMQ Team <firstname.lastname@example.org>
RabbitMQ Web Site: <http://www.rabbitmq.com>
Hey! The above document had some coding errors, which are explained
Around line 458:
’=item’ outside of any ’=over’